by Dinel
One of the great features of the new NetBeans 6.0 is the possibility of developing Ruby code with it. Unfortunately if you run Linux you will find out that you cannot directly use the RubyGems you have installed with your distribution unless you set some very generous file permissions or run NetBeans as root. None of these solutions is appealing. A much better solution is to install your own version of RubyGems. The NetBeans wiki explains how this can be achieved, but unfortunately it does not work in my case (for me this was true for both Ubuntu 7.10 and the alpha versions of Ubuntu 8.04). I suspect that this is due to some changes in the way RubyGems have to be installed. The rest of this tutorial explains the steps which need to be taken in order to install RubyGems on my computer and use them in NetBeans 6.0.
In order to solve this problem you first need to create your own copy of RubyGems and then tell NetBeans to use it.
GEM_HOME=/home/dinel/.localrubygems/ \
ruby setup.rb all --installdirs=home \
--prefix=/home/dinel/.localrubygems/ \
--libdir=/home/dinel/.localrubygems/lib/
the --installdirs=home indicates that the installation is done in the user's directory and the --prefix and --libdir indicated where the files which go in the lib dir are stored
That's it. The installation is now complete.
In order to use NetBeans with Ruby you need to set the GEM_HOME and GEM_PATH environment variable and start NetBeans:
export GEM_HOME=/home/dinel/.localrubygems/ export GEM_PATH=$GEM_PATH:/home/dinel/.localrubygems/ netbeans
In order to make your life easier, you can put all these in a script.
If everything went fine you should be able to go to Tools/RubyGems and see:
![]() |
Select the New Gems tab, click Reload Gems button and you will see all the Gems available for installation:
![]() |
This is tutorial was first published in Dinel's blog.
| ruby-gems-nb1.jpg | ![]() |
29907 bytes |
| ruby-gems-nb2.jpg | ![]() |
46326 bytes |