Trying to get rails up and running on my linux box with mysql. When I
try to install the mysql gem, I get the following:
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
ruby extconf.rb install mysql
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… yes
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
*** 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 /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/
gem_make.out
I’ve tried setting the config option and other various things when
running ‘gem install’.
Anyone know how to get around this? Thanks very much.
Trying to get rails up and running on my linux box with mysql. When I
try to install the mysql gem, I get the following:
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
cd /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7
gem install mysql –
–with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
ruby extconf.rb install mysql – --with-mysql-config=/usr/local/mysql/
bin/mysql_config
extconf.rb:1: command not found: /usr/local/mysql/bin/mysql_config –
cflags
*** 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 /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/
gem_make.out
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:
It compiles and installs a mysql driver used by ruby. You must have a
does this do?
No success with that either:
Could not create Makefile due to some reason, probably lack of
–with-make-prog
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.
Trying to get rails up and running on my linux box with mysql. When I
try to install the mysql gem, I get the following:
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
cd /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7
gem install mysql –
–with-mysql-config=/usr/local/mysql/bin/mysql_config
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.
Trying to get rails up and running on my linux box with mysql. When I
try to install the mysql gem, I get the following:
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
cd /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7
gem install mysql –
–with-mysql-config=/usr/local/mysql/bin/mysql_config
I found a blog post that solves this problem ( Nathan Manzi's Blog | Home
) and I turned it into a script so that you just have to run “./
install_mysql_ruby_adapter”
I run Ruby 1.9.1 on Ubuntu 8.04/8.10 and CentOS 5.2 with root
access.
<-- clip starts -->
[root]# gem install mysql – --with-mysql-config=/usr/bin/mysql_config
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install mysql –
–with-mysql-config=/usr/bin/mysql_config
checking for mysql_ssl_set()… no
checking for mysql.h… no
checking for mysql/mysql.h… 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
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
<-- clip ends -->
Steps I needed on CentOS 5 linux were (in addition to installed ‘normal’
mysql)
Install mysql-devel “yum install mysql-devel” as root
Find the location of mysql_config “locate mysql_config” and fix that
full path to “–with-mysql-config=” option
Success!
<-- clip starts -->
[root]# gem install mysql –
–with-mysql-config=/usr/lib/mysql/mysql_config
Building native extensions. This could take a while…
Successfully installed mysql-2.7
1 gem installed
<-- clip ends -->
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.
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?