2016-05-03 8 views
0

Ich versuche, "bundle install" in meiner neuen Rails-App auszuführen! meine Rubin Version:gem install sqlite3 -v '1.3.11'` ist erfolgreich vor dem Bündeln Fehler: FEHLER: Fehler beim Erstellen der gem nativen Erweiterung

ruby 2.3.0p0 

meine Schienen Version:

Rails 4.1.0 

meine rvm Version:

rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/] 

aber ich habe diesen Fehler!

Fetching gem metadata from http://rubygems.org/........... 
Fetching version metadata from http://rubygems.org/... 
Fetching dependency metadata from http://rubygems.org/.. 
Resolving dependencies........... 
Rubygems 2.0.3 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
Using rake 11.1.2 
Using i18n 0.7.0 
Using json 1.8.3 
Using minitest 5.8.4 
Using thread_safe 0.3.5 
Using builder 3.2.2 
Using erubis 2.7.0 
Using rack 1.5.5 
Using mime-types 1.25.1 
Using polyglot 0.3.5 
Using arel 5.0.1.20140414130214 
Using bundler 1.11.2 
Using coffee-script-source 1.10.0 
Using execjs 2.6.0 
Using thor 0.19.1 
Using hike 1.2.3 
Using multi_json 1.11.3 
Using tilt 1.4.1 
Using sass 3.2.19 
Using spring 1.7.1 
Installing sqlite3 1.3.11 with native extensions 

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

    /home/afsane/.rvm/rubies/ruby-2.3.0/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=/home/afsane/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME) 
    --with-sqlite3-dir 
    --without-sqlite3-dir 
    --with-sqlite3-include 
    --without-sqlite3-include=${sqlite3-dir}/include 
    --with-sqlite3-lib 
    --without-sqlite3-lib=${sqlite3-dir}/lib 
/home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:1144:in `block in find_header' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:320:in `open' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:320:in `open' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:346:in `postpone' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:1143:in `find_header' 
    from extconf.rb:30:in `<main>' 


Gem files will remain installed in /home/afsane/.rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.11 for inspection. 
Results logged to /home/afsane/.rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out 
Using rdoc 4.2.2 
Using tzinfo 1.2.2 
Using rack-test 0.6.3 
Using treetop 1.4.15 
Using coffee-script 2.4.1 
Using uglifier 3.0.0 
Using sprockets 2.12.4 
An error occurred while installing sqlite3 (1.3.11), and Bundler cannot continue. 
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling. 
[email protected]:~/Desktop/Afsaneh/test2$ clear 

[email protected]:~/Desktop/Afsaneh/test2$ cd 
[email protected]:~$ ruby -v 
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux] 
[email protected]:~$ ^C 
[email protected]:~$ rails -v 
Rails 4.1.0 
[email protected]:~$ rvm -v 
rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/] 
[email protected]:~$ cd Desktop 
[email protected]:~/Desktop$ cd Afsaneh 
[email protected]:~/Desktop/Afsaneh$ cd test1 
[email protected]:~/Desktop/Afsaneh/test1$ bundle install 
Fetching gem metadata from http://rubygems.org/........... 
Fetching version metadata from http://rubygems.org/... 
Fetching dependency metadata from http://rubygems.org/.. 
Resolving dependencies........... 
Rubygems 2.0.3 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
Using rake 11.1.2 
Using i18n 0.7.0 
Using json 1.8.3 
Using minitest 5.8.4 
Using thread_safe 0.3.5 
Using builder 3.2.2 
Using erubis 2.7.0 
Using rack 1.5.5 
Using mime-types 1.25.1 
Using polyglot 0.3.5 
Using arel 5.0.1.20140414130214 
Using bundler 1.11.2 
Using coffee-script-source 1.10.0 
Using execjs 2.6.0 
Using thor 0.19.1 
Using columnize 0.9.0 
Using debugger-linecache 1.2.0 
Using debugger-ruby_core_source 1.3.8 
Using hike 1.2.3 
Using multi_json 1.11.3 
Using tilt 1.4.1 
Using sass 3.2.19 
Using spring 1.7.1 
Installing sqlite3 1.3.11 with native extensions 

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

    /home/afsane/.rvm/rubies/ruby-2.3.0/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=/home/afsane/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME) 
    --with-sqlite3-dir 
    --without-sqlite3-dir 
    --with-sqlite3-include 
    --without-sqlite3-include=${sqlite3-dir}/include 
    --with-sqlite3-lib 
    --without-sqlite3-lib=${sqlite3-dir}/lib 
/home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:587:in `try_cpp' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:1144:in `block in find_header' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:320:in `open' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:320:in `open' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:346:in `postpone' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:1143:in `find_header' 
    from extconf.rb:30:in `<main>' 


