我正在尝试将我的应用程序升级到rails 3.1.1。我正在关注railscasts tutorial,所以我首先更新到3.0.9。我在使用will_paginate时遇到了一些问题但是在更新到更新版本后它们已经解决了。现在我的所有测试都在通过,我正在尝试更新到3.1.1
所以我修改了我的Gemfile以使用Rails 3.1.1,但是当我bundle update
时,我得到以下输出(其中包含一些ruby错误,以及关于首先安装开发工具的消息)。
编辑:开始认为这与安装OSX Lion后没有升级xcode有关。可能是那个吗?我现在正在下载它,但它需要一段时间......
MacBoo:myapp oalo$ bundle update
Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Using ZenTest (4.6.2)
Using multi_json (1.0.3)
Using activesupport (3.1.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.1)
Using erubis (2.7.0)
Using rack (1.3.5)
Using rack-cache (1.1)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.3)
Using actionpack (3.1.1)
Using mime-types (1.17.1)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.1)
Using arel (2.2.1)
Using tzinfo (0.3.30)
Using activerecord (3.1.1)
Using activeresource (3.1.1)
Using annotate (2.4.0)
Using autotest (4.4.6)
Installing sys-uname (0.8.6) with native extensions /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/oalo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for sysctl()... *** 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=/Users/oalo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
/Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/sys-uname-0.8.6 for inspection.
Results logged to /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/sys-uname-0.8.6/ext/gem_make.out
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:530:in `block in build_extensions'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `each'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `build_extensions'
from /Users/oalo/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `install'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/cli.rb:270:in `update'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/bin/bundle:19:in `load'
from /Users/oalo/.rvm/gems/ruby-1.9.2-p180/bin/bundle:19:in `<main>'
MacBoo:myapp oalo$
答案 0 :(得分:3)
通常更新rvm会修复“您必须先安装开发工具”错误:
rvm get latest
rvm reload
rvm --force install 1.9.2
你在mkmf.log中有什么?