2016-05-03 15 views
0

新しいバンドルアプリケーションにバンドルインストールを実行しようとしています! 私ルビーバージョン:gem install sqlite3 -v '1.3.11'`がバンドルされる前にエラーが発生しました:エラー:宝石ネイティブ拡張を構築できませんでした

ruby 2.3.0p0 

レールバージョン:

Rails 4.1.0 

RVMバージョン:

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

が、私はこのエラーを得ました!

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. 

httpsのは私の国でブロックされているので、私はいつも私のPC上でそれを行う HTTP .Iにそれを変更しなければならないと述べました。 はまた、私のOSは次のとおりです。 のUbuntu 14.04.4 LTS

私は、次のようないくつかのソリューションを試してみた:

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 

をというように...それらの が、どれも私のために働いていません! どうすれば教えてくださいSqlite3の依存関係、またはおそらく私がインストールできる方法gemネイティブ拡張 ??? ありがとうございます事前にご考慮ください:)

答えて

1

これはsqlite3 gem fails to installの重複があります。

あなたは

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

またはあなたがする必要がある場合はsudoを先頭に追加を行うとき、それは動作しません。

+0

私は同じことをしましたが、残念ながらそれはうまくいかなかった:)しかし、インストールプロセスをやり直して、sqlite3やネイティブ拡張、さらには依存関係が正しくインストールされていなくてもよい。私は今ここで説明したチュートリアルに従いました。それは絶対的な成功でした。https://gorails.com/setup/ubuntu/14.04ヒント:手順を1つずつ実行し、git-hubアカウントを構築することを忘れないでください。 sshのキー:)足を壊す:) –

関連する問題