2016-06-28 87 views
0

我有安裝。現在我做的包安裝和我得到這個錯誤的AWS服務器上我的項目。
在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「0.3.21」 OR百勝安裝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

你能否確認你的服務器已安裝mysql? – oreoluwa

+0

我已經用yum安裝的libmysqlclient-dev的,之後我跑捆綁安裝,但錯誤是相同的 –

+0

如何給確認MySQL正在安裝或不安裝? –

回答

0

您需要先安裝libmysqlclient-dev包,然後才能嘗試安裝mysql2寶石。檢查this page的MySql部分。即使你的機器已經安裝了mysql服務器,你將需要這個mysql客戶端軟件包。

你可以做sudo apt-get install libmysqlclient-devyum install libmysqlclient-dev取決於你的Linux發行版。確保這是成功完成的。只有在此之後,你可以安裝mysql2寶石:gem install mysql2

希望它可以幫助:)

+0

我已經嘗試百勝安裝的libmysqlclient-dev的和寶石安裝mysql2但兩人都沒有爲我工作 –

+0

沒有安裝的libmysqlclient-dev的順利完成?如果不是,你可以請更新你的問題,包括該嘗試的錯誤日誌? –

+0

我已經更新了我的問題,當我安裝libmysqlclient-dev –

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 dist ribution。

+0

我做了所有你提供的東西,但錯誤是一樣的' –