0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ralisでのアプリケーション作成の流れ(第1章)

Posted at

はじめに

この記事はRuby on Railsを学習して二か月の超初心者が作成している記事です。
ある程度の大まかな流れが分かってきたので、アウトプットの意味も込めて記事にしました。
誤字脱字、間違った解釈をしている内容に関しては、修正またはご指摘をお願いします。


使用するクラウド

AWS cloud9

使用するデータベース

mysqld


作成前準備

・mysql関連ファイルのインストール

ターミナル.
$ sudo yum install mysql-devel

・mysqlの実行

ターミナル.
$ sudo service mysqld start

・ bundlerのインストール

ターミナル.
$ gem install bundler
# bundler=Gemを管理するためのGem

・ruby on railsのインストール

ターミナル.
$ gem install rails --version="5.2.1"

新規アプリケ―ションの作成

・アプリケーション作成

ターミナル.
$  rails new アプリケーション名 -オプション名

・今回のdbはmysqldを使用するのでオプションのところにmysqldを指定する

ターミナル.
$ rails new アプリケーション名 -d mysql

実行後、ディレクトリにmysqlというデータベースに最適化された設定でアプリケーションが生成される。

railsアプリケーション

・rails new で作成したアプリケーションは、アプリケ―ション名のディレクトリが作成される。
・ディレクトリ以下のファイル全てrailsアプリケーションという

Gemの追加

・Gemの追加は「Gemfile」に「gem ‘Gem名’」と追記する。

Gemfile.
gem 'gem名'

・追加後「bundle install」コマンドを実行する。

ターミナル.
$ bundle instll

ここで第一章は終了。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?