質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

2707閲覧

WSL上でのrailsの環境構築の最中に出たエラーに対処できません。

rosalia

総合スコア20

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/01/10 09:07

編集2020/01/10 09:27

https://qiita.com/saitoeku3/items/370001477df05182bae2
この記事に従ってrailsの環境構築をしていたのですが
bundle exec rails new test_app
このコマンドでエラーが発生してしまって困っています。
エラーは以下の内容です。

発生している問題・エラーメッセージ

extconf failed, exit code 1

Gem files will remain installed in
/home/linuxbrew/.linuxbrew/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2 for
inspection.
Results logged to
/home/linuxbrew/.linuxbrew/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/gem_make.out

An error occurred while installing sqlite3 (1.4.2), and Bundler cannot
continue.
Make sure that gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/' succeeds before bundling.

In Gemfile:
sqlite3
run bundle binstubs bundler
Could not find gem 'sqlite3 (> 1.4)' in any of the gem sources listed in your Gemfile.
run bundle exec spring binstub --all
Could not find gem 'sqlite3 (
> 1.4)' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.
rails webpacker:install
Traceback (most recent call last):
3: from bin/rails:3:in <main>' 2: from bin/rails:3:in require_relative'

試したこと

gem install sqlite3 -v '1.4.2' --source
'https://rubygems.org/'
を試してみたのですが
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.

current directory: /home/linuxbrew/.linuxbrew/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3

/home/linuxbrew/.linuxbrew/opt/ruby/bin/ruby -I /home/linuxbrew/.linuxbrew/Cellar/ruby/2.6.5/lib/ruby/2.6.0 -r ./siteconf20200110-24366-o4qv0i.rb extconf.rb
/home/linuxbrew/.linuxbrew/Cellar/ruby/2.6.5/lib/ruby/2.6.0/mkmf.rb:1565: warning: Insecure world writable dir /home/ryoga17226/.rbenv/shims in PATH, mode 040777
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.

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=/home/linuxbrew/.linuxbrew/Cellar/ruby/2.6.5/bin/$(RUBY_BASE_NAME)
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/home/linuxbrew/.linuxbrew/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/mkmf.log

extconf failed, exit code 1
とも表示されてしまいました。

補足情報(FW/ツールのバージョンなど)

rails 2.7.0
rbenv 1.1.2
gem 3.0.6
bundler 2.1.4

rubyの勉強を一通り終えた程度のド素人なのですが、ご教授お願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

sqliteのコンパイルに必要なlinuxのライブラリが足りていない気がします。

こちらの記事の
https://qiita.com/kkei/items/04983867bdb5c7deba8c
Step 2. 足りないライブラリをインストールする。
をやってみてください

投稿2020/01/10 09:30

mariguranule

総合スコア204

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

rosalia

2020/01/10 13:11

ご回答ありがとうございます! 記事の内容+ 'brew install sqlite3' をしたところ、こちらは無事インストールできたのですが、 'bundle exec rails new test_app' では再度失敗してしまいました。 exist identical README.md identical Rakefile identical .ruby-version identical config.ru conflict .gitignore Overwrite /mnt/c/Users/username/workspace/test_app/.gitignore? (enter "h" for h elp) [Ynaqdhm] y force .gitignore identical Gemfile run git init from "." Reinitialized existing Git repository in /mnt/c/Users/username/workspace/test_a pp/.git/ identical package.json exist app identical app/assets/config/manifest.js identical app/assets/stylesheets/application.css identical app/channels/application_cable/channel.rb --------略-------------------------------------------------------- run bundle exec spring binstub --all * bin/rake: Spring inserted * bin/rails: Spring inserted rails webpacker:install Traceback (most recent call last): 3: from bin/rails:8:in `<main>' 2: from bin/rails:8:in `require_relative' 1: from /mnt/c/Users/username/workspace/test_app/config/boot.rb:4:in `< top (required)>' /mnt/c/Users/username/workspace/test_app/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError) エラーはこのようなものでした。 どう対処すればよいでしょうか?頼りきりで申し訳ないです...。
rosalia

2020/01/11 06:27

bootsnapを追加していないせいか、キャッシュが見つかりませんでした。
mariguranule

2020/01/11 06:53

そうなんですね〜。あまりこの辺は詳しくなく、、 load such file -- bootsnap/setup (LoadError) で調べると色々情報出てくると思います。 頑張ってくださいm(_ _)m
rosalia

2020/01/11 07:13

いえいえ、mariguranuleさんには感謝の言葉しか浮かばないです。 ありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問