捆绑更新独角兽错误

时间:2013-11-10 20:16:16

标签: ruby-on-rails ruby-on-rails-4

Rails 4.0.1可用并尝试更新到该版本(目前在4.0版本上)

我正在运行bundle update并且它开始工作正常,但后来得到一个似乎是关于Unicorn的错误,所以整个事情都被中止了。错误如下:

Installing unicorn (4.7.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/myname/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb
checking for SIZEOF_OFF_T in ruby.h... *** 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/myname/.rbenv/versions/2.0.0-p247/bin/ruby
/Users/myname/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.

我知道如何解决这个问题吗?

创业板文件

source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.0.0'
gem 'pg'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'jquery-ui-rails'
gem 'jbuilder', '~> 1.2'
group :doc do
  gem 'sdoc', require: false
end
gem 'bcrypt-ruby', '~> 3.0.1'
gem "figaro"
gem 'unicorn'
group :production do
  gem 'rails_12factor'
end
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
gem 'memcachier'
gem 'dalli'
gem 'devise'

3 个答案:

答案 0 :(得分:0)

尝试运行

brew update  

我对unicorn并不熟悉,但是当你升级到新的操作系统时,有时可能需要宝石和插件才能正常工作。

答案 1 :(得分:0)

我有一些想法。

  1. 将您的gem文件更改为以下内容:

    gem "unicorn", "~> 4.7.0"
    
  2. 我不经常使用ruby gems网站。我通常只看github,但根据网站的说法,有一些你没有的依赖。

  3. RubyGems screenshot

答案 2 :(得分:0)

最近升级到Mavericks OS(以及新版本的XCode)我需要同意Xcode条款&捆绑更新前的条件可行。

无论如何 - 现在都在工作。