Gavin Morrice wrote:
> Actually - scrap that
> 
> I just tried adding ENV['LD_LIBRARY_PATH']="/usr/local/lib:#{ENV
> ['LD_LIBRARY_PATH']}"
> to the environment.rb file
> 
> This doesn't seem to work
> 
> I also added puts ENV['LD_LIBRARY_PATH'] to see if it recognised
> LD_LIBRARY_PATH

I think that LD_LIBRARY_PATH is not loaded by the application itself, 
but by it's loader (part of the operating system). Setting this variable 
when the application is already started doesn't work. The loader should 
be instructed to load certain libs which (afaik) can only be done by 
setting the variable before you start the app. This can be done by 
setting it from a .bashrc or .profile (depending on your shell). Note 
that these scripts are only used when starting a login shell. A better 
way would be to create a shell script that loads the libs first and then 
starts your server.

> Any ideas on how I can access this from the environment.rb file?
> 
> Also, could you please explain why adding the path to .bash_profile is
> not best practice?  This seems to do the trick, at least through the
> console.

If it works, it works :) But if you deploy it under a different user, it 
breaks. E.g. if you deploy it with phusion passenger and apache, the 
user that runs apache should have the path set. You could set this 
globally in /etc/ld.so.conf.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to