Using the Rake plugin with Jenkins got me into a bit of trouble this morning. Seems it got broken somewhere along the way issuing the following error:
/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:319:in `to_specs': Could not find 'rake' (>= 0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=file:/usr/share/tomcat6/webapps/jenkins/plugins/ruby-runtime/WEB-INF/lib/stapler-jruby-1.209.jar!/gem:/usr/lib64/ruby/gems/1.8', execute `gem env` for more information
from /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:328:in `to_spec'
from /usr/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_gem.rb:65:in `gem'
After running the rake invocation from the command line I deduced that the issue was all about the GEM_PATH variable which I then set globally in the Jenkins settings.
Not complaining, just posting this so I might be able to save others some time troubleshooting.