2015-02-02 4 views
-1

서버에서 Rails 응용 프로그램을 실행하려고합니다. 그러나 그것은 실행하는 것 그리고 내가 다음과 같은 오류를 얻고있다 mysql2를 설치하려고하면 다음과 같은 오류서버에서 번들이 실행되지 않습니다.

Using jquery-rails 3.1.2 

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    /usr/local/rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150202-30975-1vno3hv.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... 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 *** 
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.0/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 
    --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 

extconf failed, exit code 1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.0/gems/mysql2-0.3.17 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/mysql2-0.3.17/gem_make.out 
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue. 
Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling. 

을 발생하지 않습니다.

[email protected]:/var/www/noise# gem install mysql2 -v '0.3.17' 
Building native extensions. This could take a while... 
ERROR: Error installing mysql2: 
    ERROR: Failed to build gem native extension. 

    /usr/local/rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150202-631-fm19nq.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... 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 *** 
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.0/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 
    --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 

extconf failed, exit code 1 

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.0/gems/mysql2-0.3.17 for inspection. 
Results logged to /usr/local/rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/mysql2-0.3.17/gem_make.out 
+0

는 MySQL은 설치되어 있습니까? – Nithin

+0

@Nithin 예 설치했습니다. n을 확인했습니다. 나는 여전히 같은 오류가 발생하고 있습니다. 나는 그때 설치하기 전에 설치하고 그것을 시도했다 –

+0

어떤 기계를 사용하고 있습니까? OSX 또는 우분투 또는 Windows? – Pavan

답변

2

우분투 언급했듯이, 먼저 개발 패키지를 설치해야합니다.

sudo apt-get install libmysqlclient-dev 

다음

gem install mysql2 -v '0.3.17' 
+0

번들이 실패한 이유를 말씀해 주시겠습니까? –

+1

모르겠지만, 일부 보석에는 특정 패키지가 필요합니다. 따라서 mysql2 gem을 실행하기 위해 컴퓨터에 패키지가 설치되어 있지 않아 번들러가 실패했습니다. – Pavan