所以我正在使用Bitnami来学习Ruby on Rails。我之前也尝试过ruby和rails的手动安装,并遇到了同样的问题,所以我想我应该先尝试Bitnami的简易包装。无论如何,我对json的问题是它导致bundle安装失败。
首先,由于ssl错误,rails new的自动捆绑安装失败。通过将gemfile中的源更改为http,可以轻松解决这个问题。 但是,当我尝试捆绑安装时,它在尝试安装json时会发生另一个错误。
C:\RubyStack-3.2.7-0\projects\testing>bundle install
Fetching gem metadata from http://rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Installing activesupport (3.2.8)
Using builder (3.0.0)
Installing activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Installing actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Installing actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Installing activerecord (3.2.8)
Installing activeresource (3.2.8)
Using bundler (1.1.5)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Installing json (1.7.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/RUBYST~1.7-0/ruby/bin/ruby.exe extconf.rb
creating Makefile
make
0 [main] echo 5244 open_stackdumpfile: Dumping stack trace to echo.exe.sta
ckdump
make: *** [generator-i386-mingw32.def] Error 5
Gem files will remain installed in C:/RUBYST~1.7-0/ruby/lib/ruby/gems/1.9.1/gems
/json-1.7.5 for inspection.
Results logged to C:/RUBYST~1.7-0/ruby/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/j
son/ext/generator/gem_make.out
An error occured while installing json (1.7.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.5'` succeeds before bundling.
这是在尝试安装json后生成的gem_make.out文件(btw windows也会产生一个错误,即echo.exe在运行gem install json时停止工作)
C:/RUBYST~1.7-0/ruby/bin/ruby.exe extconf.rb
creating Makefile
make
0 [main] echo 5244 open_stackdumpfile: Dumping stack trace to echo.exe.stackdump
make: *** [generator-i386-mingw32.def] Error 5
我甚至无法开始学习ror因为设置已经是一个巨大的痛苦。 (顺便说一句,我没有Web框架的经验,只有桌面编程)。帮助
答案 0 :(得分:0)
您是否考虑过放弃bitnami,重新开始,并通过Michael Hartl的http://ruby.railstutorial.org/ruby-on-rails-tutorial-book? 它会让你从头开始设置,价格合适(免费)。
答案 1 :(得分:0)
构建原生扩展。这可能需要一段时间。 `错误:安装json时出错: 错误:无法构建gem原生扩展。
/Users/bruceyue001/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb`
创建makefile
make
compiling generator.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [generator.o] Error 1
Gem文件将保留在/Users/bruceyue001/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5
中以供检查。
结果记录到/Users/bruceyue001/.rvm/gems/ruby-1.9.3-p194/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
答案 2 :(得分:0)
在Windows上运行rails需要安装DevKit。
安装DevKit,它应该解决您的问题: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit