我在aws服务器上设置了我的项目。现在我正在进行捆绑安装,我收到了这个错误。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160628-9837-1r9tsw1.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... yes
checking for mysql.h... no
checking for mysql/mysql.h... yes
checking for errmsg.h... no
-----
errmsg.h is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
-----
*** 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/rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME)
--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-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
extconf failed, exit code 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.1/gems/mysql2-0.3.21 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/mysql2-0.3.21/gem_make.out
Using raindrops 0.16.0
Using sass 3.4.22
Using tilt 2.0.5
Using spring 1.7.1
Using sqlite3 1.3.11
Using will_paginate 3.1.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using warden 1.2.6
Using mime-types 3.1
Using net-scp 1.2.1
Using binding_of_caller 0.7.2
Using sprockets 3.6.0
Using coffee-script 2.4.1
Using uglifier 3.0.0
Using httparty 0.13.7
An error occurred while installing mysql2 (0.3.21), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.21'` succeeds before bundling.<br/>
我做了宝石安装mysql2 -v&#39; 0.3.21&#39;或者yum install mysql-devel对我来说都不起作用。任何人都可以告诉我可能出现的问题是什么
yum install libmysqlclient-dev
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* epel: mirror.wanxp.id
* extras: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
No package libmysqlclient-dev available.
Error: Nothing to do
答案 0 :(得分:0)
在尝试安装libmysqlclient-dev
gem之前,您需要安装mysql2
包。检查this page的MySql部分。即使你的机器上已经安装了mysql服务器,你也需要这个mysql客户端软件包。
您可以执行sudo apt-get install libmysqlclient-dev
或yum install libmysqlclient-dev
,具体取决于您的Linux发行版。确保成功完成此操作。只有在那之后你才能安装mysql2 gem:gem install mysql2
希望有所帮助:)
答案 1 :(得分:0)
日志中的错误已经建议解决问题:
errmsg.h is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
sudo apt-get install libmysqlclient-dev libmysqlclient18
或
sudo yum install mysql-devel
取决于您的ubuntu发行版。