Creating a new app is fairly simple, we just have to open the command line(windows) and type in:
cd #to change into the home directory
mkdir newapp #to make a new directory
cd newapp/ #to change into the “newapp” directory
rails new sample_app #lets us create a new rails application
As soon as we created the application, we can use SublimeText 3 to open it from the commandline too, with:
Along the way we want to use gems written in Ruby. Gems are basically advanced funcionalities that can provide our app with stuff like: User Authentication, Pagination, message systems, payment systems etc.
To install a gem , we have to navigate to https://rubygems.org/ and search for the gem we want to use and install it via our gemfile by copypasting things like: ” gem ‘devise’, ‘~> 4.2’ ”
after we copypasted we need to actually install it with the command:
After finishing the installation we can allready write Ruby on Rails locally with:
to see it in our browser we have to type: localhost:3000 in our adress bar.
# -> this is a ruby comment, which im using for commenting here too