Setting environmental variables
I'm sure this is a major noob question, but I'm not sure how to do it.
Basically, I'm having trouble installing RMagick, and the only solution I can find to the error I'm getting is to set an environmental variable. Now, the solution says to put this in one of my startup files: export LD_LIBRARY_PATH=/usr/local/lib Now, I run that in terminal and it doesn't make a noticeable difference (i.e. doesn't solve my problems). I've tried replacing lib with lib64, and I still get the error when trying to install RMagick, so I'm assuming this line needs to be put in a startup file as it says in the solution I read, or there is a special command in terminal I can run to set the variable. If I need to put it a startup file, err... which one? I don't want to break anything. I'm running Fedora Core 5 (x86_64). |
If you use that line as-is, you simply replace the previous entry with '/usr/local/lib'. IOW, that becomes the only path available to that shell. You need to enter the entire list of paths you want (and in the order you want them searched):
export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib" You can see what the current setting of an environment variable is with 'echo $VARIABLENAME', or see all of them at once with the 'env' command. By "startup files", this usually means /etc/bashrc, which is the basic system config file for bash. You can also put it in ~/.bashrc if you only want the setting to affect a single user. And you don't have to worry about breaking anything, usually. Using the above line in a shell only sets the variable for that session; it doesn't affect the rest of the system. And global settings can easily be fixed by simply reversing the setting. At the very worst, if you find you've broken some necessary program or something, you might have to boot into administrative mode or use a different shell, such as /bin/sh, to fix things. |
Quote:
|
If you set the LD_LIBRARY_PATH in a user's ~/.bashrc, it is a good idea to add to the LD_LIBRARY_PATH, not replace it. i.e.
Code:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" e.g. The system administrator installs a crucial package in /opt/important, and needs /opt/important/lib in the LD_LIBRARY_PATH for that application to run. He modifies the /etc/profile, setting LD_LIBRARY_PATH with this command: Code:
export LD_LIBRARY_PATH="/opt/important/lib" Code:
export LD_LIBRARY_PATH="/usr/local/lib" Code:
export LD_LIBRARY_PATH="/opt/impoprtant/lib:/usr/local/lib" This sort of thinking is not so important if you are the sole user of your machine, but it's a good habit to get into - one day you may have to work in a large multi-user environment, and you should know how not to annoy your system administrators! |
All times are GMT -5. The time now is 10:59 AM. |