Ruby On Rails,MySQL windows 8.1 64位MySQL gem令人沮丧



事实上,在过去的两天里,我已经重新安装了windows 8三次,并用Ubuntu创建了一个双启动,这个问题是多么令人沮丧。(决定学习一个全新的操作系统比试图解决windows问题更烦人)

所以,一般来说,我对编码是新手,但我一直在摆弄ruby和rails,并决定尝试让数据库的东西正常工作,每次我遇到同样的问题时,这似乎是某种windows 64位MySQL ruby版本的混乱
我使用的是windows 6.1 64和ruby 2.0.0p353(2013-11-22)[x64-ming32]rails 4.0.2和MySQL 5.6

I've installed the devkit and did the test using  ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect" and it returned 42 and that whole installation seemed to go fine.

rails安装了ruby安装,所有-v都显示了我列出的版本。

现在,当我去安装MySQL gem时,它会给我这个。

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -llibmysql... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
I read up and tried doing this after installing the MySQL c connector.  And it returns as follows.
C:Usersryan>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:/mysql-
connector-c-6.1.3-win32/"'
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-mysql-dir="C:/mysql-connector-c-6.1.3-w
in32/"'
This could take a while...
ERROR:  Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir="C:/mysql-connector-
c-6.1.3-win32/"
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Cannot find include dir at C:/mysql-connector-c-6.1.3-win32//include
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

I have devoted days to this problem, and reinstalled more things than I care to admit.  Does anyone have any ideas how I could possibly fix this... ?

好吧,这就是它现在吐出来的东西。。

C: \Users\ryan>gem安装mysql--platform=ruby----with mysql dir=C:\mysql-con连接器c-6.1.3-in32暂时增强PATH以包含DevKit。。。使用以下命令构建本机扩展:'-使用mysql-dir=c:\mysql-connector-c6.1.3-win32'这可能需要一段时间。。。错误:安装mysql时出错:错误:无法构建gem本机扩展。

C:/Ruby200-x64/bin/ruby.exe extconf.rb --with-mysql-dir=c:mysql-connector-c

-6.1.3英寸32正在检查-llibmysql中的main()。。。不*extconf.rb失败*由于某些原因无法创建Makefile,可能是缺少必要的库和/或标头。有关详细信息,请查看mkmf.log文件。你可以需要配置选项。

提供的配置选项:--带opt-dir--不带opt-dir--带有opt-include--不带opt-include=${opt-dir}/include--使用opt-lib--不带opt-lib=${opt-dir}/lib--使用make prog--没有make prog--srcdir=。--curdir--ruby=C:/Ruby200-x64/bin/ruby--使用mysql-dir--与mysql包括--没有mysql-include=${mysql-dir}/include--使用mysql-lib--没有mysql-lib=${mysql-dir}/--使用libmysqllib--没有libmysqllib

Gem文件将保持安装在C:\Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql中-2.9.1检查。结果记录到C:\Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

放弃了,在第二个硬盘上安装了windows7 32位,并将其用于rails。

我在youtube上随机找到了一段很棒的视频,但效果很好。

https://www.youtube.com/watch?feature=player_embedded&v=-eFwV8lRu1w

我差点就要放弃了!看起来很多rails问题都是围绕64位窗口来解决的,但8.1并没有任何帮助。

说放弃几乎是一个愚蠢的答案,我相信现在有可能让最新版本的rails和ruby在windows 8.1 64上运行,但我认为,经过所需的努力,新人实际上更容易安装32位版本的windows,最好是早期版本的windows。

我也遇到过同样的问题。你可以在这里找到解决方案。http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

在博客中,mysql-connector-c-noinstall-6.0.2-win32的路径无效

gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32

因此,为此,您必须检查您的文件夹结构中的mysql连接器,然后使用它。

感谢

最新更新