我在第一次在rails項目中設置Capistrano。當我運行「帽子生產部署:檢查」它確定。但是當我運行「cap prodution deploy」時,它會給出以下錯誤...Ruby on Rails,通過Capistrano部署設置錯誤
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory
SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory
我正在使用rails 4.2.3。 Ruby 2.2.2(帶有RVM)。我增加了對Capistrano的Gemfile中下面的寶石......
gem 'capistrano', '~> 3.4.0'
gem 'capistrano-rvm', '~> 0.1.2'
gem 'capistrano-bundler', '~> 1.1.4'
gem 'capistrano-rails', '~> 1.1.3'
gem 'capistrano3-unicorn', '~> 0.2.1'
如果您使用的是rvm,您將不得不在capistrano文件中爲您正在使用的ruby版本設置rvm字符串。像'set:rvm_ruby_string','ree @ rails3'' –
'你是什麼意思「爲ruby版本設置rvm字符串」?我是這樣做的嗎? – polarcare
在'config/deploy.rb'文件中,您應該添加rvm字符串,它基本上是您正在使用的ruby版本和gemset。 –