OSX - 通过bundler安装sqlite3 gem错误

时间:2014-05-24 22:19:01

标签: ruby-on-rails ruby macos sqlite

我正在使用Mac OSX - 版本10.8.5。,Xcode - 版本5.1.1和Ruby - 版本2.1.1p76,我正在尝试升级到Rails 4,但我遇到了sqlite3 gem问题,当我运行捆绑安装。

这是我的宝石文件

source 'https://rubygems.org'

gem 'rails', '4.0.0'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3', '~> 1.3.9'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 4.0.0'
  gem 'coffee-rails', '~> 4.0.0'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.3.0'
end

gem 'jquery-rails'

当我运行"捆绑安装":

时会发生这种情况
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.9
Using minitest 4.7.5
Using multi_json 1.10.1
Using thread_safe 0.3.3
Using tzinfo 0.3.39
Installing activesupport 4.0.0
Installing builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.2
Using rack-test 0.6.2
Installing actionpack 4.0.0
Using mime-types 1.25.1
Using polyglot 0.3.4
Using treetop 1.4.15
Using mail 2.5.4
Installing actionmailer 4.0.0
Installing activemodel 4.0.0
Installing activerecord-deprecated_finders 1.0.3
Installing arel 4.0.2
Installing activerecord 4.0.0
Using bundler 1.6.2
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using thor 0.19.1
Installing railties 4.0.0
Using coffee-rails 4.0.1
Using hike 1.2.3
Using jquery-rails 3.1.0
Using json 1.8.1
Using tilt 1.4.1
Using sprockets 2.11.0
Installing sprockets-rails 2.0.1
Installing rails 4.0.0
Using sass 3.2.19
Using sass-rails 4.0.3

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/user/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb 
checking for sqlite3.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/user/.rvm/rubies/ruby-2.1.1/bin/ruby
    --with-sqlite3-dir
    --without-sqlite3-dir
    --with-sqlite3-include
    --without-sqlite3-include=${sqlite3-dir}/include
    --with-sqlite3-lib
    --without-sqlite3-lib=${sqlite3-dir}/lib
    --enable-local
    --disable-local
/Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:1120:in `block in find_header'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
    from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:1119:in `find_header'
    from extconf.rb:35:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.1.1/gems/sqlite3-1.3.9 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/sqlite3-1.3.9/gem_make.out
An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.

0 个答案:

没有答案