Errors
These are a few of my very first Ruby errors and how I solved them:
-
syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)
- I was missing an
end
- I was missing an
-
in `require': cannot load such file -- dictionary.rb (LoadError)
require
only works if you’ve defined the proper scope of your project
-
in `require_relative': cannot load such file -- /Users/beth/Code/ruby-toy__string-segmentation/dictionary.rb (LoadError)
- I forgot to add the ‘lib’ directory to my file structure. I was using ../dictionary.rb instead of ../lib/dictionary.rb
-
undefined local variable or method `ilast_letter' for #<String...'
- I accidentally threw an extra character onto the beginning of my variable
Subscribe to Beth Haubert
Get the latest posts delivered right to your inbox