当 rails new demo -d mysql 时,在 run bundle install 停留了一会儿,然后出现 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension mysql.h is missing. please check your installation of mysql and try again.
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.
于是乎我便开始运行 gem install mysql -v '0.3.11',接着出现:
ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.
*** 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.
Google 搜索之,发现网上很多人说需要安装 libmysqlclient-dev。于是我便 yum install libmysqlclient-dev.结果出现:
Loaded plugins: langpacks, presto, refresh-packagekit No package libmysqlclient-dev available
哪位能帮忙解决下么?看看到底是什么原因引起的