Starting Ruby on rails

What is Rails?

ROR is a web development framework written with Ruby. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks. Some developers also say that it makes web application development more fun…

Like many dev programs, ROR is also MVC based.

downloading rails: you can download ruby from here.

  1. Creating application folder. very easy, just key in rails new blog in your command. This will create a Rails application called Blog in a directory called blog.
  2. DB configuration: like many other applications, you will probably use a DB to store the information. You can connect to mysql DB like so:
      adapter: mysql2
      encoding: utf8
      database: blog_development
      pool: 5
      username: root
      socket: /tmp/mysql.sock this info goes to your config/database.yml file.
  3. Now that you have your database configured, it’s time to have Rails create an empty database for you. You can do this by running a rake command:$ rake db:create
  4. Starting rail server is easy, just key in $ rails server.
  5. If you didn’t change the defaults, you are listening on port 3000.



Leave a Reply

You must be logged in to post a comment.