gpt4 book ai didi

mysql - mongify 检查database.config 的问题

转载 作者:行者123 更新时间:2023-11-29 18:46:51 28 4
gpt4 key购买 nike

我正在运行命令:mongify check database.config

但我收到此错误:

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec': Specified 'mysql' for database adapter, but the gem
is not loaded. Add `gem 'mysql'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:50:in `establish_connection'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.1/lib/mongify/database/sql_connection.rb:40:in `setup_connection_adapter'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.1/lib/mongify/database/sql_connection.rb:56:in `has_connection?'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.1/lib/mongify/cli/command/worker.rb:99:in `check_sql_connection'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.1/lib/mongify/cli/command/worker.rb:68:in `execute'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.1/lib/mongify/cli/application.rb:28:in `execute!'
from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mongify-1.3.1/bin/mongify:15:in `<top (required)>'
from C:/Ruby24-x64/bin/mongify:22:in `load'
from C:/Ruby24-x64/bin/mongify:22:in `<main>'

运行命令时: gem 列表

C:\Ruby24-x64\bin> gem 列表

*** LOCAL GEMS ***

activemodel (4.2.8)
activerecord (4.2.8)
activesupport (4.2.8)
arel (6.0.4)
bigdecimal (default: 1.3.0)
bson (1.12.5)
bson_ext (1.12.5)
builder (3.2.3)
did_you_mean (1.1.0)
highline (1.7.8)
i18n (0.8.4)
io-console (default: 0.4.6)
json (default: 2.0.2)
minitest (5.10.1)
mongify (1.3.1)
mongo (1.12.5)
mysql2 (0.4.6 x64-mingw32)
net-telnet (0.1.1)
openssl (default: 2.0.3)
power_assert (0.4.1)
psych (default: 2.2.2)
rake (12.0.0)
rdoc (default: 5.0.0)
test-unit (3.2.3)
thread_safe (0.3.6)
tzinfo (1.2.3)
xmlrpc (0.2.1)

当我运行gem install mysql时,它以状态1退出,并要求检查mkmf.log以获取原因,其中写道:

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby24-x64/include/ruby-2.4.0/x64-mingw32 -IC:/Ruby24-x64/include/ruby-2.4.0/ruby/backward -IC:/Ruby24-x64/include/ruby-2.4.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -IC:/msys64/mingw64/lib/libffi-3.2.1/include -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -march=x86-64 -mtune=generic -O2 -pipe -IC:/msys64/mingw64/lib/libffi-3.2.1/include conftest.c  -L. -LC:/Ruby24-x64/lib -L. -pipe     -lx64-msvcrt-ruby240 -llibmysql  -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
C:/msys64/MINGW64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibmysql
collect2.exe: error: ld returned 1 exit status

我无法安装 mysql 的 gem。

规范:

我使用的是 Windows 操作系统,安装了 xampp sql 并也指向了环境变量。请帮帮我。我也没有从 google for windows 获得任何此类帮助。

最佳答案

我遇到了同样的问题,并使用 mysql2 解决了它:

gem install mysql2

关于mysql - mongify 检查database.config 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44560735/

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