Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 错误:无法生成gem本机扩展Windows 7 32位_Ruby On Rails_Json_Ruby_Ruby On Rails 4_Devkit - Fatal编程技术网

Ruby on rails 错误:无法生成gem本机扩展Windows 7 32位

Ruby on rails 错误:无法生成gem本机扩展Windows 7 32位,ruby-on-rails,json,ruby,ruby-on-rails-4,devkit,Ruby On Rails,Json,Ruby,Ruby On Rails 4,Devkit,我正在尝试在Windows732系统上安装RubyGem 本地环境详情如下: D:\Environment\DevKit32Ruby200>gem -v 2.0.14 D:\Environment\DevKit32Ruby200>ruby -v ruby 2.0.0p451 (2014-02-24) [i386-mingw32] D:\Environment\DevKit32Ruby200>rails -v Rails 4.0.4 我已经试过了 使用将系统ruby gem

我正在尝试在Windows732系统上安装RubyGem

本地环境详情如下:

D:\Environment\DevKit32Ruby200>gem -v
2.0.14

D:\Environment\DevKit32Ruby200>ruby -v
ruby 2.0.0p451 (2014-02-24) [i386-mingw32]

D:\Environment\DevKit32Ruby200>rails -v
Rails 4.0.4
我已经试过了

  • 使用将系统ruby gems版本降级到2.3.0

    gem update --system 2.3.0
    
  • 我已经完成了devkit的正确设置,并在config.yml文件中手动添加了正确的ruby目录路径

    D:\Environment\DevKit32Ruby200>ruby dk.rb init
    
     Initialization complete! Please review and modify the auto-generated
     'config.yml' file to ensure it contains the root directories to all
     of the installed Rubies you want enhanced by the DevKit.
    
    D:\Environment\DevKit32Ruby200>ruby dk.rb install --force
        [WARN] Updating (with backup) existing gem override for                            'D:/Environment/ruby200new'
       [WARN] Updating (with backup) DevKit helper library for 'D:/Environment/ruby200new'
    
  • 我还尝试过将platform=ruby

    gem install json --platform=ruby --verbose
    
  • 我在安装json时遇到的错误如下

    D:\Environment\DevKit32Ruby200>gem install json
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing json:
            ERROR: Failed to build gem native extension.
    
        D:/Environment/ruby200new/bin/ruby.exe extconf.rb
    creating Makefile
    
    make "DESTDIR="
    generating generator-i386-mingw32.def
    compiling generator.c
    linking shared-object json/ext/generator.so
    
    make "DESTDIR=" install
    /usr/bin/install -c -m 0755 generator.so ./.gem.20170109-8336-qvgvzc/json/ext
    make: execvp: /usr/bin/install: Permission denied
    make: *** [install-so] Error 127
    
    
    Gem files will remain installed in D:/Environment/ruby200new/lib/ruby/gems/2.0.0/gems/json-2.0.2 for inspection.
    Results logged to D:/Environment/ruby200new/lib/ruby/gems/2.0.0/gems/json-2.0.2/ext/json/ext/generator/gem_make.out
    
    在这个问题上,有10个问题已经被标记,但没有一个得到解决。 请帮助我确定缺失的内容以及错误产生的原因。

    尝试以下方法:

    为什么不从下载
    json
    .gem文件,并使用命令直接安装它呢

    gem install json-x.x.x.gem
    

    i386-mingw32
    是一座永远不会得到完全支持的痛苦之山,当我花时间在Windows上时,我曾经使用安装了ubuntu的VirtualBox VM,它与Windows主机共享一个文件夹。我会在windows中使用netbeans编辑文件,并在putty中运行代码,虚拟机基本上是无头的

    事实上,我用这种方式做了很多实际工作。如果你想做一个“Hello World”rails应用程序-OK-祝你好运。像这样的在线开发环境怎么样


    但是,如果你想工作,而不仅仅是玩玩,至少要为自己设置一个Ubuntu虚拟机,或者最好在Ubuntu/MacOS中工作。

    请检查由“ruby dk.rb init”命令生成的“config.yml”文件,并检查已安装的ruby版本和路径。我在config.yml中手动添加了正确的ruby目录路径,其无问题基于日志。问题似乎在ruby路径中,但无论如何,请尝试使用gem install json--platform=rubygot此错误:D:\APPS\LX\u release7\u JanPRD>gem install json--platform=ruby临时增强包含DevKit的路径。。。构建本机扩展。这可能需要一段时间。。。错误:安装json时出错:错误:无法构建gem本机扩展。顺便问一下,您为什么要这样做?必须有一个很好的理由提供奖励,让JSON在MINGW^上编译。我也遇到了这个错误,在多次尝试失败后,我改用Ubuntu。从那以后一切都很顺利。