Rails troubleshooting
From DreamHost
Ruby on Rails is considered an advanced topic and is not recommended for anyone new to webhosting or programming.
To familiarize or update your Rails knowledge I recommend viewing the Ruby On Rails web site [1]
Contents |
A folder named 'public'
Starting in June 2008 all Passenger (mod_rails) enabled sites will need to point to a folder named public. This started after many customers who has no need for passenger / rails innocently enabled it for their domains (thus needlessly increasing the load on the server). If you use symlinks for your site, simply make sure your symlink is named “public”
Stats/PHPMyAdmin missing?
One of the few drawbacks with passenger is that it disabled any re-write rules you or we have setup for your domain. Unfortunately this will break your site's stats and phpMyAdmin pages.
To view your stats you will need to use the command line
To access phpMyadmin you will need to use an alternative MySQL hostname to connect to (any valid mysql hostname not under a passeger enabled domain should do)
Passenger picky with which Rails
One of the benefits with passenger is how quickly and efficiently it can load up the rails libraries. This is also a drawback, as the only version of Rail you will be able to load up is whichever current version we have bundled with passenger (currently 2.0 as of July 2008)
We're sorry, but something went wrong.
Rails can be a bit tricky with it's "something went wrong" error. Luckily, it's not hard to track down what went wrong if you know where to look.
The first place to look for any errors in your application is in the logs/production.log (or appropriate environment log file, development.log, test.log or fastcgi-crash.log if running fastCGI). This will tell you exactly what went wrong and where.
Common environment .log errors:
ActionView::TemplateError (undefined method `jibberish' for #<Post:0x4130fd54>) on line #11 of posts/show.html.erb: 8: <%=h @post.data %> 9: </p> 10: 11: <%= @post.jibberish %> 12: 13: <%= link_to 'Edit', edit_post_path(@post) %> | 14: <%= link_to 'Back', posts_path %> /usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in `method_missing'
Processing PostsController#show [GET]
Session ID: BAh7BzoMY3NyZl9pZCIlMjU0MjFkOGU0ZjZiYjRkZThiNzY3MWc74cf7a1cb49d1c2f59c5314d2963c
Parameters: {"action"=>"show", "id"=>"2", "controller"=>"posts"}
NoMethodError (undefined method `bad_call' for #<Class:0x41305f70>):
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1532:in `method_missing'
These types of errors probably mean you either have not updated your database or controller to handle the methods outlined in your views. A possible fix would be to run rake db:migrate or update your view, model or controller file (as appropriate) to correct the failure (line #11 of posts/show.html.erb or the bad_call method listed in the Post controller (under show))
Database connection issues
A properly setup database.yml will look something like this:
development: adapter: mysql database: developmentDatabaseName username: DBuserName password: yourSecretPassword host: mysql.yourdomain.com test: adapter: mysql database: testDatabaseName username: DBuserName password: yourSecretPassword host: mysql.yourdomain.com production: adapter: mysql database: productionDatabaseName username: DBuserName password: yourSecretPassword host: mysql.yourdomain.com
Using SQLite is not recommended, more importantly using “localhost” as the host for MySQL will not work.

