2

I am trying to deploy my first Rails app. I copied all files to ~/mysite.com and set up MySql.

Here's my configuration at Dreamhost.

Now when I visit mysite.com I get a 404 error (which isn't my custom 404 error). It seems that Passenger does not run!

What should I do? Do I need to start Passenger? (touch tmp/restart.txt does nothing)

collimarco
  • 34,231
  • 36
  • 108
  • 142

2 Answers2

1

4 things to check first:

  1. You enabled Ruby on Rails Passenger (mod_rails) for the domain name
  2. You point your domain name configuration to the public directory of your application.
  3. Your Rails Version (As of 8/5/2009 Rails is up to 2.3.3 but Dreamhost is at 2.2.2)
  4. All your gem dependencies are available at Dreamhost, in your home folder, or are unpacked in your rails application.

If passenger is giving you an error message then your rails app isn't starting, but passenger will put something in the apache logs.

These are in: ~/logs/domain.name/http/

Usually this is because of the wrong rails version or a missing gem or some other mismatch between the dreamhost environment and your development machine.

danivovich
  • 4,197
  • 4
  • 30
  • 31
1

Based on your stack trace at http://www.foto-fiori.com/ it looks like there's a gem missing on your production server. Check the gem list in your environment.rb config file and ensure all gems are installed. You can also ssh into your application and run rake gems.

rake gems RAILS_ENV=production

You may want to freeze the gems if Dreamhost does not allow you to install them.

rake rails:freeze:gems
ryanb
  • 16,227
  • 5
  • 51
  • 46
  • $ rake gems (in /mnt/local/home/collimarco/foto-fiori.com) - [I] mysql - [I] mini_exiftool I = Installed – collimarco Aug 05 '09 at 21:06
  • Can you run "script/console production" in your rails app on dreamhost? – ryanb Aug 05 '09 at 22:05
  • $ script/console production Loading production environment (Rails 2.3.3) >> User.count => 7 – collimarco Aug 06 '09 at 10:10
  • 1
    Interesting, and that is done when you ssh into your dreamhost server? I'm not too familiar with how Dreamhost is setup, but is it possible that there are multiple versions of Ruby installed? Perhaps Passenger is using a different one than your account is. A different version will likely have a different set of rubygems installed. – ryanb Aug 06 '09 at 14:30
  • 1
    Also take a look at the wiki page: http://wiki.dreamhost.com/Passenger. Try specifying the gem path as they show there. It's the 4th point down in the Technical Notes section. – ryanb Aug 06 '09 at 14:37
  • Thanks @ryanb! script/console runs with my user configuration, while Passenger runs as another user on DH (and so it didn't read my user config). I changed ENV variable in environment.rb and now everything works. – collimarco Aug 07 '09 at 09:26