2

I deployed my rails 3 app onto the production server using Capistrano. The deployment is correct, the application server is correctly restarted but when I log onto the production server and go into "my_path/current", I cannot run "rails c":

The program 'rails' is currently not installed.  You can install it by typing:
sudo apt-get install rails

I checked the gem list and everything seems to be correctly installed though.

My config/deploy.rb file is:

require "bundler/capistrano"

# Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))

# Load RVM's capistrano plugin.    
require "rvm/capistrano"

set :rvm_ruby_string, '1.9.3'
set :rvm_type, :user  # Don't use system-wide RVM

set :application, "MyApp"
set :repository,  "git@github.com:user/myapp.git"
set :scm, :git
set :branch, "master"
set :scm_verbose, true
set :scm_username, "user"               # GITHUB user name
set :user, "user"                     # VPS user name
set :scm_passphrase, "pass"        # VPS password
set :deploy_to, "/home/luc/be"
set :use_sudo, false

server "my_server", :web, :app, :db, :primary => true

# start / stop application server
namespace :deploy do
  task :start do
    invoke_command "cd /home/luc/be/current; bundle exec thin start -C config/thin.config"
  end
  task :stop do
    invoke_command "cd /home/luc/be/current; bundle exec thin stop -C config/thin.config"
  end
  task :restart do
    invoke_command "cd /home/luc/be/current; bundle exec thin restart -C     config/thin.config"
  end
end
Luc
  • 16,604
  • 34
  • 121
  • 183

1 Answers1

0

Try bundle exec rails c. Also check what error, if any, is thrown when you visit the page in your browser

JamesSwift
  • 863
  • 1
  • 7
  • 16
  • When trying with bundle exec, I got 'ERROR: Gem bundler is not installed, run `gem install bundler` first.'. bundler (1.1.3) is correctly listed in 'gem list' though. – Luc Aug 26 '12 at 06:50
  • Do you happen to be using rvm? I've had a similar issue – JamesSwift Aug 26 '12 at 17:16
  • @Luc - Maybe the solution posted [here](http://stackoverflow.com/questions/5072197/how-to-deploy-a-test-app-on-dreamhost-rails-3-0-4) will help you. Specifically, try bundling your environment into the vendor so that passenger doesn't get confused about the path to your gems. – JamesSwift Sep 03 '12 at 19:54