学生向けプログラミング入門 | 無料

学生向けにプログラミングを無料で解説。Java、C++、Ruby、PHP、データベース、Ruby on Rails, Python, Django

【民泊5.1】【MacOSX】コンパイル

Webページで画像を表示するにはコンパイルする必要があります。


まずはシークレットキーを表示します。


コマンド
rails secret


シークレットキーが表示されるのでコピーします。

% rails secret
0ee5d57b712c7ffb1386e48a7339ed4a29dd45d9b178823fd557e2b943da511e493c77ca0c8cd6b0b9766e8d83224cd7c6c30462c0131ad15e046f048c39b5ae



「config\secrets.yml」の「production」部分にコピーしたシークレットキーを貼り付けます。(22行目)


記述変更 config\secrets.yml

# Be sure to restart your server when you modify this file.

# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.

# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

development:
  secret_key_base: 2139b49ebaebb920b09186c74b0729201769c50e1529507f3e349c3542b5697832a13b012e7be211a54bdc7ab22eb2e97fc2ab36e92b81b21857133e321ee8fc

test:
  secret_key_base: 68e6f37c87e6739345af5d97a1d90f55f7f4ddf10388ee47b568045dc732ce76fbb481262aff938cbaf3011d50079367fd77f8b67964874f2253ab660131dcc5

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: b670a9c37794185ee89dc7a319db8ba11bb0cc4e84aee5bbb1c5d7866fe0b7679ffe36f89991234c6028cfae5d5c6cfe5de9981a73d935e166758ec30ff8b0b0
  # secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>



以下のコマンドを実行してコンパイルを行います。


コマンド
rails assets:precompile RAILS_ENV=production


Gitにコミットします。


ソース管理を選択します。

ソース管理
ソース管理



「+」をクリックして全ての変更をステージします。

全ての変更をステージ
全ての変更をステージ



コミットネームを入力します。

コミットネームを入力
コミットネームを入力



チェックマークをクリックしてコミットします。

コミット
コミット



下部にある同期ボタンをクリックしてGitと同期します。

Gitと同期
Gitと同期



Gitページの確認

ご自分のGitページを確認して下さい
ご自分のGitページを確認して下さい