I’ve managed to get a Rails app deployed with Capistrano to a server running NGinx & Passenger. On deploy I was getting the “We’re sorry, something went wrong” message & was rather confused as the production log was blank. I then switched the rails_env to development in my NGinx Conf & now I’m getting:
SQLite3::CantOpenException
unable to open database file
Rails.root: /www/testcap/releases/20120407015032
I logged into the server, into the current folder within testcap (which I believe symlinks to the latest release) and ran rake db:create, however the db files exist. Having looked within the app’s db folder I see both development.db & test.db.
If I run rails s -e production and then head to myurl.com:3000 the app works completely fine, which is weird, and it also works fine when I run rails s -e development too.
I’m at a complete loss as to what the issue might be here. I’m sure it must be a relatively obvious issue, potentially with capistrano? I’m still new to it so I could well have missed anything but googling so far has been fruitless.
The only thing I can think of is that I’ve nothing explicitly relating to databases in my config/deploy.rb ? However I’ve not been able to find any guides on the net to help out thus far.
Thanks in advance for your help 🙂
Jack.
Thanks to the comments from Adam P & Ben L above, I managed to make some head way on this. This Guide also solved my issue.
I followed the steps in that guide above and in my
database.ymlfile I changed the path to theproductiondb from:To
(eg the absolute path)
I then added this to my
config/deploy.rb:On my VPS I went into the nginx conf & removed the line
rails_env development(Passenger then sets it toproductionby default).And then ran
cap deployfollowed bycap deploy:migrate, which worked, and I get the app displayed when I visit the URL.I hope this might help someone out in the future stuck on the same issue 🙂
Jack.