使用Ruby2 x64安装gem

时间:2013-08-30 12:45:58

标签: ruby-on-rails ruby windows gem

我正在尝试安装rails,但在我需要正确安装devkit之前 所以我正在做正常的程序,但我不明白什么是错的。我正在使用ruby 2 x64,我尝试使用DevKit x32和x64。这是与devkit x64。这里有什么不对......?谢谢。

c:\DevKit>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.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
creating Makefile

make
generating generator-x64-mingw32.def
compiling generator.c
linking shared-object json/ext/generator.so

make install
/usr/bin/install -c -m 0755 generator.so C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems
/json-1.8.0/lib/C/Ruby200-x64/lib/ruby/site_ruby/2.0.0/x64-msvcrt/json/ext
/usr/bin/install: cannot create regular file `C:/Ruby200-x64/lib/ruby/gems/2.0.0
/gems/json-1.8.0/lib/C/Ruby200-x64/lib/ruby/site_ruby/2.0.0/x64-msvcrt/json/ext'
: No such file or directory
make: *** [install-so] Error 1


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/json-
1.8.0 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/json-1.8.0/ext/json/ex
t/generator/gem_make.out

注意:在x32和x64两种情况下安装“ruby dk.rb install -f”之前。

编辑:对于谁试图回复关于ruby dk.rb等程序,我已多次这样做了:

c:\ DevKit> ruby​​ dk.rb init
初始化完成!请查看并修改自动生成的内容 'config.yml'文件,以确保它包含所有的根目录 您想要通过DevKit增强安装的Rubies。

c:\ DevKit> ruby​​ dk.rb review
根据生成的'config.yml'文件中的设置 从运行'ruby dk.rb init'和任何自定义项, DevKit功能将注入以下Rubies 当你运行'ruby dk.rb install'时。

C:/ Ruby200-64

c:\ DevKit> ruby​​ dk.rb install -f
[WARN]更新(使用备份)'C:/ Ruby200-x64'的现有gem覆盖 [WARN]更新(使用备份)'C:/ Ruby200-x64'的DevKit帮助程序库

1 个答案:

答案 0 :(得分:0)

我还安装了java,jdk

的windows

我试过

 ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

C:\Users\rajarshid>gem install json --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.8.0
Parsing documentation for json-1.8.0
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
Installing ri documentation for json-1.8.0
Done installing documentation for json (2 sec).
1 gem installed

请检查开发工具包是否正确安装

ruby dk.rb review

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit