Thursday, January 29. 2009MAMP and the Ruby MySQL GemTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
checking build system type... i686-apple-darwin9.6.0
checking host system type... i686-apple-darwin9.6.0 checking target system type... i686-apple-darwin9.6.0 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... no checking "character sets"... default: latin1, collation: latin1_swedish_ci; compiled in: latin1 latin1 utf8 checking whether to compile national Unicode collations... yes checking whether build environment is sane... yes checking whether make sets $(MAKE)... (cached) no checking for gawk... (cached) awk checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. I am getting above error message, what should I do? Thanks-
I think you need to install the XCode development tools first, which should give you the gcc C compiler. You should have XCode on one of your Mac installation CDs.
A huge thanks on this, for the article and the note on needing a c compiler
I cannot thank you enough! This saved me more than a few minutes.
Danny
I spent hours looking for this, on more than one occasion. You just saved my hair line!!!
I'd like to add another voice to those who found this exceedingly helpful. In my situation I was lucky enough that all i needed to do was:
sudo gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
FANTASTIC
I have spent hours on this problem and thank goodness I found your page!!! Thanks a trillion
you are a scholar and a gentleman
thank you so much for your help.
Guess it depends on what you want to develop with. I have not used SQLite yet.
Yet another super-appreciative fellow is me. You really saved me a ton of hair-puling and gnashing of teeth. Honestly, I can't thank you enough!
One small step for Ruby developers, one giant leap for mankind.
Great work, Mike.
I use Puppy Linux; I don't even know what MAMP is. But on my limited machine, with a cut-down install of mySQL, your advice solved my dependency/linkage problems EXACTLY. I needed your step 8 of copying the *.h files too. THANK YOU SO MUCH! This created a stable mySQL install after a fruitless & extremely frustrating weekend.
Mike, it's been a looong night, but thanks to you I can now go to sleep
I am still getting the following error:
*** 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. Any ideas. I did exactly as you said and everything was fine until the last line for the gem install
Any luck with your erros? I'm getting the same errors after the steps above.
Thank you very much mate! It worked like a charm! Well done!!!! YEAH!!!!!!!
I did everything and I'm still getting the following errors...Can someone help me out
Building native extensions. This could take a while... 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 *** 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.
Setting up my Ruby on Rails environment on my Macbook Pro using Mamp and Snow Leopard - this post, again, saved me a lot of trouble!!! Thanks!
How the hell can i compile the gem with the new MAMP 1.8.2..?
There's no source available, so i had to download the src from mysql (version 5.137) When following the steps above all goes well until i run "make -j2" command (i don't normally compile anything myself, so cant' really describe whats going wrong). the command seems to loop through the same code over and over and maxes out the cpu usage. I cannot be the 1st one trying to install with this setup, so please help..!
If you have Snow do NOT install 1.8.2. Yes it IS for 10.6 but Snow causes serious link errors both in MAMP 1.8.2 AND in the native mysql OS X install. Seriously after 6 hours my team and found with Snow its best to stick with MAMP 1.7.2. MAMP knows this and Apple has been contacted about this issue. I encourage more to let Apple know that Snow needs more help with their mysql install.
Dude! WTF! You just saved my ass.
Also note: I'm on MAMP 1.8.2 and used the exact instructions above, and all seems to be working fine!
I'm on a PPC Mac and when I try to sudo gem install mysql (aka step 9) it says:
"gcc: installation problem, cannot exec 'i686-apple-darwin8-gcc-4.0.0'" WTF! My gcc version should be 'powerpc-apple-darwin8-gcc-4.0.0' So I've tried putting *env ARCHFLAGS="-arch ppc"*, I've even tried intercepting the Makefile from extconf.rb and editing it, replacing all references to "i386" with "ppc". Now it makes and just says "nothing to be done for 'all'". But the mysql gem is still not installed. I feel I'm really close to solving this for PPC, so hopefully another PPC user will find this helpful (or better, provide the correct solution!)
Aha! Got it:
I went to this url: http://tmtm.org/en/mysql/ruby/ and downloaded his mysql-ruby package. I think it's the same one that comes with Ruby but what the hey. Then after following steps 1-8 from this page, I used these commands from the other site: *ruby extconf.rb --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config* (then edited the resulting Makefile to change i386 to ppc) *make* *make install* Now it works! (Maybe there was a simpler way of forcing PPC, or maybe my system is just messed up from the norm). HTH
Hi everyone
Thanks for the help, but unfortunately for me, I'm stuck on the last line. I'm on snow leopard and i've installed the 1.7.2 version of MAMP. When I type the last line, I get : Building native extensions. This could take a while... 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 No definition for field_def No definition for field_type etc etc etc -- It seems mysql is installed anyway, but there's a pb with the documentation. Does any one knows how I can manage to solve this issue ? Thanks very much, I've been spending hours on that ...
I followed your instructions.
When I do: $ rake db:migrate I get: rake aborted! uninitialized constant MysqlCompat::MysqlRes
Looks like a problem with a newer MySQL gem. You might to try to install a 2.7.x gem. This page has some details on that error message:
http://stackoverflow.com/questions/1332207/uninitialized-constant-mysqlcompatmysqlres-using-mms2r-gem
I tried the symbolic link solution and that didn't work.
So I tried this: sudo gem install mysql -v 2.7 -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config --mysql_dir=/Applications/MAMP/Library/lib/mysql And I get this: checking for mysql_ssl_set()... yes checking for mysql.h... yes creating Makefile make gcc -I. -I/usr/local/include/ruby-1.9.1/i386-darwin10.2.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/Applications/MAMP/Library/include/mysql -fno-common -D_XOPEN_SOURCE=1 -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -o mysql.o -c mysql.c mysql.c:6:21: error: version.h: No such file or directory mysql.c: In function ‘make_field_obj’: mysql.c:185: warning: unused variable ‘hash’ mysql.c: In function ‘escape_string’: mysql.c:267: error: ‘struct RString’ has no member named ‘len’ mysql.c:268: error: ‘struct RString’ has no member named ‘len’ mysql.c:268: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:268: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:268: error: ‘struct RString’ has no member named ‘len’ mysql.c: In function ‘real_escape_string’: mysql.c:401: error: ‘struct RString’ has no member named ‘len’ mysql.c:402: error: ‘struct RString’ has no member named ‘len’ mysql.c:402: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:402: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:402: error: ‘struct RString’ has no member named ‘len’ mysql.c: In function ‘query’: mysql.c:710: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:710: error: ‘struct RString’ has no member named ‘len’ mysql.c:729: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:729: error: ‘struct RString’ has no member named ‘len’ mysql.c: In function ‘query_with_result_set’: mysql.c:882: warning: implicit declaration of function ‘TypeError’ mysql.c: In function ‘fetch_field_direct’: mysql.c:960: warning: implicit declaration of function ‘Raise’ mysql.c: In function ‘fetch_hash2’: mysql.c:1032: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1033: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1033: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1033: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1033: error: ‘struct RString’ has no member named ‘ptr’ mysql.c: In function ‘field_inspect’: mysql.c:1157: error: ‘struct RString’ has no member named ‘len’ mysql.c:1158: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1158: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1158: error: ‘struct RString’ has no member named ‘ptr’ mysql.c: In function ‘stmt_bind_result’: mysql.c:1284: error: ‘struct RString’ has no member named ‘ptr’ mysql.c: In function ‘stmt_execute’: mysql.c:1346: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1347: error: ‘struct RString’ has no member named ‘len’ mysql.c:1348: error: ‘struct RString’ has no member named ‘len’ mysql.c:1359: error: ‘struct RArray’ has no member named ‘ptr’ mysql.c:1360: error: ‘struct RArray’ has no member named ‘ptr’ mysql.c:1361: error: ‘struct RArray’ has no member named ‘ptr’ mysql.c:1362: error: ‘struct RArray’ has no member named ‘ptr’ mysql.c:1363: error: ‘struct RArray’ has no member named ‘ptr’ mysql.c:1364: error: ‘struct RArray’ has no member named ‘ptr’ mysql.c:1316: warning: unused variable ‘false’ mysql.c: In function ‘stmt_prepare’: mysql.c:1584: error: ‘struct RString’ has no member named ‘ptr’ mysql.c:1584: error: ‘struct RString’ has no member named ‘len’ make: *** [mysql.o] Error 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7/gem_make.out
Thanks Mike,
Forgive my ignorance - I'm a designer and stay away from the terminal as much as possible... Can you elaborate on steps 4 and 5 a little more? MAMP and MAMP Pro are set up and running fine (from Moodle) The source code is on my hard drive Latest XCode is installed How do I "go into the source code directory" and "untar the mysql file"? Thanks
Say you put the zip file in your Downloads folder and unzipped it there. When you open the terminal you can do something like this:
cd Downloads/MAMP_1.7.2_src That will put you into the source code directory. Then you "untar" the file by running: tar -xzvf mysql-5.0.41.tar.gz Hope that helps!
I second what everyone else who thanks you said, THANK YOU!
This is surely one of the most important posts for anyone adding RoR to a new mac. I can't think of a much more common setup than MAMP + Ruby 1.9n With that said, it's probably worth updating the version details/links for the copy and paste crew... Thanks once again!
I have no idea what I just did, but it worked, thank you so much!
I have been building websites for a whole now and I am just getting into ruby, and RoR, but doesn't this seem a bit overcomplex compared to the ease of using Ruby otherwise? In any case, many thanks again!
Awesome! I also do a bunch of PHP dev on this machine, and it seemed a waste to install another mysql alongside what I'm already using in MAMP. Your instructions cleared up my installation problems for the mysql gem. Thanks!
I don't have a "configure" file or directory. Thus, I can't compile the library. Am I missing something? Obviously I am if it is working for everyone else, but what?
I do. I also installed the most recent one today just to make sure I was up to date. I kind-of fixed my problem and complied "compile-darwin-mwcc" and eventually got my MAMP working with my rails app.
But I am having a HECK of a time getting everything to work correctly and now I'm getting a rails error that says "more_events" or something in there. Is there a definitive way to install and use ruby on rails on 10.6.6? That's probably a question for another forum...
You've probably installed the most recent MAMP 1.9.5 with MySQL 5.5, which (sic!) uses cmake instead of GNU make.
Other than knowing this wonderful fact, I still didn't find the way to compile these sources for MAMP
Solved it just a couple of hourse since the previous comment
If you still need it, please read here: http://blog.mirotin.net/?p=35
i've spent 3 hours trying to make/configure this mysql
then, i did brew install mysql then set up mysql as was said in brew readme after installations and voila. mysql gem installed successfully, mysql works, and MAMP works at the same time
will probably only work if MAMP and brew versions of mysql are the same
I found that in my case, the
cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql should be cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib As it seems that when gem is trying to find the mysqllib, it does not search down the folder tree.
For anyone who is using MAMP 1.9.6 (and hence MYSQL 5.5.9) check out this wicked tut:
http://blog.mirotin.net/35/mamp-1-9-5-mysql-5-5-9-and-ruby-mysql2
Sorry, its down for maintenance, will be back by Sunday
Working again, the url is http://blog.mirotin.net/35/mamp-1-9-5-mysql-5-5-9-and-ruby-mysql2
Also, I think your ruby and mysql executables need to be of the same architecture. MAMP is 32-bit as far as I know.
Everything broke down on my new Lion machine.
I would like to see updated solution for MAMP2, mysql2, rvm, rails3 on OS X Lion... I managed to install the gem experimenting with the mirotin.net post, but using it in Rails fails with: [FATAL] failed to allocate memory Add Comment
|
CategoriesQuicksearchArchives |