gpt4 book ai didi

mysql - 无法运行 WEBrick

转载 作者:行者123 更新时间:2023-11-29 06:14:17 27 4
gpt4 key购买 nike

尝试在这里学习 Ruby on Rails 并遵循视频教程,但似乎无法运行环境。我现在已经使用rails new project_name 创建了一个项目,但是当我去运行服务器rails 服务器时,我实际上无法让它工作。

我收到的消息如下:

drew$  rails server
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2.rb:9:in `require': dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
Reason: image not found - /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2.rb:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
from /Users/andrewdellostritto/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:52:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

有人可以帮忙吗?提前致谢!

最佳答案

您的 mysql2 gem 似乎未正确安装。 Take a look at this question 。不确定您的环境是什么样的,但如果您使用的是 Windows,请查看第二个答案。我认为这将适用于您。

关于mysql - 无法运行 WEBrick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7494652/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com