2013-07-11 4 views
0

stackoverflow에서 여러 질문을 검토 한 결과 모두가 다른 해결책을 제시했습니다. 나는 레일 프로젝트를 복제하고, 번들 설치를 실행하고, 1.9.3 루비와 레일 3.2.13을 사용하여 rvm에 새 gemset을 만들었습니다. 또한 번들 설치 명령과 함께 설치됩니다. 과거에는이 가이드를 사용하여이 문제를 해결했습니다 (http://www.randomactsofsentience.com/2013/05/gem-install-mysql2-missing-mysqlh-on-os.html). 나는 사용자/지역에서 mysql 폴더를 찾을 수 없다. 가이드는 파일을 편집하고 mysql.h 누락 된 문제를 해결하기 위해 somelines를 제거해야한다고 말했다. 이 파일은 더 이상 존재하지 않습니까? 나는 그것을 발견 할 수 없었다? 어쩌면 내가 의존성을 놓치고있다지만, 나는 이러한 종속성의 리눅스 설치 방법을 찾았나요? 어쩌면 내가 최신 버전 대신 mysql5.5를 설치해야하지만 어떻게 지정해야할지 모르겠다. 이것들 중 어느 것이 나를 위해 이것을 해결할 것입니까?MySQL 번들 설치

Installing mysql2 (0.3.11) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /Users/judyngai/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes 
checking for rb_wait_for_single_fd()... yes 
checking for mysql.h... no 
checking for mysql/mysql.h... no 
----- 
mysql.h is missing. please check your installation of mysql 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 
    --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=/Users/judyngai/.rvm/rubies/ruby-1.9.3-p429/bin/ruby 
    --with-mysql-config 
    --without-mysql-config 


Gem files will remain installed in /Users/judyngai/.rvm/gems/[email protected] /gems/mysql2-0.3.11 for inspection. 
Results logged to /Users/judyngai/.rvm/gems/[email protected]/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. 

답변

1

당신은 (즉, .h 파일 확장자) 첫번째 번들/보석 전에 당신의 기본 MySQL의 확장 기능을 구축 할 수 MySQL의 개발 헤더를 설정해야합니다. 어떤 OS를 사용하고 있습니까? 그래서 나는 내 대답을 확장 할 수 ...

예. 데비안의 경우 : apt-get install libmysqlclient-dev (다른 시스템에서는 mysql-devel과 같이 이름이 다를 수 있음). OSX를 사용 중이라면 bundle install problem: mysql.h is missing에 대한 유익한 답변이 도움이 될 것입니다. 창문의 경우 도움이 될 수도 있습니다 : Missing mysql.h and trying to find mysql-devel.

+0

mac osx 10.8.4, 아직 답변을 읽지 않았습니다. 지금 할 것입니다 – Jngai1297

+0

예, 알겠습니다. 가이드가 맞았지만 mysql_config 파일의 경로를 잘못 이해했습니다. 도움을 주셔서 감사합니다. – Jngai1297