LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   RMagick shared libraries problem (ruby on rails setup) (https://www.linuxquestions.org/questions/linux-server-73/rmagick-shared-libraries-problem-ruby-on-rails-setup-642419/)

Roosta21 05-15-2008 11:39 AM

RMagick shared libraries problem (ruby on rails setup)
 
I am attempting to get ruby on rails to working on my server. When i attempted to start the rails application through cpanel i get a following error

Code:

following error** Daemonized, any open files are closed.  Look at log/mongrel.pid and log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:12001
** Starting Rails with production environment...
/usr/lib/ruby/gems/1.8/gems/rmagick-2.2.2/lib/RMagick2.so: libMagickCore.so.1: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/1.8/gems/rmagick-2.2.2/lib/RMagick2.so (LoadError)
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
        from /usr/lib/ruby/gems/1.8/gems/rmagick-2.2.2/lib/RMagick.rb:11
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
        ... 24 levels...
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/command.rb:212:in `run'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
        from /usr/bin/mongrel_rails:16:in `load'
        from /usr/bin/mongrel_rails:16

but all the files shared files seem to be setup properly i think

Code:

lrwxrwxrwx  1 root root    33 May 15 16:29 MagickCore.so.1 -> /usr/local/lib/libMagickCore.so.1
-rw-r--r--  1 root root  58315 May 15 11:21 RMagick.rb
-rwxr-xr-x  1 root root 342899 May 15 11:21 RMagick2.so
lrwxrwxrwx  1 root root    31 May 15 17:01 libMagickCore.so -> /usr/local/lib/libMagickCore.so
lrwxrwxrwx  1 root root    33 May 15 16:39 libMagickCore.so.1 -> /usr/local/lib/libMagickCore.so.1
lrwxrwxrwx  1 root root    31 May 15 17:00 libMagickWand.so -> /usr/local/lib/libMagickWand.so
lrwxrwxrwx  1 root root    33 May 15 16:59 libMagickWand.so.1 -> /usr/local/lib/libMagickWand.so.1
drwxr-xr-x  2 root root  4096 May 15 11:21 rvg

Can anyone suggest a course of action?

Roosta21 05-20-2008 04:37 AM

bump
 
Can anyone advise?

lukerandall 05-23-2008 04:16 AM

I came across your question while looking for a solution to the same problem =) So far I've found the following advice:

before you compile ImageMagick set following Enviroment Variable:
LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"

With this option ImageMagick looks at /usr/local/lib for the libraries.

(see http://studio.imagemagick.org/piperm...ry/020785.html)

Hope that helps because I registered just so I could give you an answer =) But yeah, I just finished recompiling ImageMagick and it seems to have done the trick for me.

Be sure to gem install rmagick after re-installing ImageMagick so that it links to the new libraries

goldenbough 08-17-2008 02:41 PM

How/where do you change this environment variable?

The installation instruction file says:

If you are willing to accept configure's default options, and build from
within the source directory, type:

./configure

and watch the configure script output to verify that it finds everything
that you think it should. If it does not, then adjust your environment
so that it does.

By default,

make install

will install the package's files in `/usr/local/bin', `/usr/local/lib', etc..
You can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PATH'. This is valuable in case you don't
have privileges to install under the default paths or if you want to install
in the system directories instead.

So I assume you would type in ./configure (path), but I don't understand exactly how to format this. If I want to put in in usr/local/lib, what would I type?



Also I want to start over. The instruction file states:

* Remove everything in the build directory created by 'configure' and 'make'.
This is useful if you want to start over from scratch.

make distclean

I ran:
cd ImageMagick-6.4.2
make distclean

and get the error:
make: *** No rule to make target `distclean'. Stop.

lukerandall 08-18-2008 05:57 AM

Hi goldenbough

You can type

Code:

export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
at your promt to set the LDFLAGS. Remember that this will only be set for that session, so as soon as you log out the setting will be lost. Likewise, if you open a new tab or so forth it will not have this setting.

To install to /usr/local you'd type

Code:

./configure --prefix=/usr/local
You more than likely WOULDN'T want to install it to /usr/local/lib (I'm guessing you just used that as an example, but just want to make sure you realise that).

I'm not sure why make distclean didn't work for you. Perhaps you haven't run make yet (so there is nothing to clean up). Just a guess though. However - and I'm subject to correction here - I don't believe it is necessary for you to run it, as when you run ./configure and make, they will simply overwrite your old files, meaning that it's really irrelevant whether you run make distclean before or not.

Hope that helps


All times are GMT -5. The time now is 06:45 AM.