Help Setting Up Ruby on Rails and MySQL - Award

I desperately need help from any charity experts on rubies / rails. I really want to learn RoR, but I can’t leave anywhere, because every time I get to the scene where I need to connect to the database, something went wrong. This is what I find now.

[Mac OSX 10.6.6 - Ruby 1.9.2 - Rails 3.0.5 - MySQL 5.5.10]

These are all the latest versions, just installed and smooth. I also have rvm installed. All I want to know is how I can create a new Rails project using a MySQL database and connect to it correctly. I spent countless hours searching and error after error after error.

Can someone help me outlining step by step how can I just get a working rails project connected to mysql database? If someone can help me, I will not only be the responsibility of your life, but I will also create amazing web interfaces and designs for you for free and / or I will collaborate with your next project as a user interface designer. In addition, I will give you a free photoshop / graphics telling about life.

I want to learn rails so badly, but now I am above my head with this file configuration and spend a huge amount of time. Please, help!

+5
source share
2 answers

You owe me your life !!!! WOW! Seriously try the following:

rails new example -d mysql

config.database.yml

development:
  adapter: mysql2  
  encoding: utf8
  database: example_development
  pool: 5
  username: root
  password:
  socket: /var/run/mysqld/mysqld.sock

cd example

(mysql2)

bundle install

rake db:create

Profit!

/var/run/mysqld/mysqld.sock mysql, , https://gist.github.com/878434 /

+13

All Articles