这是我在这里提出的第一个问题,所以如果我违反任何规则,我会提前道歉。
我正在尝试在我的系统上运行一个项目,我已经通过GITHub导入了源代码,并使用WEBrick在本地运行它。当我这样做时,会打印以下错误:
=>启动WEBrick
=> Rails 2.3.8应用程序从0.0.0.0:3000开始
:29:require': LoadError: 126: Det går inte att hitta den angivna modulen(*Translation: Cannot find the given module*.) - C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so (Sequel::AdapterNotFound)
from <internal:lib/rubygems/custom_require>:29:in
要求'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in
new_constants_in'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:7:in
rescue in'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/mysql.rb:2:in <top (required)>'
from <internal:lib/rubygems/custom_require>:29:in
require'
来自:29:require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
块中的'需要'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
require'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/adapters/mysql.rb:4:in rescue in <top (required)>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/adapters/mysql.rb:1:in
'
来自:29:require'
from <internal:lib/rubygems/custom_require>:29:in
要求'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in
new_constants_in'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:在tsk_require中的require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/core.rb:249:in
块中
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/core.rb:72:in block in check_requiring_thread'
from <internal:prelude>:10:in
synchronize'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/core.rb:69:in check_requiring_thread'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/core.rb:249:in
tsk_require'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/database/connecting.rb:23:in adapter_class'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/database/connecting.rb:61:in
connect'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/sequel-3.15.0/lib/sequel/core.rb:119:in connect'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails_sequel-0.2.1/lib/rails_sequel/rails_sequel.rb:5:in
connect'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails_sequel-0.2.1/lib/rails_sequel.rb:8:in <top (required)>'
from <internal:lib/rubygems/custom_require>:29:in
require'
来自:29:require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
块中的'需要'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
require'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/rails/gem_dependency.rb:215:在load_gems中的load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:307:in
块中
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:307:in each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:307:in
load_gems'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:164:in process'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:113:in
run'
来自C:/ Users / Soroush / AppData / Local / VirtualStore / Program Files / Git / foobar / projectxt / config / environment.rb:9:in <top (required)>'
from <internal:lib/rubygems/custom_require>:29:in
require'
来自:29:require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
块中的'需要'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in
require'
来自C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.8/lib/commands/server.rb:84:in <top (required)>'
from <internal:lib/rubygems/custom_require>:29:in
require'
来自:29:require'
from script/server:3:in
'
在问这里之前,我已经搜索了Sequel :: AdapterNotFound,LoadError126,mysql_api.so,但似乎无法获得任何有价值的信息。
我找到了这个页面:http://permalink.gmane.org/gmane.comp.lang.ruby.sequel/2645 一个人似乎有类似的问题,有人回复并询问运行'irb -rubygems -rmysql'是否会出现错误。我这样做了,它给了我一个错误,说错了LIBMYSQL.dll在计算机上。不确定这些信息是否有用,但我想在这里提到它。
任何人都有解决问题的方法吗?或者是我要查看的方向?
非常感谢任何想要帮助的人! 亲切的问候,埃米尔
答案 0 :(得分:0)
重要的部分在这里:
LoadError: 126: Det går inte att hitta den angivna modulen(*Translation: Cannot find the given module*.) - C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so
ruby mysql gem引发了错误,您通过运行该irb命令确认了该错误。您可能需要将LIBMYSQL.dll文件添加到计算机中,就像它说的那样。