DEV Community

Cover image for Rails guide - Creating the app - Part 1
Augusto Queirantes
Augusto Queirantes

Posted on • Updated on

Rails guide - Creating the app - Part 1

Hey guys! How are you?

That's the first article of a series that'll teach how to create a production ready Rails application. In this article we'll install Ruby, Rails and create the application.

Installing dependencies

The first thing to do is install Ruby and Rails, to do that we'll use a tool called RVM, it's used to install and manage different versions of Ruby.

Execute the command bellow to install Ruby and Rails latest versions:

\curl -sSL https://get.rvm.io | bash -s stable --rails
Enter fullscreen mode Exit fullscreen mode

You can verify if everything is ok running this two commands:

ruby --version
rails --version
Enter fullscreen mode Exit fullscreen mode

The output should look like this:

Ruby and Rails versions

Creating the project

Run the following command to create the application:

rails new rails_application --api --adapter=postgresql
Enter fullscreen mode Exit fullscreen mode

Now that the application is created we need to go to its directory using this command:

cd rails_application
Enter fullscreen mode Exit fullscreen mode

Testing it out

The next step is test the application, to do so you'll need to run the server using the above command:

rails s
Enter fullscreen mode Exit fullscreen mode

If everything is ok you should be able to see somehting like this when you access http://localhost:3000

Rails home screen

That's it, guys! See you soon in the next part. You can find the code here

Top comments (0)