【发布时间】:2014-08-29 21:45:42
【问题描述】:
我一直在互联网上寻找答案,但没有一个解决方案有帮助。我只看到有关此的过时信息。简而言之,我刚开始尝试自学如何使用 Ruby on Rails,但为了安装 mysql gem,我已经坚持了 6 个小时。这就是我尝试时会发生的情况
C:\Users\user>gem install mysql
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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby200-x64/bin/ruby
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/
--with-libmysqllib
--without-libmysqllib
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql
-2.9.1 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql-2.9.1/ext/mysql_
api/gem_make.out
现在,我尝试使用 opt 重定向路径,并且我遇到了困难但乐观的所有事情。我听说 64x 上的 RoR 很麻烦,但我坚持下去。感谢您的帮助!
【问题讨论】:
-
免去您的头痛。通过虚拟机在 Linux 上进行开发。当您将应用程序部署到肯定是 Linux 而不是 OS X 或 Windows 的服务器时,这也是必不可少的体验。
-
这实际上可能是最好的选择。因为我认为我浪费了一天的时间来试图让这件事运行起来。
-
不,不需要在Linux上开发。我们使用 Windows,虽然它可能很困难,但它和 Linux 一样灵活
-
没有人说你需要在 Linux 上开发,但你在 Windows 上开发 Rails 是少数,因此很难找到支持。不仅如此,熟悉 Linux 对部署至关重要,那么为什么不让自己先行一步呢?
标签: mysql ruby-on-rails ruby