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