我正在使用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`
不起作用。 有帮助吗?非常感谢你!
答案 0 :(得分:0)
你应该使用capistrano / rbenv。 Capistrano不会通过ssh启动交互式shell。因此,您的.bash_profile
将无法加载。