views:

29

answers:

1

My RoR app works fine when run locally, but when I run it on Heroku, it errors on this line:

my_reader = Docreader.new(params[:doc])

Error:

NameError (uninitialized constant NotesController::Docreader):

Docreader.rb is located in the lib folder

I've tried heroku restart, but it didn't help. What am I doing wrong? Thanks for reading.

+1  A: 

The likely culprit is the uppercase letter D in Docreader.rb. You need to make sure it is named docreader.rb - in all lower-case letters. Heroku uses a case-sensitive file system, so a mixed case file will work locally in OS X or Windows, but not on Heroku.

In general, it is not advised to use any upper-case letters in your filenames with Ruby on Rails (and lowercase is also the de-facto standard in Ruby), as Rails's auto-loading code always uses lowercase.

wuputah