0

我正在學習本教程:http://ruby.railstutorial.org/chapters/static-pages#top ...您可以[ctrl + f]至Listing 3.1. A Gemfile for the sample app來查找我的位置。Ruby on Rails教程,第3章Gemfile錯誤

我只是複製並粘貼gemfile,因爲它是在那裏給出的(它沒有工作,所以我繼續嘗試從10.42開始,因爲它是立即連接到[ctrl + f]點之上的,因爲我會必須在某些時候使用它。)

對於10.42列表,它給了我一個錯誤,Could not find gem 'will_paginate (= 3.0.pre2) ruby' in the gems available on this machine

  • Rails是3.0.11版本
  • 紅寶石版本:1.8.7(2012-02-08 PATCHLEVEL 358)[I386-的cygwin]

下面是一個複製粘貼從顯示錯誤的終端。該格式是可怕的在這裏,所以我也把它設在這裏一個谷歌文檔頁面上:https://docs.google.com/document/d/1SJsfIOtKKR2Rb228kgfpTdpYhGsWLCwfkORXJA1qYBs/edit


[email protected]_Terminal /home/brian/sample_app $ rails generate rspec:install Could not find gem 'will_paginate (= 3.0.pre2) ruby' in the gems available on th is machine. Run bundle install to install missing gems.

[email protected]_Terminal /home/brian/sample_app $ bundle install Fetching gem metadata from rubygems.org/....... Using rake (0.9.2.2) Using abstract (1.0.0) Using activesupport (3.0.11) Using builder (2.1.2) Using i18n (0.5.0) Using activemodel (3.0.11) Using erubis (2.6.6) Using rack (1.2.5) Using rack-mount (0.6.14) Using rack-test (0.5.7) Using tzinfo (0.3.32) Using actionpack (3.0.11) Using mime-types (1.17.2) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.2.19) Using actionmailer (3.0.11) Using arel (2.0.10) Using activerecord (3.0.11) Using activeresource (3.0.11) Using annotate (2.4.0) Using bundler (1.1.0) Using diff-lcs (1.1.3) Using factory_girl (1.3.3) Using json (1.6.5) Using rdoc (3.12) Using thor (0.14.6) Using railties (3.0.11) Using rails (3.0.11) Using factory_girl_rails (1.0) Using faker (0.3.1) Using gravatar_image_tag (1.0.0.pre2) Installing nokogiri (1.5.2) with native extensions 3 [main] ruby 7644 child_info_fork::abort: address space needed by 'etc.so' (0x110000) is already occupied 3 [main] ruby 6352 child_info_fork::abort: address space needed by 'etc.so' (0x110000) is already occupied 3 [main] ruby 1524 child_info_fork::abort: address space needed by 'etc.so' (0x110000) is already occupied Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby.exe extconf.rb 17 [main] ruby 7892 child_info_fork::abort: address space needed by 'etc.so' (0x2E0000) is already occupied 5 [main] ruby 7128 child_info_fork::abort: address space needed by 'etc.so' (0x2E0000) is already occupied 4 [main] ruby 7568 child_info_fork::abort: address space needed by 'etc.so' (0x2E0000) is already occupied 4 [main] ruby 3196 child_info_fork::abort: address space needed by 'etc.so' (0x2E0000) is already occupied 26 [main] ruby 2260 child_info_fork::abort: address space needed by 'etc.so' (0x2E0000) is already occupied 4 [main] ruby 6852 child_info_fork::abort: address space needed by 'etc.so' (0x2E0000) is already occupied checking for libxml/parser.h... no libxml2 is missing. please visit nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.

* extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/lib --with-xml2-dir --without-xml2-dir --with-xml2-include --without-xml2-include=${xml2-dir}/include --with-xml2-lib --without-xml2-lib=${xml2-dir}/lib --with-xslt-dir --without-xslt-dir --with-xslt-include --without-xslt-include=${xslt-dir}/include --with-xslt-lib --without-xslt-lib=${xslt-dir}/lib

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/nokogiri-1.5.2 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in each' from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:inbuild_extensions' from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/source.rb:90:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:82:in preserve_paths' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/source.rb:89:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:73:in install_gem_from_spec' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/rubygems_integration.rb:97:inwith_build_args' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:72:in install_gem_from_spec' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:56:inrun' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:55:in run' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/installer.rb:12:ininstall' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/cli.rb:220:in install' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:insend' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/task.rb:22:in run' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/invocation.rb:118:ininvoke_task' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor.rb:263:in dispatch' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler/vendor/thor/base.rb:386:instart' from /usr/lib/ruby/gems/1.8/gems/bundler-1.1.0/bin/bundle:13 from /usr/bin/bundle:19:in `load' from /usr/bin/bundle:19

+0

在windows上開發ruby-on-rails應用程序可能很痛苦,請考慮使用mac或linux。如果你不想直接安裝linux,我可以建議在虛擬機上安裝它。這將大大加快你的學習過程。 – Valentin 2012-03-11 18:17:52

回答

0

寶石原生擴展(C代碼)在Windows上安裝時,他們往往需要ruby devkit除了MinGW的。

RubyInstaller開發工具包(DevKit)是基於MSYS/MinGW的工具包,它使您能夠構建許多可用於Ruby的本機C/C++擴展。

相關問題