This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99860 - Cannot install gems which try to build the native extension using Gem manager
Summary: Cannot install gems which try to build the native extension using Gem manager
Status: VERIFIED WORKSFORME
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-03 16:53 UTC by Tomas Danek
Modified: 2007-09-14 14:55 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2007-04-03 16:53:19 UTC
NetBeans IDE Dev (Build 200704021800)
1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b04
Linux version 2.6.17-10-generic running on i386
cs_CZ (nb); UTF-8
+ ruby 0.51
----------------------------------------------------------------
no special settings, just downloaded from UC ruby, did not change interpreter, 
just out of the box experience. Probably you have more insight what is wrong?
Gem itself or gem installation?! 
On windows was gem installed successfully (using of course mswin32)

This is output from gem manager:

Select which gem to install for your platform (java)
 1. ruby-debug-base 0.9.1 (mswin32)
 2. ruby-debug-base 0.9.1 (ruby)
 3. Skip this gem
 4. Cancel installation
2
> Building native extensions.  This could take a while...
Error opening script file: extconf.rb (No such file or directory)
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install ruby-debug-base --no-rdoc --no-ri --include-dependencies
--version 0.9.1


Gem files will remain installed in
/tmp/ud/jruby-0.9.8/lib/ruby/gems/1.8/gems/ruby-debug-base-0.9.1 for inspection.
Results logged to
/tmp/ud/jruby-0.9.8/lib/ruby/gems/1.8/gems/ruby-debug-base-0.9.1/ext/gem_make.out
Comment 1 zerohalo 2007-04-03 21:54:57 UTC
I can confirm this behaviour. However, the issue not only affects
ruby-debug-base gem, but any gem that must build native extensions and thus call
extconf.rb. For example, mongrel, sqlite3-ruby, mysql, etc. They all generate
the same error (for me) as described below.

Using NetBeans M8 with ruby-hudson-689, on Linux (Ubuntu Edgy).

This is a show-stopper, at least on my machine, since NetBeans doesn't seem to
have a way to use gems already installed on the system, but must install its own
via the Ruby Gem Manager.
Comment 2 Martin Krauskopf 2007-04-04 07:01:14 UTC
I suppose more people will try to get debugger working this way as Tomas did. So
it is also semi-stopper for the debugger in some cases.
Comment 3 Petr Blaha 2007-04-04 13:02:13 UTC
Since users can't install many required gems it seems as stopper. Why ruby
interpreter is executed? Maybe, we should use embedded jruby instead system
ruby. When we try to run mentioned command with embedded jruby the installation
exits with error:

extconf.rb:2:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:2

according the page
http://rubyforge.org/forum/forum.php?thread_id=4161&forum_id=4050
seems that mkmf is missing in embedded JRuby.
Comment 4 Torbjorn Norbye 2007-04-04 15:24:20 UTC
It looks like you are trying to install this gem for JRuby, which doesn't work. It doesn't work on the 
command line either - this isn't a Gem Manager issue.

It looks like the fast-debug gem requires native Ruby, so you'll have to switch to native ruby first if 
you're going to do this. (The Gem Manager is tied to whichever Ruby installation you are using.)

sh-2.05b$ cd netbeans/work/nbbuild/netbeans/ruby1/jruby-0.9.8/
sh-2.05b$ JRUBY_HOME=`pwd`; export JRUBY_HOME
sh-2.05b$ cd bin
sh-2.05b$ PATH=`pwd`:$PATH; export PATH
sh-2.05b$ cd     
sh-2.05b$ jruby $JRUBY_HOME/bin/gem install ruby-debug-base
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (java)
 1. ruby-debug-base 0.9.1 (mswin32)
 2. ruby-debug-base 0.9.1 (ruby)
 3. ruby-debug-base 0.9 (ruby)
 4. ruby-debug-base 0.9 (mswin32)
 5. ruby-debug-base 0.8.1 (ruby)
 6. ruby-debug-base 0.8.1 (mswin32)
 7. ruby-debug-base 0.8 (ruby)
 8. ruby-debug-base 0.8 (mswin32)
 9. Skip this gem
 10. Cancel installation
