Reputation: 13621
When deploying a rails app via capistrano, i get the following error:
[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
I have ruby installed into /usr/local, I'm not using anything like RVM. Here's my 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
I'm sure im just missing something simple here. But i can't quite seem to find it.
Upvotes: 2
Views: 1716
Reputation: 13621
I deleted the set :default_environment
call. I had that in an older script, which i think was mostly for RVM rather than a system install. Getting rid of that fixed it. So i guess the path got messed up somehow.
Upvotes: 3