1

Heroku 建议更新到这个 gem,因为有一个安全补丁,但它给我带来了各种各样的头痛,现在我的本地环境无法正常工作。他们建议这样做作为安全预防措施。他们建议进入我的应用程序,更改 gemfile 版本并简单地运行“bundle update rails”。这是输出:

$ bundle update rails
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.20)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.20)
Using erubis (2.6.6)
Using rack (1.2.8)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.37)
Using actionpack (3.0.20)
Using mime-types (1.21)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.2.19)
Using actionmailer (3.0.20)
Using arel (2.0.10)
Using activerecord (3.0.20)
Using activeresource (3.0.20)
Using bundler (1.0.22)
Installing json (1.7.7) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
c:/Ruby192/bin/ruby.exe extconf.rb

creating Makefile 
make
'make' is not recognized as an internal or external command,
operable program or batch file. 

Gem files will remain installed in c:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.7 for inspection.

Results logged to c:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.7.7), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.7'` succeeds before bundling

然后他们指出这里有人遇到类似问题的线程。它涉及下载 Devkit 等。我尝试按照说明进行操作,但现在一切都坏了。我熟悉使用 Ruby on Rails,但从未安装它(已经在我的工作计算机上设置),当 ruby​​ on Rails 背后的整个理念很简单时,我很难相信更新它是如此困难。我必须遗漏一些东西或没有使用正确的资源。

我机器上当前的 ruby​​ 版本是 ruby​​ 1.9.2p0 (2010-08-18) [i386-mingw32]

$rails --version
Rails 3.0.3

我下载的 DevKit 是来自http://rubyinstaller.org/downloads的 DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

然后我尝试在此站点https://github.com/oneclick/rubyinstaller/wiki/Development-Kit上完成安装步骤

它总是回到“make”错误或“json”错误。

也许我有不同的版本冲突?

现在,当我尝试启动 WEBrick 来运行我的应用程序时,出现以下错误:

$ rails s
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/rubygems_integrat
ion.rb:183:in `stub_source_index170': uninitialized constant Gem::SourceIndex (N
ameError)
    from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/ruby
gems_integration.rb:303:in `stub_rubygems'
    from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/ruby
gems_integration.rb:246:in `replace_entrypoints'
    from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runt
ime.rb:14:in `setup'
    from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:1
10:in `setup'
    from c:/rails/thumb/costrecovery/config/boot.rb:8:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from script/rails:5:in `<main>'

任何意见是极大的赞赏。

4

0 回答 0