gpt4 book ai didi

mysql - Windows 上的全新 Ruby on Rails 安装 : MSQL Gem Not Working

转载 作者:行者123 更新时间:2023-11-29 22:20:44 24 4
gpt4 key购买 nike

我需要在 Windows 上安装 Ruby 才能访问我将要处理的项目。我按照说明here进行操作安装它但是当我开始编写脚手架时(12:50),我收到以下错误。

注意:我按照视频中提到的说明进行操作。唯一的区别是,我没有在计算机中安装专用 MySQL,而是使用 XAMPP 安装中的 MySQL。

C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2.rb:31:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2.rb:31:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in `each'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in `block in require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in `each'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler.rb:134:in `require'
from C:/row/dev/hello_world/config/application.rb:7:in `<top (required)>'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:141:in `require'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:128:in `generate_or_destroy'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:50:in `generate'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/row/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

关于如何诊断此问题有什么建议吗?

最佳答案

按照以下步骤操作,

或者你可以使用这个收缩器,

gem install mysql2 --platform=ruby -- --with-opt-dir="C:\connector-6.0.2"

请告诉我这是否能解决您的问题。

关于mysql - Windows 上的全新 Ruby on Rails 安装 : MSQL Gem Not Working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30747849/

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