Yahya To DevOps

Logo

Cloud and DevOps Blogging Archive.

View the Project on GitHub yaya2devops/cloudblog

Quickstart Ruby On Rails

Introduction

Whether you are a beginner looking to learn your first programming language, or an experienced developer looking to add Ruby to your toolkit, this post will give you the knowledge you need to get started. So let’s dive in and learn how to use Ruby!

Let’s explain 2 critical points:

To start building a web application with Ruby on Rails, you will need to do the following:

Install Ruby and Rails: You will need to have the Ruby programming language and the Rails web development framework installed on your machine. You can install them using a package manager such as rbenv or rvm, or you can download and install them manually.

Install Ruby

ruby -v

Install Rails

To start building an app with Ruby on Rails, you will need to install Rails itself. You can do this by running the following command in your terminal:

gem install rails

This will install Rails and all of the dependencies needed to build a Rails app.

Once Rails is installed, you can create a new Rails app by running the following command:

rails new myapp

This will create a new directory called myapp with the basic structure of a Rails app and it looks something like this:

To start the Rails development server, navigate to the myapp directory and run the following command:

cd myapp
rails server

This will start the Rails development server, and you can view your app by visiting http://localhost:3000 in your web browser.

You can then start building your app by following the steps in the Ruby on Rails tutorial; simply click on the logo in the middle and it will direct you to the tuto where it will guide you through the process of building a complete Rails app from start to finish.

Good job, what’s next?

Ruby is the driving force behind websites like Twitter. There’s a lot more to it than that. You can investigate the following:

rails db:migrate

Our new app is now live at /posts.

Go further to Test and debug your application, as you are building you will want to ensure that it is functioning correctly. You can use tools such as the Rails console and the debugger to test and debug your application.

Once all ready, deploy your application, go ahead deploy it to a web server!

There are many options for hosting Rails applications, including hosting providers such as Azure, Heroku or AWS among MANY OTHERS!