2016-10-05 59 views
1

我正在CentOS 7上運行我的Rails 5項目,內容爲rbenv。當我運行cap staging deploy我得到了錯誤:cap staging deploy:bash:bundle:找不到命令

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

我可以沒有任何問題,在deploy目錄/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 -)" 

紅寶石,寶石,捆綁版本:

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

我試圖

gem uninstall bundler 
gem install bundler` 

不起作用。 有什麼幫助嗎?非常感謝你!

回答

0

您應該使用capistrano/rbenv。 Capistrano不通過ssh啓動交互式shell。所以你的.bash_profile將不會被加載。