잘 동작하던 Ruby 시스템이 갑작스런 Gem 설치 이슈가 발생했다.


ruby/lib/ruby/gems/2.1.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/connection_specification.rb:190:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)




Gemfile에 아래와 같이 설정했었다.


gem 'activerecord', '4.1.5'

gem 'mysql2'


그래서 기존에 돌던 버전 정보를 맞춰(version specifier) 해결했다.


gem 'activerecord', '4.1.5'

gem 'mysql2', '0.3.20'




이 과정에서 공부한 version specifier를 확인했다.


예)

0.3.0 이라고 사용하면 0.3.0 버전만 사용한다.

>= 0.3.0 이라고 사용하면 0.3.0 이상만 되게 한다.

~> 0.3.1 이라고 하면 0.3.1 부터 0.4.0 이하 버전만 쓸 수 있게 한다.



Posted by 김용환 '김용환'

댓글을 달아 주세요