복붙노트

[RUBY-ON-RAILS] sqlite3를 보석은 설치되지 않습니다

RUBY-ON-RAILS

sqlite3를 보석은 설치되지 않습니다

나는 OS X 10.6에서 "sqlite3를 루비"보석 (또는 "sqlite3를"보석)를 설치하기 위해 노력하고있어. 나는 루비 1.9.2 사용하고 있는데 저는 현재 다음을 얻을 :

 $ sqlite3 --version
3.7.4
 $ sudo gem install sqlite3
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3-ruby:
    ERROR: Failed to build gem native extension.

/Users/folken/.rvm/rubies/ruby-1.9.2-head/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/folken/.rvm/rubies/ruby-1.9.2-head/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
/Users/folken/.rvm/rubies/ruby-1.9.2-head/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/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
    from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
    from extconf.rb:28:in `<main>'


Gem files will remain installed in /Users/folken/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-1.3.3 for inspection.

다음은 & whereis의 결과이며, sqlite3.h가에 위치하고 있습니다 / 옵션 / 지역 / 다음과 같습니다 :

 $ which sqlite3
/opt/local/bin/sqlite3
 $ whereis sqlite3
/usr/bin/sqlite3

나는뿐만 아니라 다음과 같은 전달 시도했다 :

sudo gem install sqlite3 -- --with-sqlite3-include /opt/local/include --with-sqlite3-lib /opt/local/lib
sudo gem install sqlite3 -- --with-sqlite3-dir /opt/local/bin

이는 다음의 결과 :

ERROR:  Error installing sqlite3-ruby:
    ERROR: Failed to build gem native extension.

/Users/folken/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb --with-sqlite3-dir /usr/bin/sqlite3
*** 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/folken/.rvm/rubies/ruby-1.9.2-head/bin/ruby
    --with-sqlite3-dir
/Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:1336:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
    from extconf.rb:9:in `<main>'

또한 /Users/folken/.rvm/gems/ruby-1.9.2-head/gems 미만 :     SQLite는 루비 - 2.2.3     sqlite3-1.3.3

RVM에서 나는 루비-1.8.7과 sqlite3를 보석로드 벌금을 가지고 있지만, 인터넷 검색을 많이 후 나는 나를 위해 작동하는 해결책을 발견하지 않았습니다. 어떤 도움을 크게 (이 작업을 얻기 위해 수동 설치 / 해커를 포함하더라도) 감사합니다.

해결법

  1. ==============================

    1.내가 sqlite3를 설치했고 아직 sqlite3를 보석 설치하지 않을 곳에 나는 당신으로 거의 비슷한 문제가 있었다. 다음과 같이 나는 오류 메시지가 표시되었다

    내가 sqlite3를 설치했고 아직 sqlite3를 보석 설치하지 않을 곳에 나는 당신으로 거의 비슷한 문제가 있었다. 다음과 같이 나는 오류 메시지가 표시되었다

    user-name-rajas-macbook-pro:rails3 user-namer$ gem install sqlite3
    Building native extensions.  This could take a while...
        ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.
    
            /Users/user-namer/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
    checking for sqlite3.h... yes
    checking for sqlite3_libversion_number() in -lsqlite3... no
    sqlite3 is missing. Try 'port install sqlite3 +universal'
    or 'yum install sqlite3-devel' and check your shared library search path (the
    location where your sqlite3 shared library is located).
    *** 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
        --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-namer/.rvm/rubies/ruby-1.9.2-p180/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
        --with-sqlite3lib
        --without-sqlite3lib
    
    
    Gem files will remain installed in /Users/user-namer/.rvm/gems/ruby-1.9.2-    p180@rails_3/gems/sqlite3-1.3.3 for inspection.
    Results logged to /Users/user-namer/.rvm/gems/ruby-1.9.2-p180@rails_3/gems/sqlite3-    1.3.3/ext/sqlite3/gem_make.out
    

    여기에 나를 위해 일한 것입니다

    gem install sqlite3 -- --with-sqlite3-dir=/opt/local
    
  2. ==============================

    2.내가 달릴 때 나는 루비 1.9.2.p180를 사용 RVM으로 동작 책에 Rails3을 다음 및 Mac OS X 10.5.8 (레오파드)를 사용하여 3.1.0.rc6 레일되었다 :

    내가 달릴 때 나는 루비 1.9.2.p180를 사용 RVM으로 동작 책에 Rails3을 다음 및 Mac OS X 10.5.8 (레오파드)를 사용하여 3.1.0.rc6 레일되었다 :

    rake cucumber:ok
    

    내가 가지고 :

    Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (can't activate sqlite3 (~> 1.3.4, runtime), already activated sqlite3-1.3.3. Make sure all dependencies are added to Gemfile.) 
    

    그때했다 :

    gem install sqlite3 -- --with-sqlite3-dir=/opt/local
    

    다음 :

    bundle install
    

    SQLite는 1.3.5이 필요한 경우 희망, 나는 인터넷에서 내 자신의 대답을 찾을 수 있습니다.

  3. ==============================

    3.당신 같은 소리는 엑스 코드를 설치하지 않았습니다.

    당신 같은 소리는 엑스 코드를 설치하지 않았습니다.

  4. ==============================

    4.OSX에 들어 있는지 확인하십시오 당신은 엑스 코드가 설치되어 당신은 조건을 수락. 나를 위해, 나는 조건 (어떤 이유, 아마도 Xcode를 최근에 설치 또는 내 컴퓨터에서 업데이트)에 동의하지 않았다.

    OSX에 들어 있는지 확인하십시오 당신은 엑스 코드가 설치되어 당신은 조건을 수락. 나를 위해, 나는 조건 (어떤 이유, 아마도 Xcode를 최근에 설치 또는 내 컴퓨터에서 업데이트)에 동의하지 않았다.

  5. from https://stackoverflow.com/questions/5025680/sqlite3-gem-fails-to-install by cc-by-sa and MIT license