2013-10-24 130 views
0

警告:我是capistrano和rvm的一個新手。不用鐵軌。 我在我的部署腳本中使用rvm-capistrano在ruby 1.9.3上創建gemset。看來這工作正常。問題是當它試圖預編譯資產時,它使用我的共享/ bundle/ruby​​/1.9.1/gems目錄中的gem。這是一個問題,但我不知道該如何去解決這個問題...... Bundler放置gem的問題,gemset位置指向的位置,還是隻是不嘗試使用gemset。有任何想法嗎?這裏是我的部署腳本:capistrano部署不使用gemset

require 'mana/server_ec2' 
# setup rvm 
require 'rvm/capistrano' 
set :rvm_ruby_string, :local    # use the same ruby as used locally for deployment 
#set :rvm_autolibs_flag, "read-only"  # more info: rvm help autolibs 

#before 'deploy', 'rvm:install_rvm' # install/update RVM 
#before 'deploy', 'rvm:install_ruby' # install Ruby and create gemset, OR: 
# before 'deploy:setup', 'rvm:create_gemset' # only create gemset 
before :deploy, 'rvm:create_gemset' 

set :default_stage, :vagrant 

set :ruby_version, :brightbox 
set :care_about_ruby_version, false 

set :chef_version, '~> 11.4.0' 

set :railsapp, 
    server_names: '_' 

set :run_list, %w(
    recipe[monit] 
    recipe[resque] 
) 

set :runner, 'nobody' 
set :keep_releases, 10 

task :set_permissions, :roles => :web do 
    run "sudo chmod 777 #{current_release}/tmp #{current_release}/tmp/pids -R" 
end 

after 'deploy:restart', 'deploy:restart_unicorn' 
after 'deploy:finalize_update', :set_permissions 

before 'deploy:assets:precompile' do 
    #upload 'vendor/assets/components.zip', "#{latest_release}/vendor/assets", via: :scp 
    #run "cd #{latest_release}/vendor/assets && unzip -o #{latest_release}/vendor/assets/components.zip" 
    run "cd #{latest_release} && bower install" 
end 

set :resque, queues: { "*" => 2 } 

after 'deploy:update', 'deploy:cleanup' 

after 'deploy:restart' do 
    sudo "monit -g #{application}-resque restart" 
end 

讓我知道如果有任何其他信息會有所幫助。謝謝!

+0

你能添加上Capistrano的失敗行了? – fotanus

+0

嘗試更新紅寶石版本並首先在服務器上進行捆綁。 – tihom

回答