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

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

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

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

Q&A

解決済

3回答

1915閲覧

railsでプロジェクト作成時にbundle installでエラーが出ます。

black-to

総合スコア18

Ruby on Rails

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

0グッド

0クリップ

投稿2018/05/20 08:39

gem file

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 5.1.4'

Use mysql as the database for Active Record

gem 'mysql2', '>= 0.3.18', '< 0.5'

ターミナル
Fetching mysql2 0.4.10
Installing mysql2 0.4.10 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

省略...

Gem files will remain installed in
/Users/makmzw/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10 for inspection.
Results logged to
/Users/makmzw/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0-static/mysql2-0.4.10/gem_make.out

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

In Gemfile:
mysql2

変更後:
gem 'mysql2', '>= 0.4.10', '< 0.5'

ターミナル:
bundle install

同様のエラーが出ます。

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

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

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

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

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

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

guest

回答3

0

一度アンインストールし直しました。

投稿2018/05/21 21:46

black-to

総合スコア18

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

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

0

自己解決

パスが通っていませんでした。

投稿2018/05/21 21:45

black-to

総合スコア18

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

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

0

類似の症状いくつか検索に引っかかります

これを見るとあなたが省略した部分が必要な情報に思われます。

まずはエラーメッセージの指示通りに
gem install mysql2 -v '0.4.10'コマンドを実行して
どういうエラーが出るのかを確認しましょう。

また、mysql"ライブラリ"はインストールされているかを確認すべきでしょう

投稿2018/05/20 09:32

asm

総合スコア15147

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

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

black-to

2018/05/20 14:16

ありがとうございます。 brew install mysql' 実行済みです。 or 'port install mysql' port install mysql -bash: port: command not foundと表示されます。 sudo gem install mysql2 -v '0.4.10' Password: Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. current directory: /Users/***/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10/ext/mysql2 /Users/***/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20180520-7497-n9yd5m.rb extconf.rb checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for ruby/thread.h... yes checking for rb_thread_call_without_gvl() in ruby/thread.h... yes checking for rb_thread_blocking_region()... no checking for rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes checking for rb_intern3()... yes checking for rb_big_cmp()... yes checking for mysql_query() in -lmysqlclient... no ----- mysql client is missing. You may need to 'brew install mysql' or 'port install mysql', and try again. ----- *** 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/***/.rbenv/versions/2.3.1/bin/$(RUBY_BASE_NAME) --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysql-config --without-mysql-config --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysqlclientlib --without-mysqlclientlib To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/***/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0-static/mysql2-0.4.10/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Users/***/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql2-0.4.10 for inspection. Results logged to /Users/***/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-16/2.3.0-static/mysql2-0.4.10/gem_make.out
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問