Problem requiring rspec within jruby-complete jar


#1

Hi,

I am trying to use rspec that is included in the jruby-complete jar. I
have a test.rb created that has the following two lines:

require ‘rubygems’
require ‘spec’

Then when I run “java -jar jruby-complete-1.1.6.jar”, I got the
following error message:

file:/C:/package/lib/jruby/jruby-complete-1.1.6.jar!/META-INF/jruby.home/lib/rub
y/site_ruby/1.8/rubygems/custom_require.rb:31:in require': no such file to load -- spec (LoadError) from file:/C:/package/lib/jruby/jruby-complete-1.1.6.jar!/META-INF/jruby .home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from test.rb:3

Any idea how do I fix this?

Thanks,

–Gary


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

I also would appreciate an answer to this question.

-Roy


#3

On Thu, Apr 30, 2009 at 1:16 PM, Gary L. removed_email_address@domain.invalid wrote:

Hi,

I am trying to use rspec that is included in the jruby-complete jar. I have
a test.rb created that has the following two lines:

require ‘rubygems’

gem ‘rspec’

require ‘spec’

After adding the line above, it works for me.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#4

Thanks Nick, it works! :slight_smile:

So what does the “gem ‘rspec’” do? Do I need to add this line every
time I want to include a gem package?

Thanks,

–Gary

Nick S. wrote:

gem ‘rspec’
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#5

It “activates” the gem, which adds the appropriate entries to the load
path.

There are some cases where you don’t need it (and I’m not sure what
they still are to be honest), but it generally doesn’t hurt to just
use it all the time and be explicit about which gems you activate.

/Nick

On Thu, Apr 30, 2009 at 3:37 PM, Gary L. removed_email_address@domain.invalid wrote:

Nick S. wrote:

require ‘rubygems’


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#6

I’m curious whether we could make rubygems work correctly from within
the jar too. I assume this is a failure of the gemspec logic to
appropriately index/load the gem lib/ dirs when rubygems starts up from
within a jar, yes?

Nick S. wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email