Google Groups Home
Help | Sign in
MySQL gem 2.7 not finding mysql.so
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
ebdb  
View profile
 More options 4 Dec 2008, 19:26
From: ebdb <moct...@gmail.com>
Date: Thu, 4 Dec 2008 11:26:32 -0800 (PST)
Local: Thurs 4 Dec 2008 19:26
Subject: MySQL gem 2.7 not finding mysql.so
ruby 1.8.7
Rails 2.2.2
mysql gem 2.7
Linux 2.6.18-92.el5

Hey guys. The MySQL gem is puzzling me. When I run irb> require
'mysql' I get the error shown below:

   1. irb(main):001:0> require 'rubygems'
   2. => true
   3. irb(main):002:0> require 'mysql'
   4. LoadError: libmysqlclient.so.16: cannot open shared object file:
No such file or directory - /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.7/lib/mysql.so
   5.         from /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/
mysql.so
   6.         from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:36:in `require'
   7.         from (irb):2

It says "no such file or directory" when in fact that file, mysql.so,
absolutely does exist in that exact location.

After some Googling I found that I could use ldconfig to configure
mysql.so to be available to the whole system. Once I added "/usr/local/
mysql/lib" to /etc/ld.so.conf and ran ldconfig, it worked fine:

   1. irb(main):002:0> require 'rubygems'
   2. => true
   3. irb(main):003:0> require 'mysql'
   4. => true

OK, so I got it to work. But my question is, why was I getting that
error previously? I never had to use ldconfig before to get the mysql
gem to work. Has anyone else encountered the same error? Is there a
better solution?

This is how I installed the mysql gem:

   1. gem install mysql --no-rdoc --no-ri \
   2.   -- --with-mysql-include=/usr/local/mysql/include \
   3.   --with-mysql-lib=/usr/local/mysql/lib \
   4.   --with-mysql-config=/usr/local/mysql/bin/mysql_config

Any insight would be greatly appreciated.

Thanks,

E


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frederick Cheung  
View profile
 More options 4 Dec 2008, 19:44
From: Frederick Cheung <frederick.che...@gmail.com>
Date: Thu, 4 Dec 2008 19:44:47 +0000
Local: Thurs 4 Dec 2008 19:44
Subject: Re: [Rails] MySQL gem 2.7 not finding mysql.so

On 4 Dec 2008, at 19:26, ebdb <moct...@gmail.com> wrote:

It's not telling you that mysql.so was not found. It's saying that  
while loading that it tried to load libmysqlclient but failed to find  
that (because ldconfig hadn't been told to look in the right place)
> After some Googling I found that I could use ldconfig to configure
> mysql.so to be available to the whole system. Once I added "/usr/
> local/
> mysql/lib" to /etc/ld.so.conf and ran ldconfig, it worked fine:

>   1. irb(main):002:0> require 'rubygems'
>   2. => true
>   3. irb(main):003:0> require 'mysql'
>   4. => true

> OK, so I got it to work. But my question is, why was I getting that
> error previously? I never had to use ldconfig before to get the mysql
> gem to work. Has anyone else encountered the same error? Is there a
> better solution?

You wouldn't need to do this if the mysql libraries were installed in  
somewhere like /usr/lib or /usr/local/lib which was already on the  
search path

Fred


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google