LD_LIBRARY_PATH and Oracle

75 views
Skip to first unread message

James H.

unread,
Mar 2, 2009, 11:17:57 AM3/2/09
to Deploying Ruby on Rails
Greetings.

I'm scratching my head over a problem with LD_LIBRARY_PATH and the
OCI8 (Oracle) gem this morning. Here's the error I'm getting during a
cold deploy with Capistrano:

== BEGIN ==

* executing "cd /var/apps/sred/current && rake db:create
RAILS_ENV=production && rake db:schema:load
RAILS_ENV=production"
servers: ["10.212.102.104"]
[10.212.102.104] executing command
*** [err :: 10.212.102.104] rake aborted!
*** [err :: 10.212.102.104]
*** [err :: 10.212.102.104] libclntsh.so.10.1: cannot open shared
object file: No such file or directory - /usr/local/lib/site_ruby/1.8/
i486-linux/oci8lib.so
*** [err :: 10.212.102.104]
*** [err :: 10.212.102.104]
*** [err :: 10.212.102.104] (See full trace by running task with --
trace)
*** [err :: 10.212.102.104]
** [out :: 10.212.102.104] (in /var/apps/sred/releases/
20090302161653)
command finished
failed: "sh -c \"cd /var/apps/sred/current && rake db:create
RAILS_ENV=production
&& rake db:schema:load RAILS_ENV=production\"" on
10.212.102.104
== END ==

I'm a little at a loss. I can see that LD_LIBRARY_PATH is set when I
SSH into the user I'm using to deploy, and I can verify that I've
logged in correctly.

This http://ubuntuforums.org/archive/index.php/t-930567.html seemed to
be my problem, but the resolution doesn't work.

Can any one offer some insight?

James H.

unread,
Mar 2, 2009, 11:50:54 AM3/2/09
to Deploying Ruby on Rails
Ah ha! Fixed. Make sure you set LD_LIBRARY_PATH to the correct path
in /etc/environment. It's not really the "Debian way", but it seems to
get the job done.

James H.
> Thishttp://ubuntuforums.org/archive/index.php/t-930567.htmlseemed to

Gavin

unread,
Apr 19, 2009, 5:42:45 PM4/19/09
to Deploying Ruby on Rails
Hey guys!

I'm having a similar problem trying to integrate RMagick with my rails
app.

In the online terminal (on my host's server) if I write:

export "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" before
opening the rails console then I can require "RMagick" no problem.

Without adding usr/local/lib to the LD_LIBRARY_PATH I get the error
message described here:
http://rmagick.rubyforge.org/install-faq.html#loaderror

My question is - where can I edit the LD_LIBRARY_PATH to make this
change permanent - at the moment it only works as long as I'm using
the online terminal window?

Thanks

James H.

unread,
Apr 20, 2009, 12:39:19 PM4/20/09
to Deploying Ruby on Rails
What do you mean by "online terminal window"?

James

Francesco Vollero

unread,
Apr 20, 2009, 8:43:47 PM4/20/09
to rubyonrails...@googlegroups.com
On Mon, Apr 20, 2009 at 6:39 PM, James H. <james....@gmail.com> wrote:
>
> What do you mean by "online terminal window"?
>
Maybe is just a ssh client in java :)

> James
>
> On Apr 19, 5:42 pm, Gavin <ga...@thinkersplayground.com> wrote:
>> Hey guys!

[snip]

>> My question is - where can I edit the LD_LIBRARY_PATH to make this
>> change permanent - at the moment it only works as long as I'm using
>> the online terminal window?

If you really need to add... you have to add: export
"LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" into /etc/profile

But i really dont think is the best choice...

>> Thanks
> >
>
Reply all
Reply to author
Forward
0 new messages