failed to install a gem completely with JRuby interpreter

View: New views
6 Messages — Rating Filter:   Alert me  

failed to install a gem completely with JRuby interpreter

by Piergiuliano Bossi-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

I've tried to install 'renum' gem in the gem system managed by JRuby intepreter. While the install per se is fine, if I try require it, it doesn't work. For example, in irb:
irb(main):004:0> require 'renum'
LoadError: no such file to load -- renum
    from (irb):4:in `binding'
    from C:/Program Files/NetBeans 6.1 Beta/ruby2/jruby-1.1RC1/lib/ruby/1.8/irb.rb:150:in `eval_input'
[...]
    from <script>:1:in `catch'
    from C:/Program Files/NetBeans 6.1 Beta/ruby2/jruby-1.1RC1/lib/ruby/1.8/irb.rb:69:in `start'
    from <script>:1

Outside of Netbeans I've been successful to install and use renum, with one trick: after installing the gem I had to run "ruby setup.rb" in the gem directory (for example, under cygwin it's /lib/ruby/gems/1.8/gems/renum-1.0.1) ==> after this I can use the gem itself and requiring it in irb works fine (of course, not in Netbeans for what we have discussed already some weeks ago here).

I've tried running setup.rb with the jruby batch bundled with Netbeans, but I had no success:
C:\Program Files\NetBeans 6.1 Beta\ruby2\jruby-1.1RC1\lib\ruby\gems\1.8\gems\renum-1.0.1>"C:\Program Files\NetBeans 6.1
Beta\ruby2\jruby-1.1RC1\bin\jruby.bat" setup.rb
setup.rb:189:in `standard_entries': private method `sub' called for nil:NilClass (NoMethodError)
        from setup.rb:188:in `call'
        from setup.rb:228:in `standard_entries'
        from setup.rb:199:in `load_standard_entries'
        from setup.rb:769:in `invoke'
        from setup.rb:1578

Any suggestion?

Thanks,
Giuliano

Re: failed to install a gem completely with JRuby interpreter

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Giuliano,

I see that you're using JRuby 1.1 RC1, you might want to upgrade to
1.1.2 which is the latest JRuby release. Unfortunately that doesn't
solve this issue, you just get a different stack trace (I tried this
with 1.1.2). I'm afraid I don't have an idea what is the problem, if
nobody else here knows either, I'd suggest asking on the
user@... mailing list and/or filing an issue against
JRuby in their issue tracker at http://jira.codehaus.org/browse/JRUBY.

Thanks,
Erno


Piergiuliano Bossi wrote:

> Hi guys,
>
> I've tried to install 'renum' gem in the gem system managed by JRuby
> intepreter. While the install per se is fine, if I try require it, it
> doesn't work. For example, in irb:
> irb(main):004:0> require 'renum'
> LoadError: no such file to load -- renum
>     from (irb):4:in `binding'
>     from C:/Program Files/NetBeans 6.1
> Beta/ruby2/jruby-1.1RC1/lib/ruby/1.8/irb.rb:150:in `eval_input'
> [...]
>     from <script>:1:in `catch'
>     from C:/Program Files/NetBeans 6.1
> Beta/ruby2/jruby-1.1RC1/lib/ruby/1.8/irb.rb:69:in `start'
>     from <script>:1
>
> Outside of Netbeans I've been successful to install and use renum,
> with one trick: after installing the gem I had to run "ruby setup.rb"
> in the gem directory (for example, under cygwin it's
> /lib/ruby/gems/1.8/gems/renum-1.0.1) ==> after this I can use the gem
> itself and requiring it in irb works fine (of course, not in Netbeans
> for what we have discussed already some weeks ago here).
>
> I've tried running setup.rb with the jruby batch bundled with
> Netbeans, but I had no success:
> C:\Program Files\NetBeans 6.1
> Beta\ruby2\jruby-1.1RC1\lib\ruby\gems\1.8\gems\renum-1.0.1>"C:\Program
> Files\NetBeans 6.1
> Beta\ruby2\jruby-1.1RC1\bin\jruby.bat" setup.rb
> setup.rb:189:in `standard_entries': private method `sub' called for
> nil:NilClass (NoMethodError)
>         from setup.rb:188:in `call'
>         from setup.rb:228:in `standard_entries'
>         from setup.rb:199:in `load_standard_entries'
>         from setup.rb:769:in `invoke'
>         from setup.rb:1578
>
> Any suggestion?
>
> Thanks,
> Giuliano


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: failed to install a gem completely with JRuby interpreter

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Erno Mononen wrote:
> Hi Giuliano,
>
> I see that you're using JRuby 1.1 RC1, you might want to upgrade to
> 1.1.2 which is the latest JRuby release. Unfortunately that doesn't
> solve this issue, you just get a different stack trace (I tried this
> with 1.1.2). I'm afraid I don't have an idea what is the problem, if
> nobody else here knows either, I'd suggest asking on the
> user@... mailing list and/or filing an issue against
> JRuby in their issue tracker at http://jira.codehaus.org/browse/JRUBY.

