Dealing with "jruby" shell calls for the complete jar file

I am currently trying to package a complete ruby environment for our
QA machines. It should work as follows:

  1. Add bundler gem to jruby-complete jar file and deploy it2. Run
    bundle install --path3. Execute tests with the jruby jar and the
    installed gems(test-unitand cucumber)
    The steps 1 and 2 work reasonably well. Step 4 however is a bit of a
    problem when it comes to cucumber.Cucumber will try to figure out
    weather it’s running in jruby or mri and launch new tests as shell
    scripts by calling either “ruby"or"jruby”. Since the JRuby complete
    jar file doesn’t actually have anything responding to a “jruby” shell
    call, it can’t launch.Are there any “shims” that could be installed or
    is there any way to point the PATH environment variable inside of the
    jar file?
    Cheers,Marc

    Pessimists, we’re told, look at a glass containing 50% air and 50%
    water and see it as half empty. Optimists, in contrast, see it as half
    full. Engineers, of course, understand the glass is twice as big as it
    needs to be. (Bob Lewis)

Hi Marc,

On Oct 30, 2011, at 11:38 AM, Marc S. wrote:

call, it can’t launch.Are there any “shims” that could be installed or
is there any way to point the PATH environment variable inside of the
jar file?

I believe the behavior you’re talking about is part of the cucumber rake
task, rather than cucumber per se. If so, I can suggest a couple of
things that might work:

  • Set fork=false in the rake task. This will run the features within the
    rake process instead of starting a subshell.
  • Write your own rake task that invokes the cucumber executable directly
    in a way that works with your setup.

Rhett

Sadly that was not the case :frowning:

The Rakefile:

require 'rubygems'
require 'bundle/setup'
require 'cucumber'
require 'cucumber/rake/task'

Cucumber::Rake::Task.new(:features) do |t|
  t.fork = false
end

And the result:

$ java -jar jruby-complete-1.6.5.jar -rjruby_bundled_gems.jar -S
bundle exec rake features
env: jruby: No such file or directory

On Sun, Oct 30, 2011 at 10:49 PM, Rhett S.
[email protected] wrote:

problem when it comes to cucumber.Cucumber will try to figure out

  • Write your own rake task that invokes the cucumber executable directly in a
    way that works with your setup.

http://xircles.codehaus.org/manage_email


Pessimists, we’re told, look at a glass containing 50% air and 50%
water and see it as half empty. Optimists, in contrast, see it as half
full. Engineers, of course, understand the glass is twice as big as it
needs to be. (Bob Lewis)

Cucumber::Rake::Task.new(:features) do |t|
external subprocesses. Instead of using “bundle exec” can you put
“require ‘bundler/setup’” in your rake file?

/Nick

The problem is that we might have an older version of rake installed
in $path somewhere. That way we’d launch the rake file with the old
rake and then require the new one which usually ends up in an error.

On Wed, Nov 9, 2011 at 6:06 AM, Marc S. [email protected] wrote:

t.fork = false
end

And the result:

$ java -jar jruby-complete-1.6.5.jar -rjruby_bundled_gems.jar -S
bundle exec rake features
env: jruby: No such file or directory

Ah, the problem is most likely “bundle exec”, which tends to execute
external subprocesses. Instead of using “bundle exec” can you put
“require ‘bundler/setup’” in your rake file?

/Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs