Forum: Ruby gem install mysql error

9bf401eea2766b0e6d65516c1601d71f?d=identicon&s=25 unknown (Guest)
on 2005-12-20 12:24
(Received via mailing list)
gem install mysql

generates this errors:

ruby extconf.rb install mysql
checking for mysql_query() in mysqlclient.lib... no
hecking for main() in m.lib... yes
checking for mysql_query() in mysqlclient.lib... no
checking for main() in z.lib... no
checking for mysql_query() in mysqlclient.lib... no
checking for main() in socket.lib... no
checking for mysql_query() in mysqlclient.lib... no
checking for main() in nsl.lib... no
checking for mysql_query() in mysqlclient.lib... no

Both in Linux and in Windows.

Any idea?

Thanks in advance. JC
9c7f2f44463d1d4890f73e8a8229dd29?d=identicon&s=25 Caleb Tennis (Guest)
on 2005-12-20 12:33
(Received via mailing list)
Do you have the mysql client libraries installed?
9bf401eea2766b0e6d65516c1601d71f?d=identicon&s=25 unknown (Guest)
on 2005-12-20 13:39
(Received via mailing list)
Caleb Tennis wrote:
> Do you have the mysql client libraries installed?

I have mysql server installed. Where do I get the "client" libraries?
Do I need to gem install mysql to use Rails?

Thanks.
A77873df3a9766b208e009248a2a9a56?d=identicon&s=25 Hampton (Guest)
on 2005-12-20 15:15
(Received via mailing list)
Java,

I've had similar problems on Ubuntu. However, luckily Ubuntu provides a
package called rubymysql (or something like that) which does the trick,
and I assume there is a .deb and a .rpm for it.

I installed the client libraries and it still didn't help on my linux
box. A bit frustrating, honestly. But, I finally did get it working.
Its worth it!

-hampton.
E2b3bbf241a5daee3ee7696a7d4b2015?d=identicon&s=25 Vrtwo Lastname (d0t1q)
on 2005-12-20 15:51
(Received via mailing list)
you dont need to install the mysql gem for rails... just configure
databases.yml (i believe is the file)
9bf401eea2766b0e6d65516c1601d71f?d=identicon&s=25 unknown (Guest)
on 2005-12-20 16:09
(Received via mailing list)
Thank you guys. I will try once I get home and let you know.
37caa98f7582db122790a995615fa2af?d=identicon&s=25 Marcin Biegun (nagl)
on 2011-01-24 19:03
Try this (Debian, Ubuntu):

# aptitude install libmysqlclient16-dev
11d12bccc5dcdd28695729d67c5d42c3?d=identicon&s=25 Aleksi K. (aleksi_k)
on 2011-06-16 08:51
I was struggling whole day with this problem and before this I got error
about development tools not being installed despite I just installed
latest Xcode. I'm using Mac OS X 10.6.7 and didn't found any similar
commands like apt-get on linux to solve this problem.

Anyway I solved the problem by using 'ruby-mysql' gem instead of 'mysql'
gem and it works great! Just remember to add socket (default is
/tmp/mysql.sock) and valid authentication information to database.yml
(example socket: /path/to/socket/mysql.sock).

And by the way, I tried to use rails and passenger with MAMP and it was
really pain in the ass and won't recommend it. Instead use separate
Apache and Mysql and you should be ballin'. I used mysql version 14.14
for osx10.6(i386), ruby version 1.92 and rails 3.0.7.
21193b51c526585b40e31ef4d71c3a7a?d=identicon&s=25 Michael Enslow (menslow)
on 2011-10-04 07:59
Aleksi K. wrote in post #1005603:
> I solved the problem by using 'ruby-mysql' gem instead of 'mysql'

Thanks Aleksi. This solved my problem. (I'm using Mac 10.6.8)

Regarding MAMP...

> And by the way, I tried to use rails and passenger with MAMP and it was
> really pain in the ass and won't recommend it.

... I decided to try to get things to work with MAMP and I was able to
get is up and running. Here's how. I installed the ruby-mysql gem with
the following configuration. (NO LINE BREAKS)

sudo gem install ruby-mysql --
--with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
--with-mysql-dir=/Applications/MAMP/db/mysql
--with-mysql-lib=/Applications/MAMP/Library/bin/
--with-mysql-include=/Applications/MAMP/Library/bin/

This should install correctly, but your app will then give you a error
reading:

No such file or directory - /tmp/mysql.sock

Correct this error by specifying the socket in your database.yml file:

production:
  adapter: mysql
  encoding: utf8
  ...
  socket: /Applications/MAMP/tmp/mysql/mysql.sock

Restart the app:
$: touch tmp/restart.txt

And that worked for me.
9efc1191226b6eafb0d6893c07d70767?d=identicon&s=25 Weston Platter (think602)
on 2012-01-06 18:48
Marcin Biegun wrote in post #977203:
> Try this (Debian, Ubuntu):
>
> # aptitude install libmysqlclient16-dev

This worked for me.
- Ubuntu 10.04
- Ruby 1.9.2
- Rails 2.3.14
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.