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:
    development:
      adapter: mysql2
      encoding: utf8
      database: blog_development
      pool: 5
      username: root
      password:
      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.


Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 17

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 17

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 17

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 45

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 45

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 47

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 47

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/content/61/4091161/html/wptalreg/wp-content/plugins/vsf-simple-stats/vsf_simple_stats_shutdown.php on line 47