> 2
Building native extensions.  This could take a while...
Error opening script file: extconf.rb (No such file or directory)
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install ruby-debug-base


Gem files will remain installed in /Users/tor/netbeans/work/nbbuild/netbeans/ruby1/jruby-0.9.8/lib/
ruby/gems/1.8/gems/ruby-debug-base-0.9.1 for inspection.
Results logged to /Users/tor/netbeans/work/nbbuild/netbeans/ruby1/jruby-0.9.8/lib/ruby/gems/1.8/
gems/ruby-debug-base-0.9.1/ext/gem_make.out


I'm not really sure what ruby-debug-base is supposed to do, or how the debugger is requiring it - 
Martin? Since it has native code it's hard to imagine that it would be used by JRuby.
Comment 5 Torbjorn Norbye 2007-04-04 15:51:48 UTC
I switched my Ruby interpreter to Ruby 1.8.5 (native ruby) and ran the Gem manager - the gem 
installed successfully; here's the output from the progress window.

Select which gem to install for your platform (i686-darwin8.8.1)
 1. ruby-debug-base 0.9.1 (mswin32)
 2. ruby-debug-base 0.9.1 (ruby)
 3. ruby-debug-base 0.9 (ruby)
 4. ruby-debug-base 0.9 (mswin32)
 5. ruby-debug-base 0.8.1 (mswin32)
 6. ruby-debug-base 0.8.1 (ruby)
 7. ruby-debug-base 0.8 (mswin32)
 8. ruby-debug-base 0.8 (ruby)
 9. Cancel installation
2
> Building native extensions.  This could take a while...
ruby extconf.rb install ruby-debug-base --no-rdoc --no-ri --include-dependencies --version > 0

make
gcc -I. -I/Users/tor/dev/ruby/install/ruby-1.8.5/lib/ruby/1.8/i686-darwin8.8.1 -I/Users/tor/dev/
ruby/install/ruby-1.8.5/lib/ruby/1.8/i686-darwin8.8.1 -I.  -fno-common -g -O2 -pipe -fno-common  
-c ruby_debug.c
cc -dynamic -bundle -undefined suppress -flat_namespace  -L"/Users/tor/dev/ruby/install/
ruby-1.8.5/lib" -o ruby_debug.bundle ruby_debug.o  -ldl -lobjc  

make install
/usr/bin/install -c -m 0755 ruby_debug.bundle /Users/tor/dev/ruby/install/ruby-1.8.5/lib/ruby/
gems/1.8/gems/ruby-debug-base-0.9.1/lib

make clean
Successfully installed ruby-debug-base-0.9.1

Comment 6 Martin Krauskopf 2007-04-04 16:03:10 UTC
> I'm not really sure what ruby-debug-base is supposed to do, or how the
> debugger is requiring it - Martin?

It is for debugging CRuby only. The problem could be if the user wants to
install and sets the fast debugger immediately after the IDE boots up. I may
update the wiki to mention the problem being solved here (also there could be
special support for installing the fast debugger - i.e. user would just invoke
some action "Install Fast Debugger"....)

But this issue is not about the ruby-debug-base gem only. Is is just one from
many. IMHO user may not be aware of the fact that JRuby is set. (S)he just
starts up the IDE, reads some tutorial in which some gem with native extension
is required....
It would be the best if it is possible to recognize somehow such gems in advance
and give the user the blocker dialog "You must switch to CRuby..."
Comment 7 Tomas Danek 2007-04-12 12:25:32 UTC
Tor is right, this is gem<->jruby compatibility issue. The new information for
me was that Gem manager reflects interpreter settings - i thought it was
hardcoded only for jruby:)
Therefore the solution is to switch in such a case to a native ruby and install
this gem to a native ruby gem repository, using e.g. gem manager, it works
perfectly, great!
Comment 8 Jiri Kovalsky 2007-07-03 14:03:46 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 9 Jiri Kovalsky 2007-07-03 14:45:22 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.
Comment 10 Tomas Danek 2007-09-14 14:55:38 UTC
as described above, not an issue.