2011-12-08 4 views
3

가능한 중복 :
Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem레이크 DB : 마이그레이션 (MySQL의)

왜 내가이 오류가 ?? 무슨 뜻이야? 내가 mysql2 보석을 설치 한

,

Gemfile "sudo는 보석 mysql2 설치"

gem 'mysql2' 

~ : 레이크 DB는 :

rake aborted! 
dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib 
    Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle 
    Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle 
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle 
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in `require' 
/Users/leonardo/dev/myproject/config/application.rb:7 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require' 
/Users/leonardo/dev/myproject/Rakefile:5 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `load_rakefile' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `run' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
/Library/Ruby/Gems/1.8/gems/rake-0.9.2.2/bin/rake:33 
/usr/bin/rake:19:in `load' 
/usr/bin/rake:19 
+2

해결 : http://stackoverflow.com/a/6100648/1028100 감사합니다. 이제이 질문을 닫을 수 있습니다. – sparkle

답변

3

코드의이 비트를 넣어 --trace 마이그레이션 .profile 및 .bash_profile 파일에서.

alias ll="ls -lahG" 
alias whereami="pwd" 

export PATH="/Applications/MAMP/bin:/usr/local/bin:/usr/local/sbin:usr/local/my$ 
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH" 

사람 : 당신이 방법을 모르는 경우, 터미널에 당신이 그것을 열 때마다 ...

export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

이 내 .bash_profile에이 모습입니다 이것을 입력 루트 ($) 터미널 메뉴에서 bash를 편집하고 ls -la을 입력 한 다음 nano .bash_profile 및/또는 nano .profile을 입력하여 bash 용 텍스트 편집기에 넣습니다 (둘 다 동일하게 유지하면 중복 될 수 있습니다. 모르겠다.)

편집이 끝나면 Ctrl-X를 누른 다음 '돌아 가기'를 눌러 주 메뉴로 돌아갑니다.

+0

또는 config/database.yml 파일을 sqlite3과 작동하도록 변경하십시오. mysql을 사용할 필요가 없다면, mysql을 사용하면 안된다. sqlite3 완벽하게 괜찮아 언제든지 mysql을 언제든지 당신이 그것을 느낄 수 있습니다. sqlite3에 대한 database.yml 파일에 대한 google, github.com에 충분히 있어야합니다. –

관련 문제