Forum: JRuby Problem requiring rspec within jruby-complete jar

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gary L. (Guest)
on 2009-04-30 22:17
(Received via mailing list)
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:in `require'
        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
Roy T. (Guest)
on 2009-04-30 22:42
(Received via mailing list)
I also would appreciate an answer to this question.

-Roy
Nick S. (Guest)
on 2009-04-30 23:45
(Received via mailing list)
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
Gary L. (Guest)
on 2009-05-01 00:38
(Received via mailing list)
Thanks Nick, it works! :)

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
Nick S. (Guest)
on 2009-05-01 00:50
(Received via mailing list)
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
Charles Oliver N. (Guest)
on 2009-05-01 01:06
(Received via mailing list)
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
This topic is locked and can not be replied to.