1
我想從jenkins shell運行一個ruby文件。 我寫詹金斯殼 -如何解決LoadError:無法在jenkins中加載此類文件錯誤
cd /home/user/Desktop/Rubyfolder
ruby test.rb
但是當我運行的版本則返回錯誤以下命令:
+ cd /home/user/Desktop/Rubyfolder
+ ruby test.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rest_client (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/user/Desktop/RubyScript/api_url.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from test.rb:1:in `<main>'
Build step 'Execute shell' marked build as failure
Finished: FAILURE
,當我從我的系統控制檯運行它它返回成功。
請幫忙。提前致謝。
您使用的是RVM還是Bundler? –
是的......我正在使用rvm @Kristján – Ankur