Capistrano部署后,目标服务器上找不到宝石

时间:2012-08-25 12:37:32

标签: ruby-on-rails ruby ruby-on-rails-3 capistrano

我使用Capistrano将rails 3 app部署到生产服务器上。部署是正确的,应用程序服务器已正确重新启动,但当我登录到生产服务器并进入“my_path / current”时,我无法运行“rails c”:

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

我检查了宝石列表,但一切似乎都已正确安装。

我的config / deploy.rb文件是:

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

1 个答案:

答案 0 :(得分:0)

试试bundle exec rails c。还要检查在浏览器中访问该页面时引发的错误(如果有)