2013-09-26 3 views
3

나는 버전이 내 시스템이 최소 요구 사항을 충족하는지 확인한 후, 적절한 지 확인 시작 : rails new app 에 I는 메시지가 새 응용 프로그램 NEXT :레일을 시작, sqlite3를 오류

  run bundle install 
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ui.rb:36:in `initialize': undefined method `[]' for #<Thor::Shell::Color:0x95890e0> (NoMethodError) 
    from /usr/lib/ruby/vendor_ruby/bundler/cli.rb:12:in `new' 
    from /usr/lib/ruby/vendor_ruby/bundler/cli.rb:12:in `initialize' 
    from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:263:in `new' 
    from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:263:in `dispatch' 
    from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor/base.rb:386:in `start' 
    from /var/lib/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in `block in <main>' 
    from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors' 
    from /var/lib/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in `<main>' 

입력을 새로 생성 된 Rails 애플리케이션 나는 그 위에 설치하고 다음과 같은 오류 메시지가 도착하기 시작 bundle install을 실행

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.9.1 extconf.rb 
checking for sqlite3.h... no 
sqlite3.h is missing. Try 'port install sqlite3 +universal' 
or 'yum install sqlite-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 
    --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=/usr/bin/ruby1.9.1 
    --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 


Gem files will remain installed in /home/helio/.bundler/tmp/23089/gems/sqlite3-1.3.8 for inspection. 
Results logged to /home/helio/.bundler/tmp/23089/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out 

An error occurred while installing sqlite3 (1.3.8), and Bundler 
cannot continue. 
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before 
bundling. 

내가 해봤를하지만 splite3 설치하려고 할 때 오류 메시지가 :

Building native extensions. This could take a while... 
ERROR: Error installing sqlite3: 
    ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.9.1 extconf.rb 
checking for sqlite3.h... no 
sqlite3.h is missing. Try 'port install sqlite3 +universal' 
or 'yum install sqlite-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 
    --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=/usr/bin/ruby1.9.1 
    --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 


Gem files will remain installed in /var/lib/gems/1.9.1/gems/sqlite3-1.3.8 for inspection. 
Results logged to /var/lib/gems/1.9.1/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out 
+0

나는''port install sqlite3 + universal'과''yum install sqlite-devel'과 같이 아무것도하지 말고 두 줄의 메시지를 써 보았습니다. – Hell0

답변

0

문제는 Gemfile에 있습니다. 자습서에는 Windows 및 Mac에서 기본적으로 Java 런타임 스크립트도 설치되어 있다는 내용의 메모가 있습니다. 대신 리눅스는 그것을 수행하지 않습니다. 별도로 설치해야합니다. 하지만 매우 쉽게 해결할 수 있습니다 첫 번째는 Gemfile에서 런타임을 참조하는 행을 지우는 것입니다. 두 번째는 bundle install입니다. Bundler는이 명령을 실행하여 필요한 소프트웨어와 Boala를 설치하고 해결합니다.

1

당신이 필요로하는 먼저 시스템에 sqlite3을 설치하십시오. Rails에는 라이브러리가 없습니다.

+0

그냥 sqlite3을 설치하려고 시도한 결과로 항목을 편집하십시오 – Hell0

+0

sqlite3 is instaled 'SQLite 버전 3.7.13 2012-06-11 02:05:22 지침을 보려면 ".help"를 입력하십시오 "; " sqlite>' – Hell0

7

새로운 레일스 프로젝트를 시작하기 위해 동일한 오류가 발생했습니다. 이 경우 sqlite3.h is missinglibsqlite3-dev이 누락되었음을 의미합니다. 우분투 및 Sqlite3에 새로 추가되었습니다. 대답은 바로 여기에서 찾을 수 있습니다 : Installing sqlite headers.

~$ sudo apt-get install sqlite3 
~$ sudo apt-get install libsqlite3-dev 
~$ bundle install 

그 후 rails server이 저에게 잘 돌아갔습니다. 내가 가진 내 에 오신 것을 환영합니다 localhost에.

1

나를 위해 MacOS에서 누락 된 GNU MP 라이브러리로 판명 된 오류가 있습니다.

이는 ~/.rvm/보석/루비 2.1.3/확장/x86_64에-다윈이-13/2.1.0 정적/sqlite3-1.3.9/mkmf.log 파일에 언급 된

GMP-6.0.0a 이미 설치 :

$ 양조가 GMP를 경고를 설치 ...

내 흔적을 : -lgmp는

양조는 기존과 libs가 나타났다

누락했다, 그러나 나는 엑스 코드를 알고 싶어 생각 ✔ ~/.rvm/gems/ruby-2.1.3/extensions/x86_64-darwin-1 3/2.1.0 정적/sqlite3-1.3.9

$ 양조가 gmp4 경고를 설치 gmp4-4.3.2 이미 ~/.rvm/보석/루비 2.1.3/확장 ✔ 를 설치/x86_64- 다윈-13/2.1.0 정적/sqlite3-1.3.9

$의 LS -altd/usr/지방/LIB/libgmp * lrwxr-XR-1 × SI 직원 40 31 7 월를 15시 48분은/usr/local/lib/libgmp.10.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmp.10.dylib lrwxr-xr-x 1 si staff 33 Jul 31 15:48/usr/local/lib /libgmp.a -> ../Cellar/gmp/6.0.0a/lib/libgmp.a lrwxr-xr-x 1 si 37 7 월 31 일 15시 48 분 /usr/local/lib/libg.drib ->. ./Cellar/gmp/6.0.0a/lib/libgmp.dylib lrwxr-xr-x 1 si 스탭 41 7 월 31 일 15시 48 분 /usr/local/lib/libgmpxx.4.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmpxx.4.dylib lrwxr -xr-x 1 si staff 35 Jul 31 15:48 /usr/local/lib/libgmpxx.a -> ../Cellar/gmp/6.0.0a/lib/libgmpxx.a lrwxr-xr-x 1 si staff 39 Jul 31 15:48 /usr/local/lib/libgmpxx.dylib -> ../Cellar/gmp/6.0.0a/lib/libgmpxx.dylib ✔ ~/.rvm/gems/ruby-2.1.3/extensions /x86_64-darwin-13/2.1.0-static/sqlite3-1.3.9

$ otool -L /usr/local/lib/libgmpxx.dylib /usr/local/lib/libgmpxx.dylib : /usr/local/lib/libgmpxx.4.dylib (호환성 버전 9.0.0, 현재 버전 9.0.0) /usr/local/Cellar/gmp/6.0.0a/lib/libgmp.10.dylib (호환성 버전 13.0. 0 , 현재 버전 13.0.0) /usr/lib/libc++.1.dylib (호환 버전 1.0.0, 현재 버전 120.0.0) /usr/lib/libSystem.B.dylib (호환성 버전 1.0.0, 현재 버전 1197년 1월 1일) ✔ ~/.rvm/보석/루비 2.1.3/확장/x86_64에-다윈-13/2.1.0 정적/sqlite3-1.3.9

$ 보석 설치 sqlite3를 '1.3. 9 ' 네이티브 확장 기능. 이 준 비록 (> = 0) 모든 저장소에 1 보석이 설치

을 '1.3.9'을 유효한 보석을 찾을 수 없습니다 :이 ... 성공적으로 설치 sqlite3-1.3.9 ERROR 시간이 걸릴 수있다 이 오류 메시지는 여전히 설치하는 것처럼 보였습니다.