2012-08-25 34 views
2

我使用Capistrano將我的rails 3應用程序部署到生產服務器上。部署是正確的,應用程序服務器正確重新啓動,但是當我登錄到生產服務器,並進入「my_path的/電流」,我不能運行「軌道C」:Capistrano部署後未在目標服務器上找到的寶石

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

我檢查了寶石表,一切似乎是正確安裝,但。

我的配置/ 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, "[email protected]: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 

回答

0

嘗試bundle exec rails c。同時檢查當您在瀏覽器中訪問該頁面時拋出什麼錯誤(如果有的話)

+0

使用bundle exec嘗試時,出現錯誤:未安裝Gem bundler,先運行gem install bundler。然而,bundler(1.1.3)在'gem list'中正確列出。 – Luc

+0

你碰巧在使用rvm嗎?我有類似的問題 – JamesSwift

+0

是的,我使用rvm。 – Luc

相關問題