0

I've got some trouble to deploy my Rails App.

I've got this message:

sh: 1:
bundle: not found

Here is my gemfile (only capistrano part) :

gem "capistrano", "2.15.5"

Here is my deploy (just the important part about rbenv)

set(:deploy_to) { "/home/#{user}/#{application}_#{rails_env}" } set :default_environment, { 'PATH' => '$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH' }

On the server when I typeruby -v I get ruby 2.0.0p247. And when I type which bundle I get /home/paul/.rbenv/shims/bundle.

What's the problem? Why do I get this message?

Thanks for your help.

Bonifacio2
  • 3,405
  • 6
  • 34
  • 54
p0k3
  • 333
  • 5
  • 23
  • possible duplicate of [Rails 3 -- Bundler/Capistrano Errors](http://stackoverflow.com/questions/3737678/rails-3-bundler-capistrano-errors) – Johan Mar 30 '14 at 00:41

1 Answers1

-1

Capistrano executes the commands in a very basic shell so the $PATH environment are not the same as when you login through SSH.

One way to solve this is by setting PermitUserEnvironment to yes in /etc/sshd_config and then add the correct PATH to ~/.ssh/environment

another way can be to

In you config/deploy.rb add the following snippet

set :default_environment, {
  'PATH' => "/opt/ruby-enterprise/bin/:$PATH"
}
aelor
  • 10,892
  • 3
  • 32
  • 48