[rspec-users] RSpec tasks, JRuby and rvm
dchelimsky at gmail.com
Thu May 6 22:47:44 EDT 2010
On May 6, 2010, at 6:42 PM, Rodrigo Rosenfeld Rosas wrote:
> I've been playing with rvm these days and I had a bad surprise today.
> $ rvm install jruby
> $ rvm jruby
> $ rake test
> Of course you didn't understand. I didn't explain yet...
> I've written a Rakefile following RSpec homepage instructions and adding some options to ruby (namely "--ng", for working with nailgun support). But the error seems to be related to gems access. If I run the RSpec command from a terminal where I executed "rvm jruby", it works. In another terminal it won't work.
> I'm testing a Java Maven project with JRuby and RSpec. It was working prior to rvm use. But calling the "ruby" executable using the full path, as RSpec tasks does, doesn't seem to suffice. "rvm jruby" probably sets up a proper environment that is not reproduced by RSpec when calling the configured ruby interpreter.
> Of course I could contact the RVM developers about this, but I would like to understand first why RSpec needs to spawn a separate process in its task... Does anyone here knows the reason?
This has been an open issue for a long time. We wrote the task that way originally because there are some cases in which we need to spawn a separate process (if you want to run rcov, for example). What we'd like to do is have it shell out in those cases, but otherwise just invoke the rspec runner directly. Just haven't prioritized it. If anybody wants to make a patch for this, I'd be glad to merge it (assuming it's sound and spec'd). We need this for rspec 1 and rspec 2.
More information about the rspec-users