Мой гемфайл имеет следующую строку:
gem 'mysql2', group: :production
но я получаю эту ошибку, когда запускаю команду из командной строки:
rails r "puts Rails.env"
/Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activerecord-4.2.6/lib/active_record/connection_adapters/connection_specification.rb:177: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)
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activerecord-4.2.6/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:50:in `establish_connection'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activerecord-4.2.6/lib/active_record/railtie.rb:120:in `block (2 levels) in <class:Railtie>'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activesupport-4.2.6/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/activerecord-4.2.6/lib/active_record/railtie.rb:116:in `block in <class:Railtie>'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /Users/cgunnels/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/cgunnels/.rvm/gems/ruby-2.2.2@global/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
...
rest of stack trace
С другой стороны: я не смог понять, почему mysql2 не будет установлен. Я пробовал пару исправлений для поиска в стеке, но без кубиков.
UPDATE:
Я не упомянул, но я хочу быть в среде разработки.