What a difference a capital makes….

My Ruby journey continues. I made a little web app that sends an email through an open SMTP server. Its very basic, but it works (and heck, I am proud).

nn

Ran into a weird error however. When I launched my app using rackup, I received the following error:

nn

/Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:43:in `const_get': wrong constant name Sinatra-mail-example (NameError)n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:43:in `parse_file'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/bin/rackup:23:in `load'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/bin/rackup:23:in `<main>'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'n    from /Users/johnpitchko/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'nn20:59:23 [rerun] Sinatra-mail-example Launch Failedn

nn

When I launched the app by just calling the ruby executable, it quit immediately without any error message.

nn

It turns out that I used

nn

require 'Bundler'n

nn

instead of

nn

require 'bundler'n

nn

So, the lesson here is to keep capitalization in mind when coding!

Leave a Reply

Your email address will not be published. Required fields are marked *