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

问题描述

我使用 http://railsinstaller.org 上的 Windows 安装程序安装了 Ruby on Rails.安装没有任何错误.但是,当我尝试:

I installed Ruby on Rails using the Windows installer at http://railsinstaller.org. The installation went without any errors. However, when I tried:

rails new blog

我收到以下错误:

使用本机扩展安装 json (1.6.5)Gem::Installer::ExtensionBuildError: 错误:无法构建 gem 本机扩展.C:/opt/Ruby_on_Rails/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb安装json(1.6.5)时出现错误,Bundler无法继续.打包前确保 gem install json -v '1.6.5' 成功.

Installing json (1.6.5) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. C:/opt/Ruby_on_Rails/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb An error occured while installing json (1.6.5), and Bundler cannot continue. Make sure that gem install json -v '1.6.5' succeeds before bundling.

按照上面的建议,我跑了:

Following the above suggestion, I ran:

gem install json -v '1.6.5'

这一次,我收到了以下错误:暂时增强 PATH 以包含 DevKit...构建原生扩展.这可能需要一段时间...错误:安装 json 时出错:错误:无法构建 gem 本机扩展.

This time, I got the following error: 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:/opt/Ruby_on_Rails/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb

有人可以建议我如何解决这个错误吗?谢谢.

Would someone please advise on how I may be able to fix this error? Thank you.

推荐答案

您需要下载 devkit 并将其解压缩到您的 Ruby 文件的 bin 路径(例如:C:\Ruby200\bin).然后从命令提示符转到该目录并键入 ruby dk.rb initruby dk.rb install.然后通过 gem install rails 安装导轨.之后检查宝石列表.然后你也可以看到json gem.

You need to download the devkit and extract it to the bin path of your Ruby File (Eg: C:\Ruby200\bin). And then go to that directory from command prompt and type ruby dk.rb init and ruby dk.rb install. After that install the rails by gem install rails. After that check the gem list. Then you can see the json gem also.

这篇关于Ruby on Rails:如何在 Windows 7 上安装 json?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 14:31