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

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

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

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

Ruby on Rails

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

Q&A

1回答

1410閲覧

rails tutorial 2章のtoy_appのデプロイに関する質問

m-mry

総合スコア9

Ruby

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

Ruby on Rails

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

0グッド

0クリップ

投稿2017/06/12 06:55

###前提・実現したいこと
質問失礼します。
ただいまrails tutorialの2章を進めているのですが、
toy_appを最後にデプロイしようとしたところ
以下のようなエラーが発生しました。

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

checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'brew install sqlite3',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of necessary
remote: libraries and/or headers. Check the mkmf.log file for more details. You may
remote: need configuration options.

:
:
:

An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that gem install sqlite3 -v '1.3.13' succeeds before bundling.
remote: !
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...

###該当のソースコード

こちらにファイル状況など記載いたします。
「gem file」
source 'https://rubygems.org'

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end

gem 'rails', '> 5.1.1'
gem 'sqlite3'
gem 'puma', '
> 3.7'
gem 'sass-rails', '> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '
> 4.2'
gem 'turbolinks', '> 5'
gem 'jbuilder', '
> 2.5'

group :development, :test do

gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'sqlite3'
end

group :development do

gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :production do
gem 'pg', '0.18.4'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

「gemfile.lock」
GEM
remote: https://rubygems.org/
specs:
actioncable (5.1.1)
actionpack (= 5.1.1)
nio4r (> 2.0)
websocket-driver (
> 0.6.1)
actionmailer (5.1.1)
actionpack (= 5.1.1)
actionview (= 5.1.1)
activejob (= 5.1.1)
mail (> 2.5, >= 2.5.4)
rails-dom-testing (
> 2.0)
actionpack (5.1.1)
actionview (= 5.1.1)
activesupport (= 5.1.1)
rack (> 2.0)
rack-test (
> 0.6.3)
rails-dom-testing (> 2.0)
rails-html-sanitizer (
> 1.0, >= 1.0.2)
actionview (5.1.1)
activesupport (= 5.1.1)
builder (> 3.1)
erubi (
> 1.4)
rails-dom-testing (> 2.0)
rails-html-sanitizer (
> 1.0, >= 1.0.3)
activejob (5.1.1)
activesupport (= 5.1.1)
globalid (>= 0.3.6)
activemodel (5.1.1)
activesupport (= 5.1.1)
activerecord (5.1.1)
activemodel (= 5.1.1)
activesupport (= 5.1.1)
arel (> 8.0)
activesupport (5.1.1)
concurrent-ruby (
> 1.0, >= 1.0.2)
i18n (> 0.7)
minitest (
> 5.1)
tzinfo (> 1.1)
addressable (2.5.1)
public_suffix (
> 2.0, >= 2.0.2)
arel (8.0.0)
bindex (0.5.0)
builder (3.2.3)
byebug (9.0.6)
capybara*(2.14.2)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (> 2.0)
childprocess (0.7.0)
ffi (
> 1.0, >= 1.0.11)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
erubi (1.6.0)
execjs (2.7.0)
ffi (1.9.18)
globalid (0.4.0)
activesupport (>= 4.2.0)
i18n (0.8.4)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
listen (3.1.5)
rb-fsevent (> 0.9, >= 0.9.4)
rb-inotify (
> 0.9, >= 0.9.7)
ruby_dep (> 1.2)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.6)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (
> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.2.0)
minitest (5.10.2)
multi_json (1.12.1)
nio4r (2.1.0)
nokogiri (1.8.0)
mini_portile2 (> 2.2.0)
public_suffix (2.0.5)
puma (3.9.1)
rack (2.0.3)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.1.1)
actioncable (= 5.1.1)
actionmailer (= 5.1.1)
actionpack (= 5.1.1)
actionview (= 5.1.1)
activejob (= 5.1.1)
activemodel (= 5.1.1)
activerecord (= 5.1.1)
activesupport (= 5.1.1)
bundler (>= 1.3.0, < 2.0)
railties (= 5.1.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (
> 2.0)
railties (5.1.1)
actionpack (= 5.1.1)
activesupport (= 5.1.1)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.0.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
ruby_dep (1.5.0)
rubyzip (1.2.1)
sass (3.4.24)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.4.0)
childprocess (
> 0.5)
rubyzip (> 1.0)
websocket (
> 1.0)
spring (2.0.2)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (3.7.1)
concurrent-ruby (> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.7)
turbolinks (5.0.1)
turbolinks-source (
> 5)
turbolinks-source (5.0.3)
tzinfo (1.2.3)
thread_safe (> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
web-console (3.5.1)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
websocket (1.2.4)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
xpath (2.1.0)
nokogiri (
> 1.3)

PLATFORMS
ruby

DEPENDENCIES
byebug
capybara (> 2.13)
coffee-rails (
> 4.2)
jbuilder (> 2.5)
listen (>= 3.0.5, < 3.2)
puma (
> 3.7)
rails (> 5.1.1)
sass-rails (
> 5.0)
selenium-webdriver
spring
spring-watcher-listen (> 2.0.0)
sqlite3
turbolinks (
> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)

BUNDLED WITH
1.15.1

###試したこと

「sqlite3」が原因というのはわかるのですが、どう対処したらよいでしょうか?
教本では「sqlite3」は本番環境には対応していない(heruko)ので本番環境にはインストールしないというように記載されていました。おそらく私の認識がどこかで間違っているのだと思います。

何卒、お力添えよろしくお願い致します。

###補足情報(言語/FW/ツール等のバージョンなど)
RUby : 2.3.0
rails : 5.1.1

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

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

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

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

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

guest

回答1

0

gem sqlite3自体を削って、PostgreSQLやMySQLなどHerokuで使えるデータベースに乗り換えることを、強くおすすめします。

ローカル環境と本番でデータベースエンジンが違うと、それに起因するトラブルなどに巻き込まれるので、通常やるべきではありません。

投稿2017/06/12 07:02

maisumakun

総合スコア145121

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

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

m-mry

2017/06/12 07:16

ご回答ありがとうございます。 ということはcloud9上でもheroku上でもpostgreSQLを使うという認識であってますでしょうか? まだrailsの勉強をし始めて2週間程なので、頓珍漢なことをいっていたらすみません。
maisumakun

2017/06/12 07:20

そうですね、両方PostgreSQLにできるならそれがいいと思います。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

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

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

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問