Getting Started
Goals
Steps
Step 1
Option 1.1: Windows
Type this in the terminal:cd c:\SitesOption 1.2: Mac or Linux
Type this in the terminal:cd ~Step 2
Type this in the terminal:mkdir railsbridgeStep 3
Type this in the terminal:cd railsbridgeStep 4
OSX/LinuxType this in the terminal:lsType this in the terminal:rm -rf suggestotronWindowsType this in the terminal:dirType this in the terminal:rmdir /s /q suggestotronStep 5
Option 5.1: Without Docker
Type this in the terminal:rails new suggestotronType this in the terminal:cd suggestotronOption 5.2: With Docker
Type this in the terminal:mkdir suggestotronType this in the terminal:cd suggestotronsource "https://rubygems.org" gem "rails", "5.2.0"Type this in the terminal:touch Gemfile.lockFROM ruby:2.5.1-slim RUN apt-get update -qq && apt-get install -y build-essential libpq-dev git vim nodejs postgresql-client build-essential ENV APP_HOME /suggestotron RUN mkdir -p $APP_HOME WORKDIR $APP_HOME COPY Gemfile* $APP_HOME/ RUN bundle install COPY . $APP_HOMEversion: '3' services: db: image: postgres:10.3 volumes: - db_data:/var/lib/postgresql/data web: build: . environment: DATABASE_URL: db tty: true stdin_open: true volumes: - .:/suggestotron command: bash -c 'rm -rf /suggestotron/tmp/pids/server.pid && bin/rails s -p 3000 -b 0.0.0.0' ports: - "3000:3000" depends_on: - db volumes: db_data: driver: local.git .dockerignore .byebug_history log/* tmp/* Dockerfile README.mdType this in the terminal:docker-compose run web rails new . --force --database=postgresqlType this in the terminal:docker-compose builddefault: &default adapter: postgresql encoding: unicode username: postgres password: pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> host: <%= ENV.fetch("DATABASE_URL") %> development: <<: *default database: suggestotron_development test: <<: *default database: suggestotron_test production: <<: *default database: suggestotron_production password: <%= ENV['APP_DATABASE_PASSWORD'] %>Type this in the terminal:docker-compose run web rails db:createType this in the terminal:docker-compose run web rails db:migrateStep 6
File/Folder Purpose app/ Contains the controllers, models, and views for your application. You will do most of your work here. config/ Configure your application's runtime rules, routes, database, and more. db/ Shows your current database schema, as well as the database migrations. public/ The only folder seen to the world as-is. If you put files in here, they will be served directly without any processing by Rails. app/assets/ This is where your images, JavaScript, stylesheets (CSS), and other static files should go. Modern Rails apps use something called the Assets Pipeline, which combines all the JavaScript and CSS files in this directory into a single file for speediness.
Next Step:
Go on to Add The Project To A Git Repo