加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Windows上的Rails – 安装问题

发布时间:2020-12-16 20:43:06 所属栏目:百科 来源:网络整理
导读:我试图在Windows的盒子上安装ruby,并且有一个问题.当我开始收到错误时,我已经到了这一点,而对于web开发来说,我完全是PHP以外的新功能.帮助赞赏! 编辑我按照这里的指示wamp: http://www.alexbernard.fr/fichiers/blog/Installer-Ruby-On-Rails-sur-un-Wamp-
我试图在Windows的盒子上安装ruby,并且有一个问题.当我开始收到错误时,我已经到了这一点,而对于web开发来说,我完全是PHP以外的新功能.帮助赞赏!

编辑我按照这里的指示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

解决方法

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

>安装Ruby 2.0.0 x64(64位)
>从RubyInstaller页面安装一些DevKit

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

从输出中的错误:

make:x86_64-w64-mingw32-gcc:找不到命令

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

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

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读