2013-01-24 50 views
2

在部署rails应用程序经由Capistrano的,我得到以下错误:Capistrano的找不到捆绑(> = 0)之间[](宝石:: LoadError)

[example.com] executing command 
** [out :: example.com] /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [] (Gem::LoadError) 
** [out :: example.com] from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' 
** [out :: example.com] from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem' 
** [out :: example.com] from /usr/local/bin/bundle:22:in `<main>' 
    command finished in 181ms 

我已经红宝石安装在/ usr /本地,我没有使用任何像RVM。这里是我的deploy.rb:

require 'bundler/capistrano' 
load 'deploy/assets' 

set :default_environment, { 
    'PATH' => "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:$PATH", 
    "RUBY_VERSION" => "ruby 1.9.3", 
    "GEM_HOME" => "/usr/local/lib/ruby/gems/1.9.1/gems", 
    "GEM_PATH" => "/usr/local/lib/ruby/gems/1.9.1/gems", 
    "BUNDLE_PATH" => "/usr/local/lib/ruby/gems/1.9.1/gems" 
} 

set :application, "appname" 
set :repository, "[email protected]/something.git" 
set :user, "thebestuserever" 
set :scm_username, "somegithubaccount" 
set :use_sudo, true 
set :branch, "master" 
ssh_options[:forward_agent] = true 
default_run_options[:pty] = true 

set :scm, :git 
set :deploy_to, "/application/path" 

role :web, "example.com" 
role :app, "example.com" 
role :db, "example.com", :primary => true 

namespace :deploy do 
    desc "Restarting mod_rails with restart.txt" 
    task :restart, :roles => :app, :except => { :no_release => true } do 
     run "touch #{current_path}/tmp/restart.txt" 
    end 

    [:start, :stop].each do |t| 
     desc "#{t} task is a no-op with mod_rails" 
     task t, :roles => :domain do ; end 
    end 
end 

task :after_update_code do 
    run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml" 
    run "cd #{release_path}; rake assets:precompile RAILS_ENV=production " 
    run "cd #{release_path}; ./script/delayed_job restart" 
end 

我敢肯定,我只是想在这里简单的东西。但我似乎无法找到它。

回答

3

我删除了set :default_environment调用。我在一个较旧的脚本中使用过,我认为这主要是针对RVM而不是系统安装。摆脱它固定它。所以我猜想这个道路不知何故就搞砸了。

+0

它适合我,谢谢! –

相关问题