2014-09-10 12 views
0

새 Mavericks 컴퓨터에서 너무 오래된 (그러나 몇 년 전의) Rails 프로젝트를 설정하려고합니다. 내가 bundle 할 때 내가 (긴 코드 죄송합니다)이 오류가 계속 : 나는 보석이 MySQL 버전 5.5.20을 위해 지어진한다는 메시지를 가지고 그 전에mysql2 gem을 설치하지 못했습니다.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
/Users/royzinn/.rbenv/versions/1.8.7-p352/bin/ruby extconf.rb --with-mysql-config=/usr/local/Cellar/mysql/5.5.20/bin/mysql_config 
checking for rb_thread_blocking_region()... no 
checking for rb_wait_for_single_fd()... no 
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 
    --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=/Users/royzinn/.rbenv/versions/1.8.7-p352/bin/ruby 
    --with-mysql-config 


Gem files will remain installed in /Users/royzinn/dailyd/vendor/ruby/1.8/gems/mysql2-0.2.18 for  inspection. 
Results logged to /Users/royzinn/dailyd/vendor/ruby/1.8/gems/mysql2-0.2.18/ext/mysql2/gem_make.out 

내가 이미 가지고있는 것을 다른 (고급) MySQL을 활성화했습니다.

Homebrew로 모든 것을 "청소"하고 다시 설치하려고 시도했지만 아무 것도 작동하지 않는 것 같습니다.

도움이 매우 감사합니다. 감사합니다. 이 보석은 설치에 컴파일 할 수 있는지 확인 RVM 디렉토리를 삭제 도움

+0

아, 내가 오바마로 업그레이드했을 때 나는 수많은 문제가있었습니다. 'brew install mysql'은 작동합니까? 그렇다면 부팅 할 수 있습니까? mysql.sever restart'? – Anthony

+0

이 문제는 MySQL 연결 드라이버에서 헤더 C 파일을 제공하는 것과 관련이 있습니다. 이것에 관해서도 비슷한 문제가 있습니다. 특정 OS에 맞는 솔루션을 찾아보십시오. 나는 우분투와 윈도우에서이 문제를 다루었 고 해결책은 기본적으로 동일했다. –

답변

1

봅니다이 디렉토리를 삭제합니다. 이 OS X에 오히려에 포함 된 경우에도 인수로 경로를 전달하는 대신 - 당신이 보석 컴파일되지 않습니다 오류가 발생하는 경우

gem install mysql 

, Bundler 프로그램이 정보를 찾을 수있는 위치에 MySQL을 설치해야 할 수도 있습니다 Bundler, Homebrew로 MySQL을 설치 한 다음 보석을 설치하십시오.

brew install mysql 
gem install mysql2 

마지막으로 mysql2 gem의 버전이 Gemfile에서 유효하지 않을 수 있으며 업데이트해야합니다.

bundle update mysql2 
0

첫째를 다시 설치하지 않는 경우

/Users/royzinn/dailyd/vendor/ruby/1.8/gems/mysql2-0.2.18 

:

+0

답변 해 주셔서 감사합니다. 얼마 전 이었지만, 내가 기억하는 한 모든 것을 제거하고 홈브류로 다시 설치하는 작업은 다음과 같습니다 .-) –

관련 문제