MySQL cannot be installed automatically
When bunlde is installed on the new Ubuntu system, the following problem occurs:
[Ruby]View plaincopy
- Installing mysql2 (0.3.11) with native extensions
- GEM: Installer: extensionbuilderror: Error: failed to build gem native extension.
- /Home/ailen/. rvm/rubian/ruby-1.9.3-p327/bin/Ruby extconf. Rb
- Checking for rb_thread_blocking_region ()... yes
- Checking for rb_wait_for_single_fd ()... 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... yes
- Checking for mysql_query () in-lmysqlclient... no
- Checking for main () in-lmygcc... no
- Checking for mysql_query () in-lmysqlclient... no
- * ** Extconf. RB failed ***
- Cocould not create makefile due to some reason, probably lack
- Necessary libraries and/or headers. Check the mkmf. Log File for more
- Details. You may need configuration options.
- Provided configuration options:
- -- With-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 =/home/ailen/. rvm/rubies/ruby-1.9.3-p327/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/home/ailen/. rvm/gems/ruby-1.9.3-p327/gems/mysql2-0.3.11 for inspection.
- Results logged to/home/ailen/. rvm/gems/ruby-1.9.3-p327/gems/mysql2-0.3.11/EXT/mysql2/gem_make.out
- An error occurred while installing mysql2 (0.3.11), and bundler cannot continue.
- Make sure that 'gem install mysql2-V '0. 3.11 ''succeeds before bundling.
Solution:
sudo apt-get install libmysql-ruby libmysqlclient-dev
Http://blog.csdn.net/renkai611919/article/details/8223418