railsでアプリを作りたいのですが、bundle installでsqlite3がインストールできずに詰まっています。
rails newでアプリケーションを生成し、bundle update と bundle installを実行したところ
以下のように表示されました。
$ bundle install current directory: /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.1/ext/sqlite3 /home/yamada/.rbenv/versions/2.6.3/bin/ruby -I /home/yamada/.rbenv/versions/2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190806-599-1hbjbkg.rb extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'brew install sqlite3', 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' 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. To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/sqlite3-1.4.1/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.1 for inspection. Results logged to /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/sqlite3-1.4.1/gem_make.out An error occurred while installing sqlite3 (1.4.1), and Bundler cannot continue. Make sure that `gem install sqlite3 -v '1.4.1' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: sqlite3
・sudo apt-get install libsqlite3-dev
・gemfileにgem install sqlite3 -v '1.4.1'
の書き換え
その後updateとinstallを実行してもダメでした。
Gem files will remain installed in /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.1 for inspection. Results logged to /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/sqlite3-1.4.1/gem_make.out
上の箇所を参考にディレクトリを変えてコマンドを実行しても
Gem
1 2 3~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.1$ gem install sqlite3 4Building native extensions. This could take a while... 5ERROR: Error installing sqlite3: 6 ERROR: Failed to build gem native extension. 7 8 No such file or directory - getcwd 9 10Gem files will remain installed in /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.1 for inspection. 11Results logged to /home/yamada/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0-static/sqlite3-1.4.1/gem_make.out
となりダメでした
~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.1
ディレクトリのパーミッション:drwxrwxr-x 7 ユーザ名 4096 日付 sqlite3-1.4.1
mkmf.logファイルを見ても何が問題なのかよくわかりませんでした。
原因がわかる方がいらっしゃいましたら解説をお願いいたします
補足情報(FW/ツールのバージョンなど)
OS:Ubuntu 16.04.6 LTS
rails:Rails 5.2.3
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。