cap staging deploy:bash:bundle:找不到命令

时间:2016-10-05 11:28:41

标签: ruby-on-rails capistrano rbenv

我正在使用rbenv在CentOS 7上运行我的Rails 5项目。当我运行cap staging deploy时出现错误:

cd /srv/www/stagings/testproject/current; bundle exec rake db:migrate RAILS_ENV=staging stderr: bash: bundle: command not found

** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:

  INFO [f7a6296f] Finished in 0.256 seconds with exit status 0 (successful).

我可以在部署目录bundle install中运行/srv/www/stagings/testproject/current 没有任何问题。

的.bash_profile

PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
eval "$(rbenv init -)"

ruby​​,gem,bundler 版本:

which ruby
~/.rbenv/shims/ruby
which bundle
~/.rbenv/shims/bundle' 
which gem
~/.rbenv/shims/gem

我试过

 gem uninstall bundler
 gem install bundler`

不起作用。 有帮助吗?非常感谢你!

1 个答案:

答案 0 :(得分:0)

你应该使用capistrano / rbenv。 Capistrano不会通过ssh启动交互式shell。因此,您的.bash_profile将无法加载。