Hmmm, for me it works. Tried with latest NetBeans build, bundle JRuby
(1.1.2). Running:

=============
   require 'rubygems'
   require 'renum'

   puts 'Hello World"
=============

works. Also from IRB (run from within NetBeans) it works.

So let us know whether it works for you with latest NetBeans and bundled
JRuby.

Regards,
        m.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: failed to install a gem completely with JRuby interpreter

by Piergiuliano Bossi-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 16, 2008 at 5:54 AM, Martin Krauskopf <Martin.Krauskopf@...> wrote:
Hmmm, for me it works. Tried with latest NetBeans build, bundle JRuby (1.1.2). Running:

Thanks, that's very helpful and it left me a bit confused, but it's very helpful.

First of all: it works here too, provided that I require 'rubygems' first.
This comes a bit unexpected, because:
*) in cygwin, for whatever reason, gems work even without requiring 'rubygems' (and I don't have RUBY_OPT set either)
*) in Netbeans I have configured -rubygems in the project properties, but for some reasons irb seems to ignore it ==> I suppose this may be due to the fact that irb is used across different projects, potentially

Bottom line:
*) I can use renum in my project files without problems now
*) I can use renum in irb too, provided that I require 'rubygems' first

Thanks a lot for your help guys,
Giuliano

Re: failed to install a gem completely with JRuby interpreter

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Piergiuliano Bossi wrote:
> On Mon, Jun 16, 2008 at 5:54 AM, Martin Krauskopf
> <Martin.Krauskopf@... <mailto:Martin.Krauskopf@...>> wrote:
>
>     Hmmm, for me it works. Tried with latest NetBeans build, bundle
>     JRuby (1.1.2). Running:
>
>
> Thanks, that's very helpful and it left me a bit confused, but it's very
> helpful.

It is very confusing, since it is not clear which Ruby interpreter/VM is
used and under waht environment it is run. The action should be moved
into project's properties like it is for Rails console. I've filed:

http://www.netbeans.org/issues/show_bug.cgi?id=137398

> First of all: it works here too, provided that I require 'rubygems' first.
> This comes a bit unexpected, because:
> *) in cygwin, for whatever reason, gems work even without requiring
> 'rubygems' (and I don't have RUBY_OPT set either)
> *) in Netbeans I have configured -rubygems in the project properties,
> but for some reasons irb seems to ignore it ==> I suppose this may be
> due to the fact that irb is used across different projects, potentially

This should work (works for me). Did you put '-rubygems' (without
quotes) into Ruby Options field in project's properties? If yes be sure
that you are running the right interpreter. Best to select the project
node in the explorer and than invoke Windows -> Others -> Ruby Shell
(IRB). You can see in the output tab what interpreter is run (in
NetBeans dev builds).
This all is little odd, see filed issue above.

Another way is to put:

   require 'rubygems'

into $HOME/.irbrc

        m.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: failed to install a gem completely with JRuby interpreter

by Chris Kutler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I turned this into a FAQ:  
http://wiki.netbeans.org/RubyFAQ#section-RubyFAQ-IRB

Martin Krauskopf wrote:

> Piergiuliano Bossi wrote:
>> On Mon, Jun 16, 2008 at 5:54 AM, Martin Krauskopf
>> <Martin.Krauskopf@... <mailto:Martin.Krauskopf@...>> wrote:
>>
>>     Hmmm, for me it works. Tried with latest NetBeans build, bundle
>>     JRuby (1.1.2). Running:
>>
>>
>> Thanks, that's very helpful and it left me a bit confused, but it's
>> very helpful.
>
> It is very confusing, since it is not clear which Ruby interpreter/VM
> is used and under waht environment it is run. The action should be
> moved into project's properties like it is for Rails console. I've filed:
>
> http://www.netbeans.org/issues/show_bug.cgi?id=137398
>
>> First of all: it works here too, provided that I require 'rubygems'
>> first.
>> This comes a bit unexpected, because:
>> *) in cygwin, for whatever reason, gems work even without requiring
>> 'rubygems' (and I don't have RUBY_OPT set either)
>> *) in Netbeans I have configured -rubygems in the project properties,
>> but for some reasons irb seems to ignore it ==> I suppose this may be
>> due to the fact that irb is used across different projects, potentially
>
> This should work (works for me). Did you put '-rubygems' (without
> quotes) into Ruby Options field in project's properties? If yes be
> sure that you are running the right interpreter. Best to select the
> project node in the explorer and than invoke Windows -> Others -> Ruby
> Shell (IRB). You can see in the output tab what interpreter is run (in
> NetBeans dev builds).
> This all is little odd, see filed issue above.
>
> Another way is to put:
>
>   require 'rubygems'
>
> into $HOME/.irbrc
>
>     m.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...