Tutorial to create a blog with Rails for beginners Part 2

What is this?

This is a continuation of Tutorial 1 to create a blog with Rails for beginners. Last time, I decided what to make. This time, we will do the initial setup of the project before moving on to implementation.

Contents of this work

This time we will do the following work

--Create a repository on Github --Install rails --rails project setup

environment construction of ruby

If you haven't built a Ruby environment yet, please set up a Ruby development environment by referring to the following pages.

--Mac Edition: https://prog-8.com/docs/ruby-env --Windows: https://prog-8.com/docs/ruby-env-win

Create a repository on Github

At this time, let's set gitignore to rails [^ 1]

[^ 1]: Doing this is useful because it ignores files that tend to be generated by rails but don't need (or shouldn't) be managed by git.

Rails installation

gem install rails Now you're ready to set up your rails project.

Rails project setup

Clone repository

git clone https://github.com/account name/rails-blog-sample.git

This will clone the repository at hand

Rails project initialization

cd rails-blog-tutorial
rails new .

You will be asked if you want to overwrite some files in rails new, so you can answer all with y.

Try it out

If the following atmosphere log is displayed on the console with rails server, try accessing http: // localhost: 3000 / with your browser. If you see a screen like Yay! You ’re on Rails!, You are successful. Exit with ctrl -c from the terminal On the contrary, if it doesn't look like this, something is wrong. At that time, try google or ask a part of the error message.

=> Booting Puma
=> Rails 6.0.3.1 application starting in development 
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.5 (ruby 2.5.5-p157), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
Use Ctrl-C to stop

Push the work contents so far

Now that we have created a rails project to develop our blog, we will push (upload) our work on github.

git add .
git commit -m 'rails new'
git push origin master

Now, even if the file at hand disappears, you can get the work contents so far from github. In this way, let's commit and push the work contents diligently.

This summary

--I made a repository on Github and cloned it at hand --I installed rails --I was able to check the operation with rails server after building the project with rails new

Next time, I will implement the "model" part that is needed to handle data in a web application.

Recommended Posts

Tutorial to create a blog with Rails for beginners Part 1
Tutorial to create a blog with Rails for beginners Part 2
Tutorial to create a blog with Rails for beginners Part 0
[Rails] rails new to create a database with PostgreSQL
[Rails] How to create a signed URL for CloudFront
[Spring Boot] How to create a project (for beginners)
Preparing to create a Rails application
[Rails] I tried to create a mini app with FullCalendar
[Rails Tutorial Chapter 5] Create a layout
I tried to make a message function of Rails Tutorial extension (Part 1): Create a model
A series of steps to create portfolio deliverables with Rails
I tried to make a message function of Rails Tutorial extension (Part 2): Create a screen to display
I made a reply function for the Rails Tutorial extension (Part 1)
I made a reply function for the Rails Tutorial extension (Part 5):
[Rails6] Create a new app with Rails [Beginner]
[Rails withdrawal] Create a simple withdrawal function with rails
How to create a Maven repository for 2020
[rails] How to create a partial template
[Rails 5] Create a new app with Rails [Beginner]
Tutorial 1 for building apps with Rails (First steps to Yay! You're on Rails!)
How to build a Ruby on Rails environment using Docker (for Docker beginners)
[Ruby on Rails] Create a pie chart for each column with Chartkick
[Docker] How to create a virtual environment for Rails and Nuxt.js apps
Create a LINEnews-style tech news summary app with Rails x LineBot! [Part 1]
Create a java web application development environment with docker for mac part2
I made a reply function for Rails Tutorial extension (Part 2): Change model
How to create a database for H2 Database anywhere
[Rails] Add page nation to table [For beginners]
[Rails] How to create a graph using lazy_high_charts
How to create pagination for a "kaminari" array
Create a team chat with Rails Action Cable
How to easily create a pull-down in Rails
[Rails] How to create a Twitter share button
Rails beginners tried to get started with RSpec
[For beginners] Procedure for creating a controller using rails
Create login / logout function with Spring Security according to Spring official guide [For beginners]
[Rails] Learning with Rails tutorial
How to implement login request processing (Rails / for beginners)
Create an EC site with Rails 5 ⑨ ~ Create a cart function ~
How to delete a new_record object built with Rails
Create a widget template for iOS14 with Intent Configuration.
How to manually generate a JWT with Rails Knock
[How to insert a video in haml with Rails]
How to get started with creating a Rails app
I want to create a generic annotation for a type
[Azure] I tried to create a Java application for free ~ Connect with FTP ~ [Beginner]
Docker command to create Rails project with a single blow in environment without Ruby
Create a blog with Jekyll and GitHub Pages @ Theme setting
I tried to create a java8 development environment with Chocolatey
I tried to introduce Bootstrap 4 to the Rails 6 app [for beginners]
How to create a lightweight container image for Java apps
I tried to make a reply function of Rails Tutorial extension (Part 3): Corrected a misunderstanding of specifications
[Rails] Create API to download files with Active Storage [S3]
Preparation for developing with Rails
Create a blog with Jekyll and GitHub Pages @ Initial Settings
Create a playground with Xcode 12
I want to create a form to select the [Rails] category
(For beginners) [Rails] Install Devise
How to test a private method with RSpec for yourself
Until you create a Web application with Servlet / JSP (Part 1)
I made a reply function for the Rails Tutorial extension (Part 4): A function that makes the user unique