There are probably several causes of this, but the one that got me was having a config.ru
file in my home directory:
Rails3 attempts to figure out where your application's root directory is. The logic for this is begin looking in the directory ../railties/lib/rails/application
, and then walking up the path looking for a directory with config.ru
and assuming that is the app root - if none is found then the current working directory is the app root.
If your Gems are installed in a subdirectory of your home dir (RVM, Local Gems and Bundler do this) then at one point this will check for the existence of config.ru
in your home dir. If this exists it will try to load the application from your home dir.
The solution is to not have config.ru
in your home dir