作为构建过程的一部分,我在Jenkins内部(在docker容器内)运行rake任务时遇到了一些问题(我安装了Rake插件)。我收到了错误
java.io.IOException: Cannot run program "rake" (in directory "/var/jenkins/workspace/HendricksFeaturesCopy"): error=2, No such file or directory
我不明白,在调用rake任务之前我pwd $ECHO
,我得到了。
/var/jenkins/workspace/HendricksFeaturesCopy
所以我在正确的位置安装了rake
,因为它位于此处
/usr/local/rvm/rubies/ruby-2.3.0/bin/rake
我的Rakefile
看起来像
import 'lib/tasks/yard-docs.rake'
lib/tasks/yard-docs.rake
require 'yard'
namespace :yard_docs do
desc 'Generate Yard Documentation'
task :generate do
# Generate Yard Documentation
end
end
有谁知道如何纠正这个或我缺少的东西?
更新
执行echo $PATH
/usr/local/rvm/gems/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin
所以这意味着正在使用正确的宝石集,当我完成rvm @global do gem list
rake (10.4.2)
那么,rake可用吗?
答案 0 :(得分:1)
确保{$ 1}位于$ PATH。
ClearStackLayout
或者,符号链接/usr/local/rvm/rubies/ruby-2.3.0/bin/
到PATH=/usr/local/rvm/rubies/ruby-2.3.0/bin/:$PATH
/usr/local/rvm/rubies/ruby-2.3.0/bin/rake