Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't access Rails console for app deployed on Passenger using Capistrano & RVM

After finally managing to get my Rails app working, I've got stuck with a slightly perplexing problem. I've deployed my Rails 3.0.5 app to a Ubuntu 10.10 server with Capistrano, RVM and Nginx. All is working nicely and I can confirm Rails is working as I'm getting data from the database and meaningful log messages.

The problem is that on the server, I can't access the console. When I try

rails c

It says "The program 'rails' is currently not installed. To run 'rails' please ask your administrator to install the package 'rails'"

However it is installed otherwise my application wouldn't work! I've only got two RVM gemsets installed, the global one and one called "rails305". Trying

rvm gemset use rails305

then

gem list

doesn't show any of the gems that my app needs, however they must be installed because 1) the app wouldn't work without them and 2) in my Capistrano deploy script, bundler installs them (to that gemset). So the problem is obviously something to do with RVM but I can't work out what it is... anyone any ideas?

like image 723
Dave Hollingworth Avatar asked Mar 16 '11 21:03

Dave Hollingworth


1 Answers

It looks like Capistrano uses bundler so you might want to try

bundle exec rails c

from the deployment directory.

See the Bundler deployment page for more information.

like image 74
Ash Berlin-Taylor Avatar answered Oct 06 '22 08:10

Ash Berlin-Taylor