MySQL Installation Issues

Kirk Howard wrote:

Whenever you can’t build “native extensions”, it means there is some lib
or lib-dev missing. Generally you’ll need to do a sudo apt-get install
lib-???-dev, or sudo apt-get install build_essential.

This time, I had to install the following:
‘sudo apt-get install libmysqlclient15-dev’

Thanx this worked well tho the ri docs did not install (I think)

Terminal output:

Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1…

No definition for next_result

No definition for field_name

No definition for field_table

etc etc

Does this mean another file is missing and is not having ri docs any big
deal?

On 21 March 2010 00:48, Mike M. [email protected] wrote:

Just starting my first Ruby project… and not so comfortable with this
install of the mysql gem. I expect there’s possibly serious
ramifications of excluding these two processes. Can anybody tell us what
are we missing by resorting to these install parameters; and/or how can
we install with ri and rdoc successfully?

ri and rdoc are just for documentation of the gem. Google them to
find details. Not having them will not affect the operation of the
gem.

Colin

Mike M. wrote:

Abraham Tio wrote:

cd /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7
gem install mysql –
–with-mysql-config=/usr/local/mysql/bin/mysql_config
Greg D.
http://destiney.com/

YUP. this works.

newbie question…

I was able to get an error free install on OSX Leopard 10.6.2 with the
following. The first cds to the mysql gem location of my Leopard install
(may differ for others):

cd /Library/Ruby/Gems/1.8/gems/mysql-2.8.1
sudo gem install mysql --no-rdoc --no-ri –
–with-mysql-config=/usr/local/mysql/bin/mysql_config

There were many “No definition for…” RDoc and Ri errors otherwise.

Just starting my first Ruby project… and not so comfortable with this
install of the mysql gem. I expect there’s possibly serious
ramifications of excluding these two processes. Can anybody tell us what
are we missing by resorting to these install parameters; and/or how can
we install with ri and rdoc successfully?

tia

m
Yay!
After much irc and googling, at last, I found your recent entry Mike and
I also was able to get an error free install on OS X 10.6.3
with
$ sudo gem install mysql --no-rdoc --no-ri –
–with-mysql-config=/usr/local/mysql/bin/mysql_config

TX!
huuan

Colin L. wrote:

ri and rdoc are just for documentation of the gem. Google them to
find details. Not having them will not affect the operation of the
gem.

Colin

Thanks Colin. I quickly found that out. I’ve posted instructions for
resolving this issue at MySQL:

http://forums.mysql.com/read.php?116,359591,359591#msg-359591

The described process determines vital paths for successful installation
on potentially any system.

Kirk Howard wrote in post #840950:

Whenever you can’t build “native extensions”, it means there is some lib
or lib-dev missing. Generally you’ll need to do a sudo apt-get install
lib-???-dev, or sudo apt-get install build_essential.

This time, I had to install the following:
‘sudo apt-get install libmysqlclient15-dev’

Unfortunately, there is NO EASY WAY (that I know of) to identify what is
missing from the attempt to compile.

Excellent. This worked for me!
I did it and
sudo gem install mysql2

Successful :slight_smile:
Thanks

apt-get install libmysqld-dev

will be ok .

This worked for me too, Ubuntu 11.04 desktop.

William P. wrote in post #595050:

It’s very possible that it is looking for libmysqlclient (I am almost
positive it does). Install the client / client libs and see if that
solves your problem.

-Bill

pete wrote:

bill gate wrote in post #989948:

apt-get install libmysqld-dev

will be ok .

Excellent !! it works for me on ubuntu 9.10,

sudo apt-get install libmysqld-dev

(installation process … )

sudo gem install mysql

Wainer Moschetta wrote in post #773714:

I was facing this same issue. I just installed libmysqlclient15-dev on
my syste (ubuntu 8.10) and could get gem mysql installed successfully

William P. wrote:

It’s very possible that it is looking for libmysqlclient (I am almost
positive it does). Install the client / client libs and see if that
solves your problem.

-Bill

thanks. I installed libmysqlclient16-dev, everything worked.

This is an old thread, but if you google the error message, it appears
first in the list of results, so it’s worth writing a summary.

The root of the problem is that to install the mysql gem you need to
compile some native code. (“Native code” is software written in a
language such as C or C++ which needs to be compiled specifically for
the processor that your computer uses - 64-bit Intel x86 or whatever.)

Actually, it’s worth noting that this applies to EVERY DATABASE GEM -
postgres, firebird or whatever. Mysql is just the most popular.

As far as I can see, the reason that the first solution given in this
thread doesn’t work for some people is that it depends upon the method
that you use to install mysql. On my Ubuntu Linux system, I installed
mysql like this:

sudo apt-get install mysql-server mysql-client

This installs mysql, but it doesn’t create a directory
/usr/local/mysql/bin/mysql_config. The first solution expects
that directory to exist.

The second solution is to install the mysql development library, which I
did:

sudo apt-get install libmysqld-dev

and then I could install the mysql gem:

gem install mysql2

So the first solution didn’t work for me but the second one did.
However, for you it may be different.

It’s also worth saying that I’ve installed mysql and Rails on a Windows
PC and I didn’t get this problem. It all depends on the environment you
are using, the version of rails and the method used to install mysql.

This may not be under your control. Last year I tried to get my app
working on a shared managed host that supported Ruby on Rails. They had
just upgraded from Rails 2 to Rails 3. It being a manged host, they
installed all the base software and when I hit this problem I couldn’t
get past it. I wasted hours and got through several hosting companies
before I switched to a Virtual Private Server (VPS) where I have root
access and install everything myself. I got the problem again, but this
time I was able to get to the bottom of it.

If you working with a Linux host, this command may be useful:

find / -name "libmysqlclient.*" 2>/dev/null

It searches through your file system starting at the root looking for
libmysqlclient. On my system it produces:

/usr/lib/libmysqlclient.a
/usr/lib/libmysqlclient.so.16
/usr/lib/libmysqlclient.so
/usr/lib/libmysqlclient.so.16.0.0