잘 동작하던 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 이하 버전만 쓸 수 있게 한다.



'Ruby' 카테고리의 다른 글

[ruby] string에서 substring하기  (0) 2015.12.09
[ruby] 스트링 치환 (replacement)  (0) 2015.12.09
ruby 공부 - interval단위로 DateTIme 시간 출력하기  (0) 2015.05.06
ruby - gil  (0) 2015.04.13
[ruby 공부 싸이트] rubymonk  (0) 2015.04.03
Posted by '김용환'
,