【问题标题】:cap staging deploy: bash: bundle: command not foundcap staging deploy:bash:bundle:找不到命令
【发布时间】:2016-10-05 11:28:40
【问题描述】:

我正在使用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).

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

.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`

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

【问题讨论】:

    标签: ruby-on-rails capistrano rbenv


    【解决方案1】:

    你应该使用 capistrano/rbenv。 Capistrano 不通过 ssh 启动交互式 shell。所以你的.bash_profile 不会被加载。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-29
      相关资源
      最近更新 更多