试图访问我的红宝石项目

我试图访问我的第一个红宝石项目。 在导航到正确的目录并键入以下内容之后:

$ rails服务器

我收到以下错误消息:

/Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2.rb:7:in require': dlopen(/Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2.rb:7:in
require': dlopen(/Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2.rb:7:in
require': dlopen(/Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.6/lib/mysql2.rb:7:in
'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in
require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in
require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in
block(2 levels)in require'
来自/Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:在each'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in
each'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in
each'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in
block in require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:在each'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in
each'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in
each'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in
require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler.rb:120:in require'from require' from /Users/Rozey/Sites/first_project/config/application.rb:7:in '
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in
require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in
require'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in
block in'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in tap'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in
tap'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in
tap'
from /Users/Rozey/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in
'
从脚本/导轨:6:在require'
from script/rails:6:in
require'
from script/rails:6:in
require'
from script/rails:6:in
'

我以前使用RVM安装了mysql2 gem。 我知道这可能是一个简单的解决方法,但我是新手,所以我感谢你的帮助。

一些额外的信息:

Rozey $红宝石
/Users/Rozey/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
Rozey $哪个mysql
在/ usr /本地/ MySQL的/斌/ MySQL的


你有看看如何解决“dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle,9):库未加载:/ usr / local / mysql / lib / mysql /libmysqlclient.15.dylib“?

它看起来可能是一个类似的问题


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

把它放在bash.profile中,像魅力一样工作


我尝试了以上所有内容,但都没有成功。 我在另一个页面上发现了这个问题库未加载:libmysqlclient.16.dylib错误,当试图在OS X 10.6上运行'rails server'时,使用mysql2 gem并且它的工作方式类似于魅力:

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

链接地址: http://www.djcxy.com/p/41907.html

上一篇: Trying to access my ruby project

下一篇: Eclipse IDE for Java