Jenkins ジョブで (Rake プラグインを介して) いくつかの Rake ステップを使用していますが、Rake が見つからないと主張しています。
+ bundle update
.................................
Using rake (0.9.2.2)
.................................
[workspace] $ rake db:drop
FATAL: rake execution failed
java.io.IOException: Cannot run program "rake" (in directory "/var/lib/jenkins/jobs/myproject/workspace"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
at hudson.Launcher$ProcStarter.start(Launcher.java:338)
at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at hudson.plugins.rake.Rake.perform(Rake.java:141)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1502)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 15 more
Build step 'Invoke Rake' marked build as failure
Finished: FAILURE
Jenkins の設定で Ruby パスを手動で指定すると、次のようになります。
[workspace] $ rake db:drop
[31mERROR: Gem rake is not installed, run `gem install rake` first.(B[m
Build step 'Invoke Rake' marked build as failure
Finished: FAILURE
Rake プラグインを使用せずに、プレーンなシェル コマンドとして Jenkins で rake を実行すると、次のようになります。
+ rake db:drop
/var/lib/jenkins/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
「bundle exec rake db:drop」を実行すると、同じことが 2 回発生します。
一時的にジョブに次の 2 行を含めます。
rvm pkg install libyaml
rvm reinstall 1.9.3
助けにならない。(更新: これは単なる警告であり、何の影響もありませんが、かなり面倒です)。
Jenkins の外の ~/.rvm ディレクトリに別の RVM + Ruby バンドルをインストールしましたが、問題なく動作します。