Hi, Ive got Mac OS 10.5.8 and MySQL 5.0.67-osx10.5-x86 (installed in /usr/ local/mysql) working fine with my Rails 2.1.0 applications. Im trying a test run of Rails 2.3.5 and having to install the MySQL gem is literally driving me crazy! Ive tried all the following commands, with sudo and without and I''m getting the same error for all of them, ie. ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 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... 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... no 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. The commands I''ve tried after much Googling and blog posts are, env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/ usr/local/mysql/bin/mysql_config env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/ local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql- include=/usr/local/mysql/include env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/ local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql- include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/ bin/mysql_config env ARCHFLAGS="-arch i386" gem install mysql --with-mysql-dir=/usr/ local/mysql gem install mysql -- --with-mysql-dir=/usr/local/mysql gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/ mysql_config As advised by the gem install o/p, I checked the mkmf.log file in / Users/<user>/.gem/ruby/1.8/gems/mysql-2.8.1/ext/mysql_api/mkmf.log and found this - "ld: library not found for -lmysqlclient" . Hope someone can help me fix this. Quite frustrating! Danke! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Anyone? On Jun 6, 4:28 pm, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Ive gotMacOS10.5.8 andMySQL5.0.67-osx10.5-x86 (installed in /usr/ > local/mysql) working fine with my Rails 2.1.0 applications. > > Im trying a test run of Rails 2.3.5 and having to install theMySQLgemis literally driving me crazy! Ive tried all the following > commands, with sudo and without and I''m getting the same error for all > of them, ie. > > ERROR: Error installingmysql: > ERROR: Failed to buildgemnative extension. > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby > 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... 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... no > 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. > > The commands I''ve tried after much Googling and blog posts are, > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-config=/ > usr/local/mysql/bin/mysql_config > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-dir=/usr/ > local/mysql--with-mysql-lib=/usr/local/mysql/lib --with-mysql- > include=/usr/local/mysql/include > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-dir=/usr/ > local/mysql--with-mysql-lib=/usr/local/mysql/lib --with-mysql- > include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/ > bin/mysql_config > env ARCHFLAGS="-arch i386"geminstallmysql--with-mysql-dir=/usr/ > local/mysqlgeminstallmysql-- --with-mysql-dir=/usr/local/mysqlgeminstallmysql-- --with-mysql-config=/usr/local/mysql/bin/ > mysql_config > > As advised by thegeminstall o/p, I checked the mkmf.log file in / > Users/<user>/.gem/ruby/1.8/gems/mysql-2.8.1/ext/mysql_api/mkmf.log and > found this - "ld: library not found for -lmysqlclient" . > > Hope someone can help me fix this. Quite frustrating! > > Danke!-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ryan Tu
2010-Jun-25 03:26 UTC
Re: Installing MySQL gem on Mac OS X Leopard for Rails 2.3.5
I met the same problem on Cent OS 5.3. My solution is follow: 1. sudo yum install mysql-devel.x86_64 2. gem install mysql So you need mysql-devel package For Mac, I found some answers from http://stackoverflow.com/questions/2716527/how-to-install-mysql-gem-on-mac-os-10-6 you can try this: http://www.tmtm.org/en/ruby/mysql/ to download the tar file, and run the command below # ruby ./install.rb On Jun 8, 4:21 am, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Anyone? > > On Jun 6, 4:28 pm, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > Ive gotMacOS10.5.8 andMySQL5.0.67-osx10.5-x86 (installed in /usr/ > > local/mysql) working fine with my Rails 2.1.0 applications. > > > Im trying a test run of Rails 2.3.5 and having to install theMySQLgemis literally driving me crazy! Ive tried all the following > > commands, with sudo and without and I''m getting the same error for all > > of them, ie. > > > ERROR: Error installingmysql: > > ERROR: Failed to buildgemnative extension. > > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby > > 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... 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... no > > 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. > > > The commands I''ve tried after much Googling and blog posts are, > > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-config=/ > > usr/local/mysql/bin/mysql_config > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-dir=/usr/ > > local/mysql--with-mysql-lib=/usr/local/mysql/lib --with-mysql- > > include=/usr/local/mysql/include > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-dir=/usr/ > > local/mysql--with-mysql-lib=/usr/local/mysql/lib --with-mysql- > > include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/ > > bin/mysql_config > > env ARCHFLAGS="-arch i386"geminstallmysql--with-mysql-dir=/usr/ > > local/mysqlgeminstallmysql-- --with-mysql-dir=/usr/local/mysqlgeminstallmysql-- --with-mysql-config=/usr/local/mysql/bin/ > > mysql_config > > > As advised by thegeminstall o/p, I checked the mkmf.log file in / > > Users/<user>/.gem/ruby/1.8/gems/mysql-2.8.1/ext/mysql_api/mkmf.log and > > found this - "ld: library not found for -lmysqlclient" . > > > Hope someone can help me fix this. Quite frustrating! > > > Danke! > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jonathan C.
2010-Jun-25 11:03 UTC
Re: Installing MySQL gem on Mac OS X Leopard for Rails 2.3.5
Hi Ram, http://hivelogic.com/articles/ruby-rails-leopard and http://hivelogic.com/articles/installing-mysql-on-mac-os-x :D -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hello Ryan, Thank you for your response. I downloaded and installed the tar file but that dint help in installing the gem either. I want to get a few things right first, 1. I have mysql 5.0.67 x86 version installed which seems to be a 32 bit version. But I have a 64 bit Intel Core 2 duo processor. Can that cause issues? 2. Does "checking for mysql_query() in -lmysqlclient... no" mean im missing the mysql-dev package? On Jun 25, 8:26 am, Ryan Tu <tu.rong...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I met the same problem on Cent OS 5.3. > My solution is follow: > 1. sudo yum install mysql-devel.x86_64 > 2. gem install mysql > So you need mysql-devel package > For Mac, I found some answers fromhttp://stackoverflow.com/questions/2716527/how-to-install-mysql-gem-o... > you can try this: > http://www.tmtm.org/en/ruby/mysql/to download the tar file, and > run the command below > # ruby ./install.rb > > On Jun 8, 4:21 am, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Anyone? > > > On Jun 6, 4:28 pm, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > Ive gotMacOS10.5.8 andMySQL5.0.67-osx10.5-x86 (installed in /usr/ > > > local/mysql) working fine with my Rails 2.1.0 applications. > > > > Im trying a test run of Rails 2.3.5 and having to install theMySQLgemis literally driving me crazy! Ive tried all the following > > > commands, with sudo and without and I''m getting the same error for all > > > of them, ie. > > > > ERROR: Error installingmysql: > > > ERROR: Failed to buildgemnative extension. > > > > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby > > > 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... 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... no > > > 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. > > > > The commands I''ve tried after much Googling and blog posts are, > > > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-config=/ > > > usr/local/mysql/bin/mysql_config > > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-dir=/usr/ > > > local/mysql--with-mysql-lib=/usr/local/mysql/lib --with-mysql- > > > include=/usr/local/mysql/include > > > env ARCHFLAGS="-arch i386"geminstallmysql-- --with-mysql-dir=/usr/ > > > local/mysql--with-mysql-lib=/usr/local/mysql/lib --with-mysql- > > > include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/ > > > bin/mysql_config > > > env ARCHFLAGS="-arch i386"geminstallmysql--with-mysql-dir=/usr/ > > > local/mysqlgeminstallmysql-- --with-mysql-dir=/usr/local/mysqlgeminstallmysql-- --with-mysql-config=/usr/local/mysql/bin/ > > > mysql_config > > > > As advised by thegeminstall o/p, I checked the mkmf.log file in / > > > Users/<user>/.gem/ruby/1.8/gems/mysql-2.8.1/ext/mysql_api/mkmf.log and > > > found this - "ld: library not found for -lmysqlclient" . > > > > Hope someone can help me fix this. Quite frustrating! > > > > Danke!-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Okay ... RESOLVED! :D I left the mysql installation as such in /usr/local . I had been running the ruby and rails shipped with leopard Followed the hivelogic article above to roll my own installations on / usr/loca/ and then ran "sudo gem install mysql -- --with-mysql-dir=/ usr/local/mysql" . Worked like a charm! Thank you all for the help! On Jun 25, 4:03 pm, "Jonathan C." <jonathancsi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Ram, > > http://hivelogic.com/articles/ruby-rails-leopardandhttp://hivelogic.com/articles/installing-mysql-on-mac-os-x > > :D-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.