2011-07-18 6 views
0

새로운 기능을 추가하기 위해 이미 빌드 된 새 앱을 담당했습니다. 불행히도, 그것은 몇 년 전에 만들어졌고 (레일 2.1 사용) mysql을 사용한다. (나는 postgres를 선호한다.) 내 로컬 컴퓨터에서 코드를 엉망으로 만들 수 있도록 mysql gem을 설치하려고하는데 다음과 같은 오류가 발생합니다. mysql gem 레일에 설치 오류가 발생했습니다.

$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 
Password: 
Building native extensions. This could take a while... 
ERROR: Error installing mysql: 
    ERROR: Failed to build gem native extension. 

/opt/local/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config 
checking for mysql_ssl_set()... no 
checking for rb_str_set_len()... no 
checking for rb_thread_start_timer()... no 
checking for mysql.h... no 
checking for mysql/mysql.h... 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 
    --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=/opt/local/bin/ruby 
    --with-mysql-config 


Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection. 
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out 

내가 (그것을 수행) 확인 파일이 존재 할 디렉토리/usr/지방/mysql을/빈 /되는 mysql_config을 확인 ... 나는 (V 5.1) MySQL의 사이트에서 DMG 파일로 mysql을 설치했습니다.

솔직히 말해서이 문제를 어떻게 해결할 수 있을까요? 어떤 제안?

감사합니다.

+0

머신에 mysql.h가 실제로 있는지 확인하십시오./usr/local/mysql/include에 있어야합니다. 거기에 없으면/usr/local/mysql/bin/mysql_config를 실행 한 결과를 게시 할 수 있습니까? – eugen

답변

1

mysql 헤더 파일이 dmg 파일에 포함되어 있다고 생각하지 않습니다. Homebrew 또는 Macports를 설치하고 brew install mysql 또는 sudo port -v install mysql5-server mysql5

관련 문제