LoginSignup
1
1

More than 3 years have passed since last update.

Ruby 導入コマンド達

Posted at

自分用に作成

brew、mysql、Bundlerが必要

ここでやるのは作業ディレクトリにRailsをインストールしてWebサーバーを立ち上げるところまで。

ディレクトリの作成
$ mkdir sample
$ cd sample
$ bundle init

ディレクトリに入っているGemfileを編集

Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "rails" ここがコメントアウトされているので解除する

Railsインストール
$ bundle install --path=vendor/bundle
$ bundle exec rails -v
 Rails 6.0.0

ちゃんと作成できているか確認するためにRailsのチュートリアルにつなげる

Railsのアプリ作成
$ bundle exec rails new blog

起動
$ cd blog
$ rails server
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1