简体   繁体   English

Mysql2,RoR和Windows 8 x64的问题

[英]Issue with Mysql2, RoR, and Windows 8 x64

Okay so I've been having a heck of a time getting my IDE environment setup for Ruby and RoR. 好的,我花了很长时间来为Ruby和RoR设置我的IDE环境。 Every issue so far I've been able to solve except one so I humbly ask the mighty stackoverflow for guidance. 到目前为止,我已经能够解决所有问题,因此我谦虚地向强大的stackoverflow寻求指导。

MY RubyMine install is having trouble recognizing some installed gems or more specifically, SQLite3, Mysql, and Mysql2. 我的RubyMine安装无法识别某些已安装的gem,或更具体地说,SQLite3,Mysql和Mysql2。 Using Gem quick install on RubyMine fails on all three, however, installing the gems with the proper config is successful in cmd. 在RubyMine上使用Gem快速安装在所有这三个方法上均失败,但是,在cmd中成功安装具有正确配置的gems即可。 While that is successful, RubyMine cannot or will not recognize the installed gems. 成功完成后,RubyMine无法或不会识别已安装的gem。 The 'require mysql2' (with 'require rubygems' placed before it) fails right out of the gate with RubyMine stating that it cannot load such a file. “ require mysql2”(在其前面放置了“ require ruby​​gems”)失败,RubyMine指出无法加载此类文件。 When accessing the RoR server on localhost through firefox, I get an error stating that the gem is not loaded and I should add it to my Gemfile ( I should state at this point that all the above gems were already in the gemfile and if not I added them and ran bundle install) which is confusing. 通过firefox访问localhost上的RoR服务器时,出现错误,指出未加载gem,我应将其添加到我的Gemfile中(此时,我应该声明上述所有gems已经在gemfile中,如果没有,添加了它们并运行了bundle install),这很令人困惑。 I've spent days scouring the interwebs and stackoverflow for a solution but nothing seems to work. 我花了几天的时间寻找互连网和stackoverflow的解决方案,但似乎没有任何效果。 I even tried going from the 64 version of ruby 2 to the 32 bit version and some previous versions. 我什至尝试从ruby 2的64版本升级到32位版本以及某些以前的版本。

on a side note, would it be easier to code ruby in a linux distro? 附带说明一下,在Linux发行版中编写ruby会更容易吗? (like Ubuntu) (例如Ubuntu)

Currently I am using RubyMine 5.4 IDE on Windows 8x64 within a custom rig. 目前,我在自定义绑定中的Windows 8x64上使用RubyMine 5.4 IDE。 I have three Ruby SDK's to use: 2.0x64PO, 2.0PO, and 1.9.3 and have the most current version of Rails installed. 我有三个Ruby SDK可以使用:2.0x64PO,2.0PO和1.9.3,并且安装了最新版本的Rails。 Rubygems is installed along with the most recent versions of SQLite3, mysql, and Mysql2 installed correctly with manual install. Rubygems随正确安装的SQLite3,mysql和Mysql2的最新版本一起安装。

below is a copy of the error I get within rubymine when trying to run. 以下是我尝试运行时在rubymine中遇到的错误的副本。

runnerw.exe C:\Ruby200\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Users/RocYourSockx/RubymineProjects/testerrails/bin/rails server -b 127.0.0.1 -p 3000 -e development
C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.0/mysql2 (LoadError)
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from C:/Users/RocYourSockx/RubymineProjects/testerrailsnigga/config/application.rb:7:in `<top (required)>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `block in <top (required)>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>'
    from C:/Users/RocYourSockx/RubymineProjects/testerrailsnigga/bin/rails:4:in `require'
    from C:/Users/RocYourSockx/RubymineProjects/testerrailsnigga/bin/rails:4:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Process finished with exit code 1

To answer your side note, ruby + windows is a painful, painful process imo. 为了回答您的旁注,ruby + windows是一个痛苦,痛苦的过程imo。 You would likely be better off installing VirtualBox and a modern Ubuntu virtual machine. 安装VirtualBox和现代的Ubuntu虚拟机可能会更好。 It can be troublesome to get gems working under windows. 使宝石在Windows下工作可能很麻烦。

I use OSX at work, and am currently setting up an Ubuntu image from here : http://virtualboxes.org/images/ubuntu/ on my home laptop simply because I am sick and tired of trying to be productive on windows 7. 我在工作中使用OSX,目前正在我的家用笔记本电脑上从此处设置Ubuntu映像: http : //virtualboxes.org/images/ubuntu/ ,仅仅是因为我厌倦了尝试在Windows 7上高效工作。

Download a connector from here: http://dev.mysql.com/downloads/connector/c/6.0.html#downloads ZIP Archive and not installer, from its lib folder copy the libmysql.dll file and paste it into the Ruby200/bin directory. 从此处下载连接器: http : //dev.mysql.com/downloads/connector/c/6.0.html#downloads ZIP归档文件(而非安装程序),从其lib文件夹中复制libmysql.dll文件并将其粘贴到Ruby200 /中bin目录。 I think that should fix it. 我认为应该修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows 7 x64上安装mysql2错误无法正常工作 - Error installing mysql2 with windows 7 x64 does not work Windows 7 x64中Rails的MySQL驱动程序 - MySQL driver for Rails in Windows 7 x64 在使用MySQL 5.6的CentOS 6.4 x64上mysql2 gem安装失败 - mysql2 gem installation failes on CentOS 6.4 x64 with MySQL 5.6 找不到Qt 5.4 Windows msvc x64 mysql驱动程序 - Qt 5.4 windows msvc x64 mysql driver not found MySQL 5.6.26(Windows 8.1 x64):设置MySQL根用户密码的麻烦 - MySQL 5.6.26 (Windows 8.1 x64): Trouble with setting a password for the root MySQL user x64 PHP / MYSQL构建是否支持64位Windows Server上的完整64位时间戳 - Will a x64 PHP/MYSQL build support full 64bit timestamps on a 64bit Windows Server 在虚拟化的Windows 2003 x64服​​务器上使用ASP连接到MySQL数据库 - Connecting to MySQL database with ASP on a virtualized Windows 2003 x64 server 如何在Windows x64机器上使用VS 2010构建MySQL连接器c ++? - How to build MySQL connector c++ with VS 2010 on a Windows x64 machine? Windows 10 x64的MySQL MSI安装,更改安装文件夹? - Mysql msi installation for windows 10 x64, change installation folder? Python:如何在Windows 7 x64上安装mysqldb? - Python: How to install mysqldb on windows 7 x64?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM