2011-03-05 2 views
1

Hey Guys J'essaie d'obtenir le Railscasts source code de github. quand je suis en cours d'exécution du paquet d'installation, je suis arrivé cette erreur:Erreur se produit lorsque je cours installer bundle dans Rails

installing mysql2 (0.2.6) with native extensions /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

     /usr/local/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes 
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. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/usr/local/bin/ruby 
    --with-mysql-config 
    --without-mysql-config 
    --with-mysql-dir 
    --without-mysql-dir 
    --with-mysql-include 
    --without-mysql-include=${mysql-dir}/include 
    --with-mysql-lib 
    --without-mysql-lib=${mysql-dir}/lib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-mlib 
    --without-mlib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-zlib 
    --without-zlib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-socketlib 
    --without-socketlib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-nsllib 
    --without-nsllib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 
    --with-mygcclib 
    --without-mygcclib 
    --with-mysqlclientlib 
    --without-mysqlclientlib 


Gem files will remain installed in /Users/yozloy/.bundler/tmp/61472/gems/mysql2-0.2.6 for inspection. 
Results logged to /Users/yozloy/.bundler/tmp/61472/gems/mysql2-0.2.6/ext/mysql2/gem_make.out 
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `block in build_extensions' 
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `each' 
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `build_extensions' 
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `install' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `block in run' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `block in each' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in `<top (required)>' 
    from /usr/local/bin/bundle:19:in `load' 
    from /usr/local/bin/bundle:19:in `<main>' 
+0

Veuillez publier le fichier mkmf.log afin que nous puissions vous aider. Vous n'avez probablement pas installé les bibliothèques mysql. – thomasfedb

Répondre

4
sudo apt-get install --assume-yes mysql-server-5.1 mysql-client-5.1 libmysqlclient-dev 

Cela devrait être tout ce que vous avez besoin pour le petit bijou de mysql2.

+0

Votre code devrait fonctionner, mais j'utilise Mac OSX, Y at-il des alternatives? J'ai essayé le port mac, devrais-je installer 'ysql-server-5.1'' mysql-client-5.1' 'libmysqlclient-dev' tous les trois pour que cela fonctionne? – mko

+0

Sur le mac Homebrew est censé être le chemin à parcourir. Cela peut être aussi facile que de "brasser l'installation mysql". Jetez un oeil à ceci: http://elouisyoung.blogspot.com/2010/12/fresh-mac-rails-development-setup-quick.html – mikewilliamson

0

Je suppose que vous êtes sur OS X basé sur votre répertoire personnel étant/Users/yozloy. Avez-vous installé le xcode developer tools? Ce paquet est requis pour compiler certaines gemmes.

+0

Oui, j'ai installé le xcode, Le problème est dû à l'installation de mysql pas correctement. – mko

1

Merci Mike .. Il fonctionne pour moi :) J'utilise Ubuntu, installé juste

apt-get install --assume oui mysql-server-5.1 mysql-client-5.1 libmysqlclient-dev

et a travaillé pour moi.

+0

Merci, cela a fonctionné pour moi aussi. –

Questions connexes