Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
17
Help us understand the problem. What is going on with this article?
@lemmy

gem mysql2がインストールできなかった時の対処

More than 1 year has passed since last update.

railsをインストールしてプロジェクトを作成し、サーバーを起動して
とりあえずHello worldしようと思った。 が、こけた

$ rails new [project_name] -d mysql -B

mysql2のgemがないと言われている

$ rails server
Could not find gem 'mysql2 (< 0.6.0, >= 0.4.4)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

検索して
https://qiita.com/nakki/items/e15c6b024d27edb2b96b
この辺りの記事を見つけたのでxcodeをアップデートとか必要なのかな・・・・?

と思っていたが、単にこの環境にmysqlが入っていなかっただけだった・・・

$ brew install mysql
$ brew upgrade mysql

このあとpumaとかsassとか古いgemがいくつかあったのだが、

$ bundle install
$ gem update

などしてrailsに必要なgemを揃えた。

$ rails server
=> Booting Puma
=> Rails 5.2.1 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET "/" for 127.0.0.1 at 2018-10-23 22:14:02 +0900

localhostに3000番ポートでアクセスしていけました。

参考

17
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
lemmy

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
17
Help us understand the problem. What is going on with this article?