Gem files will remain installed in /home/afsane/.rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.11 for inspection. 
Results logged to /home/afsane/.rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out 
Using rdoc 4.2.2 
Using tzinfo 1.2.2 
Using rack-test 0.6.3 
Using treetop 1.4.15 
Using coffee-script 2.4.1 
Using uglifier 3.0.0 
Installing debugger 1.6.8 with native extensions 

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

    /home/afsane/.rvm/rubies/ruby-2.3.0/bin/ruby extconf.rb 
*** 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=/home/afsane/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME) 
/home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1392:in `initialize': No such file or directory @ rb_sysopen - ./230/ruby_debug.h (Errno::ENOENT) 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1392:in `open' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1392:in `copy_file' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:486:in `copy_file' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:403:in `block in cp' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1585:in `fu_each_src_dest0' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest' 
    from /home/afsane/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb:402:in `cp' 
    from extconf.rb:83:in `block in <main>' 
    from extconf.rb:82:in `each' 
    from extconf.rb:82:in `<main>' 


Gem files will remain installed in /home/afsane/.rvm/gems/ruby-2.3.0/gems/debugger-1.6.8 for inspection. 
Results logged to /home/afsane/.rvm/gems/ruby-2.3.0/gems/debugger-1.6.8/ext/ruby_debug/gem_make.out 
Using sprockets 2.12.4 
An error occurred while installing sqlite3 (1.3.11), and Bundler cannot continue. 
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling. 

erwähnt, dass, weil die https in meinem Land blockiert Ich habe es .I immer http geändert zu tun, dass auf meinem PC. Auch mein OS ist: Ubuntu 14.04.4 LTS

ich einige Lösungen versucht haben, wie zum Beispiel:

sudo apt-get install sqliteman sqlite3 
sudo gem install sqlite3 -v '1.3.7' 
sudo apt-get install -y sqlite3 libsqlite3-dev 
gem install sqlite3 
sudo gem update --system 

und so weiter ... aber keiner von ihnen arbeitete für mich! Könnten Sie mir bitte sagen, wie kann ich herunterladen Sqlite3 Abhängigkeiten oder vielleicht, wie ich gem native Erweiterung installieren kann ??? Vielen Dank Im Voraus für Ihre Überlegung :)

Antwort

1

Dies kann ein Duplikat von sqlite3 gem fails to install sein.

Funktioniert es, wenn Sie

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

oder prepend Sudo tun, wenn Sie benötigen.

+0

Ich tat das gleiche, aber leider hat es nicht funktioniert :) aber ich zog es vor, den Installationsvorgang erneut zu tun, weil die sqlite3 oder vielleicht die nativen Erweiterungen oder sogar vielleicht die Abhängigkeiten nicht korrekt installiert wurden. Ich habe dieses Tutorial hier erklärt und es war ein absoluter Erfolg: https: //gorails.com/setup/ubuntu/14.04 Tipp: Mach einfach die Schritte eins nach dem anderen und vergiss nicht, einen git-hub Account zu erstellen ein ssh Schlüssel :) Brechen Sie ein Bein :) –

Verwandte Themen