LoginSignup
0
1

More than 5 years have passed since last update.

rails new & rails -v コマンドでactivesupportのコンフリクトが起こる

Posted at

背景

railsで新たに開発するため、rails newコマンドを使った時に起こったエラーです。

開発環境

・rails 5.0.7
・ruby 2.3.1

コマンドとエラー文

ターミナル
$rails new app-git -d mysql
/Users/hasegawataichiro/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:2274:in `check_version_conflict': can't activate activesupport-5.1.1, already activated activesupport-5.0.7 (Gem::LoadError)
from /Users/hasegawataichiro/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:1403:in `activate'
from /Users/hasegawataichiro/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:89:in `block in require'

原因

まずバージョンを確認してみる。

ターミナル
$ gem list | grep activesupport
activesupport (5.1.1, 5.0.7, 5.0.1, 5.0.0.1, 4.2.6, 4.2.5)
ターミナル
$ gem list | grep rails

・
・
rails (5.0.7, 5.0.1, 5.0.0.1, 4.2.6, 4.2.5)
・
・

activesupportには、バージョン5.1.1があるのに対し、railsには5.1.1が存在しない。
どうやらrails と activesupport のバージョンを一致させる必要があるみたいです。

解決法

activesupport5.1.1のgemをアンインストール

ターミナル
$ gem uninstall activesupport -v 5.1.1

再び rails new するとできました。

activesupportのgemはrailsと同時にインストールされるみたいです。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1