2013-08-20 3 views
2

mysql2 설치 방법을 모르겠습니다.Ruby On Rails에 mysql2를 설치할 수없는 이유는 무엇입니까?

내가 사용하고 있습니다 :

  • 루비 레일 3.2.14
  • 루비 2.0.0
  • 맥 OS X 10.9 ("매버릭스")

Installing mysql2 (0.3.13) 

An error occurred while installing mysql2 (0.3.13), and Bundler cannot continue. 
Make sure that `gem install mysql2 -v '0.3.13'` succeeds before bundling. 

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 

*** 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. 


Gem files will remain installed in /Users/kimingi/.bundler/tmp/1983/gems/mysql2-0.3.13 for inspection. 
Results logged to /Users/kimingi/.bundler/tmp/1983/gems/mysql2-0.3.13/ext/mysql2/gem_make.out 

An error occurred while installing mysql2 (0.3.13), and Bundler cannot continue. 
Make sure that `gem install mysql2 -v '0.3.13'` succeeds before bundling. 

ERROR: Error installing mysql2: 
    ERROR: Failed to build gem native extension. 
+1

먼저 libmysqlclient-dev를 설치합니까? – Bigxiang

+0

OS 버전의 최첨단에서 살아가는 중 하나의 문제는 기존 코드를 이식되지 않은/새로운 코드 기반에서 작동하도록 이식하는 문제를 상속받는 것입니다. 설치 관리자는 알려진 버전을 테스트하고 알 수없는 버전으로 자주 구토합니다. –

+0

본 적이 있습니까? http://stackoverflow.com/questions/5409761/installing-mysql2-gem-for-ruby-on-rails-with-mac-osx-10-6 –

답변

6

mysql을 로컬로 설치해야합니다. OS X를 사용 중이므로 Homebrew을 사용할 수 있습니다.

# to Install homebrew 
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" 

# to install mysql through homebrew 
brew install mysql 
+0

설치하는 방법에 대한 자세한 정보를 추가 할 수 있습니다. homebrew는 Mac OS 설치의 일반적인 부분이 아니기 때문에 가정용입니다. –

0

동일한 문제가 발생했습니다. 이 문제를 해결하려면 명령 프롬프트를 엽니 다. 응용 프로그램 폴더로 이동하십시오. 그리고 유형 : gem install mysql2 -v 0.3.11이 버전은 훌륭하게 작동합니다.

관련 문제