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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

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

Q&A

0回答

1132閲覧

rails serverが起動しない。プログラミング超初心者です。

kotatera

総合スコア0

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

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

0グッド

0クリップ

投稿2021/03/06 08:25

編集2022/01/12 10:55

前提・実現したいこと

・rails serverを起動したいです。

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

rubyとrailsをインストールしてrecipeというプロジェクトを作り、

recipeディレクトリに移動して、rails serverとすると以下の文言が出ます。

rail newの時に下記、エラーが発生しているようです。
sqlite関連の問題でしょうか?

Using loofah 2.9.0
Fetching xpath 3.2.0
Installing addressable 2.7.0
Installing xpath 3.2.0
Fetching selenium-webdriver 3.142.7
Fetching turbolinks 5.2.1
Installing turbolinks 5.2.1
Using rails-dom-testing 2.0.3
Using globalid 0.4.2
Using activemodel 6.1.3
Fetching jbuilder 2.11.2
Installing selenium-webdriver 3.142.7
Installing jbuilder 2.11.2
Using rails-html-sanitizer 1.3.0
Fetching capybara 3.35.3
Installing capybara 3.35.3
Using activejob 6.1.3
Using activerecord 6.1.3
Using actionview 6.1.3
Using actionpack 6.1.3
Using actioncable 6.1.3
Using activestorage 6.1.3
Using actionmailer 6.1.3
Using railties 6.1.3
Using sprockets-rails 3.2.2
Using actionmailbox 6.1.3
Using actiontext 6.1.3
Fetching web-console 4.1.0
Installing web-console 4.1.0
Fetching webpacker 5.2.1
Using rails 6.1.3
Installing webpacker 5.2.1
Fetching webdrivers 4.6.0
Installing webdrivers 4.6.0
Fetching bootsnap 1.7.2
Installing bootsnap 1.7.2 with native extensions
Fetching sassc 2.4.0
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching listen 3.4.1
Installing sassc 2.4.0 with native extensions
Installing listen 3.4.1
Fetching sassc-rails 2.1.2
Installing sassc-rails 2.1.2
Fetching sass-rails 6.0.0
Installing sass-rails 6.0.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/kotatera/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.2/ext/sqlite3
/Users/kotatera/.rbenv/versions/2.5.8/bin/ruby -I
/Users/kotatera/.rbenv/versions/2.5.8/lib/ruby/site_ruby/2.5.0 -r
./siteconf20210306-4024-11b68qb.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.

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=/Users/kotatera/.rbenv/versions/2.5.8/bin/$(RUBY_BASE_NAME)
--with-sqlcipher
--without-sqlcipher
--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:

/Users/kotatera/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-19/2.5.0/sqlite3-1.4.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/Users/kotatera/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.2 for
inspection.
Results logged to
/Users/kotatera/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-19/2.5.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 rubygems repository
https://rubygems.org/ or installed locally.
The source does not contain any versions of 'sqlite3'
rails webpacker:install
Could not find gem 'sqlite3 (
> 1.4)' in rubygems repository https://rubygems.org/ or installed locally.
The source does not contain any versions of 'sqlite3'
Run bundle install to install missing gems.
kotatera@MacBook ~ %


### 試したこと gemfileのsqliteを1.3.13と1.4の二通りで書き換えbundleしましたが変わらず、全くわからない状況です。 どなたかご教授お願い致します。

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

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

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

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

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

winterboum

2021/03/06 08:57

書き換えの前後のGemfileの内容(その前後だけでよいです) と 各々の場合のエラーメッセージの「Puma caught this error: Error loading the 'sqlite3' Active・・・」部分の比較を載せてください
m.ts10806

2021/03/06 09:13

>プログラミング超初心者です。 「初心者アイコン」を質問につけられているので書かなくて良いです。
m.ts10806

2021/03/06 09:13

sqlite3はインストール(&実行確認)済みですか?
kotatera

2021/03/06 12:50

m.ts10806様 有り難うございます。 sqlite3はインストール済です。
kotatera

2021/03/06 13:00

winterboum様 ご返信有り難うございます。 追記致しましたので宜しければ、ご確認お願いいたします。
technocore

2021/03/06 15:33

以下のバージョンでrails newしてみました。 Ruby version: ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-darwin19] Rails version: 6.1.3 sqlite3 3.34.0 2020-12-01 インストールされたGemは、sqlite3 (1.4.2) でした。 参考にしてください。
kotatera

2021/03/09 13:13

みなさま、ありがとうございました!!大変助かりました!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問