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

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

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

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

Q&A

解決済

2回答

4709閲覧

bundle update がうまくいかない

YamamotoHiroki

総合スコア57

Ruby

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

0グッド

0クリップ

投稿2015/05/10 12:25

bundle updateを実行すると
エラーが表示されます

An error occurred while installing sqlite3 (1.3.8), and Bundler cannot
continue.
Make sure that gem install sqlite3 -v '1.3.8' succeeds before bundling.

こちらのエラーに対してはどう対処すればいいのでしょうか?

ちなみにgem install sqlite3 -v '1.3.8'を実行すると

ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.

と表示されてしまいます。
よろしくお願いします

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

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

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

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

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

guest

回答2

0

ベストアンサー

Gemfileの例を回答に入れてみました。pgだけの状態でsqlite3を入れてインストールできました。

  • ruby2.2.0

なので少し環境が違いますが、ちなみにbrewでsqlite入れてますか?

brew list sqlite3の結果は以下

/usr/local/Cellar/sqlite/3.8.9/bin/sqlite3 /usr/local/Cellar/sqlite/3.8.9/include/ (2 files) /usr/local/Cellar/sqlite/3.8.9/lib/libsqlite3.0.dylib /usr/local/Cellar/sqlite/3.8.9/lib/pkgconfig/sqlite3.pc /usr/local/Cellar/sqlite/3.8.9/lib/ (2 other files) /usr/local/Cellar/sqlite/3.8.9/share/man/man1/sqlite3.1

投稿2015/05/10 13:29

kntmrkm

総合スコア29

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

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

YamamotoHiroki

2015/05/10 14:15

brewでsqliteいれてないです なんとコマンドをうてばよいですか? pgとはなんですか?
YamamotoHiroki

2015/05/10 14:22

gem file の中身を例と全く同じにして再度bundle updateを実行しましたが下記のエラーがでました An error occurred while installing pg (0.18.1), and Bundler cannot continue. Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.
YamamotoHiroki

2015/05/10 14:22

brew list sqlite3 の結果です Error: No such keg: /usr/local/Cellar/sqlite
kntmrkm

2015/05/10 14:47

brew update brew upgrade brew install sqlite でどうでしょう
YamamotoHiroki

2015/05/10 14:50

どうやら sqlite3 --version 3.8.5 2014-08-15 22:37:57 c8ade949d4a2eb3bba4702a4a0e17b405e9b6ace インストールされてたみたいです
YamamotoHiroki

2015/05/10 14:50

brew upgrade Warning: brew upgrade with no arguments will change behaviour soon! It currently upgrades all formula but this will soon change to require '--all'. Please update any workflows, documentation and scripts!
YamamotoHiroki

2015/05/10 14:52

brew update brew upgrade brew install sqlite 順番通りにしたらこの3つのコマンド全てうまくいきました
YamamotoHiroki

2015/05/10 14:55

しかし bundle update An error occurred while installing pg (0.18.1), and Bundler cannot continue. Make sure that `gem install pg -v '0.18.1'` succeeds before bundling. です
kntmrkm

2015/05/10 15:22

Pgは別のdbなのでpg消してください
guest

0

依存関係でエラーが出る場合、以下の手順で上手く行く場合があります。

  • Gemfile.lockを削除する
  • bundle --path=vendor/bundle などでインストール先を指定する

rails new後のbundle installでpathを指定しなかった場合、グローバルにインストールされます。pathを指定することでそのRailsプロジェクト内のみで利用するようにgemをインストールできます。

source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.1' # Use postgresql as the database for Active Record gem 'pg' gem 'sqlite3' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.1.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Unicorn as the app server # gem 'unicorn' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end

投稿2015/05/10 12:44

編集2015/05/10 13:27
kntmrkm

総合スコア29

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

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

YamamotoHiroki

2015/05/10 13:03

rm Gemfile.lock で削除したあと bundle --path=vendor/bundle を実行しましたが同じエラーが表示されてしまいます。 gemfileの中身を少々いじったのですがそれが問題なのでしょうか?
kntmrkm

2015/05/10 13:08

後、環境構築系だとOSや各種バージョンなどがあれば回答し易いと思います。
YamamotoHiroki

2015/05/10 13:23

bundle updateをしても同じエラーがでます。 Mac OS X Yosemite version 10.10.3 ruby 2.2.2 です。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問