Windows 上的 Rails - 安装问题 [英] Rails on windows - install issue

查看:37
本文介绍了Windows 上的 Rails - 安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Windows 机器上安装 ruby​​,但遇到了问题.当我开始出现错误时,我已经到了这一点,而且我对 PHP 以外的任何 Web 开发都是全新的.感谢帮助!

I'm trying to install ruby on a Windows box and am having an issue. I have gotten up to this point when I start getting errors, and I'm completely new to anything other than PHP for web development. Help appreciated!

编辑我正在按照 wamp 的说明进行操作:

EDIT I'm following the instructions here for wamp:

http://www.alexbernard.fr/fichiers/blog/Installer-Ruby-On-Rails-sur-un-Wamp-Server.pdf

./gem install rails --include-dependencies

输出:

INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.
        C:/wamp/ruby/bin/ruby.exe extconf.rb
creating Makefile
make
generating generator-x64-mingw32.def
compiling generator.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [generator.o] Error 127
Gem files will remain installed in C:/wamp/ruby/lib/ruby/gems/2.0.0/gems/json-1.8.0 for inspection.
Results logged to C:/wamp/ruby/lib/ruby/gems/2.0.0/gems/json-1.8.0/ext/json/ext/generator/gem_make.out

推荐答案

从上面显示的输出中,我假设如下:

From the output shown above, I assume the following:

  • 已安装 Ruby 2.0.0 x64(64 位)
  • 从 RubyInstaller 页面安装了一些 DevKit
  • Installed Ruby 2.0.0 x64 (64bits)
  • Installed some DevKit from RubyInstaller page

现在,正如此处所述,对于 64 位 Ruby,您需要 64 位 DevKit.

Now, as explained here, for 64bits Ruby you need 64bits DevKit.

来自输出中的错误:

<代码>制作:x86_64-w64-mingw32-gcc:找不到命令

很明显您没有安装正确的 DevKit.

It is clear you didn't install the right DevKit.

请删除已安装的 DevKit,下载正确的 DevKit(如上面的链接和 RubyInstaller 下载页面中所示)>) 并重新安装.

Please remove the DevKit installed, download the correct one (as indicated in the link above and in RubyInstaller downloads page) and install again.

您将需要使用 ruby dk.rb install --force(注意 --force 选项)来覆盖之前的 DevKit 安装.

You will require to use ruby dk.rb install --force (note the --force option) to override the previous DevKit installation.

至于弃用错误,不再需要--include-dependencies.我建议您使用现代 Ruby/Rails 指南作为安装参考.

As for the the deprecation error, --include-dependencies is no longer required. I recommend you use as installation reference a modern Ruby/Rails guide.

这篇关于Windows 上的 Rails - 安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