/ RUBY, ERRORS

Errors

These are a few of my very first Ruby errors and how I solved them:

  1. syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)

    • I was missing an end
  2. in `require': cannot load such file -- dictionary.rb (LoadError)

    • require only works if you’ve defined the proper scope of your project
  3. 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
  4. undefined local variable or method `ilast_letter' for #<String...'

    • I accidentally threw an extra character onto the beginning of my variable