Starting a new Rails projects starts basically having Rails installed. If you don’t have it yet, you can install with:
gem install rails
If you want to check the version of rails you have, try:
Having Rails now it’s time to create your project using MySQL instead of the default option which is SQLite.
rails new ProjectName -d mysql
Now that we have our project, we’re going to just change the file database.yml adding the password. Keep in mind that in production environment, you won’t do this. The best practice says to setup credentials as Config Variables.
And add the password on this section:
default: &default adapter: mysql2 encoding: utf8 pool: 5 username: root password: EDIT_HERE_WITH_YOUR_PASSWORD socket: /var/run/mysqld/mysqld.sock
The last step is create the database. Rails is going to create a development and test database:
bundle exec rake db:create
<< All Posts
Zookeeper and Apache Kafka with Ruby