proctable library bad install

  • Thread starter Roman Mandeleil
  • Start date
R

Roman Mandeleil

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
 
J

Jonas Pfenniger (zimbatm)

2011/1/7 Roman Mandeleil said:
Hi,

I have installed sys-proctable gem on linux but when I run a
script I still get =C2=A0"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=3D"-rubygems" to your environment variables.
 
R

Roman Mandeleil

zimbatm ... wrote in post #973161:
Hi,

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

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

variable ?

-- =

Posted via http://www.ruby-forum.com/.=
 
J

Jonas Pfenniger (zimbatm)

2011/1/7 Roman Mandeleil said:
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
 
R

Roman Mandeleil

[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.
 
R

Roman Mandeleil

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

Jeremy Bopp

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. :)

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
 
R

Roman Mandeleil

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

Regards.
Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top