2011-12-30 9 views
0

私はMacとRuby on Railsが初めてで、自分の環境を設定しようとしています。私はこのチュートリアルで作業していて、Mac OS X Lionにsqlite3 gemをインストールしようとしています。OS X Lionでsqlite3 gemで苦労している

  • のXcode 4.2.1
  • Gitのバージョン1.7.5.4
  • 1.8.11
  • SQLiteバージョン3.7.5

でルビー1.9.3p0

  • GEM -v結果gem install sqlite3またはgem install sqlite3 -- --with-sqlite3-dir=/usr/binを実行しようとすると、以下のエラーテキストが表示されます。誰か提案がありますか?

    Building native extensions. This could take a while... 
    ERROR: Error installing sqlite3: 
    ERROR: Failed to build gem native extension. 
    
        /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb --with-sqlite3-dir=/usr/bin 
    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/mikehking/.rvm/rubies/ruby-1.9.3-p0/bin/ruby 
    --with-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/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
    You have to install development tools first. 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
    from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:969:in `find_header' 
    from extconf.rb:34:in `<main>' 
    
    
    Gem files will remain installed in /Users/mikehking/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.5 for inspection. 
    Results logged to /Users/mikehking/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out 
    
  • 答えて

    0

    あなたは、私が

    sudo brew install libsqlite3-dev 
    
    を実行するだけであるべき想像sqlite3のライブラリファイルを、必要としています