I'm following this tutorial,
and I'm having a problem when running rake db:migrate
In db/migrate
I have the create_post.rb
file:
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.text :text
t.timestamps
end
end
end
But it does not create the table.
My database.yml
file is:
development:
adapter: mysql2
encoding: utf8
database: blog_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock
The output from rake db:migrate
seems ok.
I'm using phpMyAdmin
to handle the database, which is correctly created manually by me.
What am I doing wrong?
If you are connecting to the right database everything seems fine to me.. I had a similar problem a few weeks ago and the accepted answer of this question fixed my issue.
Here are the steps to run:
I hope it will fix your problem.
Could you please tell which OS you got? Delete the line:
and run:
Give the output of:
If this is not working for you, you could also try to add:
to your database.yml file