When i'm provide "gem install mysql" command, i got the following error.
Please support me in getting out this error.
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Gem files will remain installed in /var/lib/gems/1.8/gems/mysql-2.8.1
for inspection.
Results logged to
/var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
Please don't top post, it makes it difficult to follow the thread.
Insert your reply into the previous post. Thanks.
Sorry Colin.. I'm using Ubuntu 10.10 and rails 2.3.5
In that case I believe you should be using sudo for installing gems,
unless you are also using rvm which I think you are not, so
sudo gem install mysql.
I don't think that will fix the problem though, but try it first.
Otherwise these are the packages I installed to get the rails
development environment going. This was on 10.04 so it may not be
spot on. You likely have most of them already.
sudo apt-get install build-essential
It might be worth trying again at this point, if the above installed
anything. Otherwise:
That is all one line, though obviously you can split it into multiple
sudo apt-get install commands if you want to. As I said that was for
10.04 rather than 10.10 so some of them may not be available I
suppose. It will do no harm though provided it does not say that it
is going to _remove_ anything. If it does say that then I would
advise against doing it.
Have you googled for install rails ubuntu 10.10? You might get a
better list there.
Alternatively you might like to consider installing under rvm, this
gives you the flexibility to easily move up to the latest rails when
you want to. If you are just starting I would recommend going with
rvm and rails 3 anyway. I can tell you exactly what I did to install
2.3.x and 3 under rvm.