Quote Rails Tutorial
$ echo "gem: --no-document" >> ~/.gemrc
To install Rails, use the gem command. I've added settings to the command to avoid wasting time installing Ruby documentation.
$ gem install rails -v 6.0.3
Installed with version 6.0.3
$ rails -v
# Rails 6.0.3
Check the version (check if it matches if specified and installed)
$ source <(curl -sL https://cdn.learnenough.com/yarn_install)
Your Yarn packages are out of date!
Please run `yarn install --check-files` to update.
$ yarn install --check-files
Do the above and it's OK
$ cd #Move to project home directory
$ mkdir environment #Create environment directory
$ cd environment/ #Move to the created environment directory
$ rails _6.0.3_ new <app name>
Quote Rails Tutorial Table 1.2: Overview of Default Rails Directory Configuration (https://railstutorial.jp/)
|Key application code including models, views, controllers, helpers, etc.
|Database related files
|Application documentation, such as manuals
|Library and module storage
|Application log file
|Data to be published directly to the general public (Web browser, etc.) such as error pages
|Rails scripts used for code generation, console launch, local web server launch, etc.
|A brief description of the application
|Gem definition file required for this application
|List to check the version of gem used by the application
|Configuration file for Rack middleware
|A pattern for specifying files that you don't want to include in Git
A bundler is a gem that manages gem versions and gem dependencies. By using bundler, you can develop with multiple people or even if the gem version goes up without causing an error.
Since the gem used differs depending on each development environment, enter the required gem. (Example bootsnap, byebug, etc.)
$ cd hello_app/
$ bundle install
If you get an error saying [bundle update], run bundle update first
This is the environment construction.