B
B
bismoney2015-10-22 07:23:52
Ruby on Rails
bismoney, 2015-10-22 07:23:52

Ruby and Rails how to connect mysql?

Hey guys.
I can't make friends with ROR and mysql
Created a new project
rails new project -d mysql
added
gem 'mysql2'
to gemfile Made
gem mysql2 insatll
Corrected database.yml

default: &default
  adapter: mysql2
  database: ruby
  username: ruby
  password: 12345
  host: localhost
  encoding: utf8
  socket: /var/lib/mysql/mysql.sock

development:
  <<: *default

test:
  <<: *default

production:
  <<: *default

I launched it and on the site I see
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).
He asks me to add to the gemfile what is already there, what's the trick?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bismoney, 2015-10-22
@bismoney

Solved, stupefied
gem 'mysql2', '~> 0.3.11'

S
Sergey Kharchenko, 2015-10-22
@lenferer

make a bundle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question