スポンサーリンク

Rails5.0.0.1とBootstrap4(その1)

OIAX社のRails5.0 初級①が出版されていたので、Kindleで購入して読んでみた。

(環境)
Windows8.1
VirtuaBox
Vagrant
Rails 5.0.0.1 (2016/8/11から、Rails 5.0.0.1にupdateされたらしい。)

(1)Railsのインストール

http://twosquirrel.mints.ne.jp/?p=7381

にしたがってやってみた。Railsのインストールのところで、

[sourcecode language=”bash” padlinenumbers=”true”]
gem install rails –version=5.0.0.1
gem install bundler
[/sourcecode]

とした。

image

Gemfileの # therubyracer … の#を消去して、bundle install

rails s -b 0.0.0.0

image

(2) ルーティング

image

(訂正前) config/routes.rb
image

(訂正後)
image

(3)hello_controller.rbの作成

app/controllers/ フォルダの下に、hello_controller.rb を作成

image

image

(4)app/views/ フォルダの下に、hello フォルダを作成し、helloフォルダの中に、show.html.erb ファイルを作成

image

image

(5)TeraTermで、rails s -b .0.0.0.0

ブラウザで、http://localhost:3000/hello を開く

image

(6)ページのソースを表示すると、以下のようになっている。

image

image

まだBootstrapを設定していないが、続きは今度、、、

スポンサーリンク

Rails5

Posted by twosquirrel