Proctable library bad install

Hi,

I have installed sys-proctable gem on linux but when I run a
script I still get “no such file to load – sys/proctable”

I have checked that the lib is really there and it is.
Is there something else I can check or configure ?

Thanks in advance
Roman

2011/1/7 Roman M. [email protected]:

Hi,

I have installed sys-proctable gem on linux but when I run a
script I still get “no such file to load – sys/proctable”

I have checked that the lib is really there and it is.
Is there something else I can check or configure ?

Hi,

is rubygems loaded before your require(“sys/proctable”) ? If not, then
add RUBYOPT=“-rubygems” to your environment variables.

zimbatm … wrote in post #973161:

2011/1/7 Roman M. [email protected]:

Hi,

I have installed sys-proctable gem on linux but when I run a
script I still get “no such file to load – sys/proctable”

I have checked that the lib is really there and it is.
Is there something else I can check or configure ?

Hi,

is rubygems loaded before your require(“sys/proctable”) ? If not, then
add RUBYOPT=“-rubygems” to your environment variables.

Thanks for the reply , can you elaborate a bit where to add that
variable ?

2011/1/7 Roman M. [email protected]:

Thanks for the reply , can you elaborate a bit where to add that
variable ?

Before, try the following in your console:

irb
require 'rubygems'
#=>false
exit

If the result of the require it false, then rubygems was already
loaded and it is another problem. Otherwise, follow this:


The environment variables are a unix feature, it is a table of
key/values available to your program. In your shell, try typing:

env

This prints the list of defined environment variables.

echo $RUBYOPT

This prints the content of the RUBYOPT variable. If it is not set, it
returns a blank line.

export RUBYOPT=“-rubygems”

This sets the RUBYOPT to the current shell. Try the previous line,
your should get a result.
If you close your shell, the variable will be lost.

Now try running your script, and see if it works.

If you want that same variable available to all your shells, then it
needs to be setup at login. This can be done by adding the previous
line to one of those files : ~/.profile ~/.bash_profile or ~/.bashrc .
You will have to logout and re-login for the changes to take effect.
Then verify again by printing the variable.

Note that these changes only apply to your current user. If you want
to make that variable accessible to the whole system, this depends on
the version of linux that you are using. For example on ubuntu, create
a file in /etc/profile.d/rubygems.sh and add the export line.

Hope this helps,
zimbatm

[root@ip-10-112-63-225 script]# irb
irb(main):001:0> require ‘rubygems’
=> true

Anything else that I can check? by the way on windows it works out of
the box so it is kind of Linux env problem.

Found it , I should include rubygems in the file also, on linux on
window it is working without it.

On 01/07/2011 02:28 PM, Roman M. wrote:

Found it , I should include rubygems in the file also, on linux on
window it is working without it.

You may be running different versions of Ruby on Windows and Linux.
Ruby 1.9 includes rubygems by default so you don’t need to go out of
your way to require it in your scripts or set RUBYOPT to do it for you.
Ruby 1.8 requires a bit of effort on your part though. :slight_smile:

Given what you’re reporting, you’re probably using Ruby 1.9 on Windows
and Ruby 1.8 on Linux. You can check this by running “ruby -v” on both
systems to see what version is reported.

-Jeremy

That’s right , thanks Jeremy , now I understand what’s going on.

Regards.
Roman