gpt4 book ai didi

ruby-on-rails - 找不到指定的模块(MySQL)

转载 作者:太空宇宙 更新时间:2023-11-03 18:28:38 24 4
gpt4 key购买 nike

在 Windows 上出现以下错误该怎么办:

C:\work\exchange2>gem list

*** LOCAL GEMS ***

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
mysql (2.8.1 x86-mingw32)
rack (1.1.2)
rails (2.3.11)
rake (0.9.2)


C:\work\exchange2>rake db:migrate
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install
the mysql gem and try again: gem install mysql.
rake aborted!
126: The specified module could not be found. - C:/Ruby187/lib/ruby/gems/1.8/g
ems/mysql-2.8.1-x86-mingw32/lib/1.8/mysql_api.so

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

更新 2:我使用的是 Mysql 服务器 5.5,我在/lib 目录中找到了 Libmql 文件,所以我将该文件粘贴到 ruby​​/bin 以及 ruby​​/lib 中。在 cmd 上我得到了同样的上述错误。

UPDATE1:再次运行时,我得到:

C:\work\exchange2>gem install mysql Successfully installed mysql-2.8.1-x86-mingw32 1 gem installed Installing ri documentation for mysql-2.8.1-x86-mingw32...

No definition for next_result

No definition for field_name

No definition for field_table

No definition for field_def

No definition for field_type

No definition for field_length

No definition for field_max_length

No definition for field_flags

No definition for field_decimals

No definition for time_inspect

No definition for time_to_s

No definition for time_get_year

No definition for time_get_month

No definition for time_get_day

No definition for time_get_hour

No definition for time_get_minute

No definition for time_get_second

No definition for time_get_neg

No definition for time_get_second_part

No definition for time_set_year

No definition for time_set_month

No definition for time_set_day

No definition for time_set_hour

No definition for time_set_minute

No definition for time_set_second

No definition for time_set_neg

No definition for time_set_second_part

No definition for time_equal

No definition for error_errno

No definition for error_sqlstate Installing RDoc documentation for mysql-2.8.1-x86-mingw32...

No definition for next_result

No definition for field_name

No definition for field_table

No definition for field_def

No definition for field_type

No definition for field_length

No definition for field_max_length

No definition for field_flags

No definition for field_decimals

No definition for time_inspect

No definition for time_to_s

No definition for time_get_year

No definition for time_get_month

No definition for time_get_day

No definition for time_get_hour

No definition for time_get_minute

No definition for time_get_second

No definition for time_get_neg

No definition for time_get_second_part

No definition for time_set_year

No definition for time_set_month

No definition for time_set_day

No definition for time_set_hour

No definition for time_set_minute

No definition for time_set_second

No definition for time_set_neg

No definition for time_set_second_part

No definition for time_equal

No definition for error_errno

No definition for error_sqlstate

最佳答案

您应该尝试运行 gem install mysql,这应该会清除与此相关的错误消息:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install
the mysql gem and try again: gem install mysql.
rake aborted!
126: The specified module could not be found. - C:/Ruby187/lib/ruby/gems/1.8/g
ems/mysql-2.8.1-x86-mingw32/lib/1.8/mysql_api.so

关于 rdoc 的错误有点难以诊断,但我认为它涉及到你的 Rakefile 中的几行,如果你看到一些类似于以下的行:

require 'rake/rdoctask'
Rake::RDocTask.new(:rdoc) do |rdoc|

尝试将它们更改为如下所示:

require 'rdoc/task'
RDoc::Task.new do |rdoc|

关于ruby-on-rails - 找不到指定的模块(MySQL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7232571/

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