facebook twitter hatena line email

「Ruby/rails/サーバWEBrick」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(Admin がページ「Ruby/rails/サーバWEBrick起動」を「Ruby/rails/サーバWEBrick」に、リダイレクトを残さずに移動しました)
 
(同じ利用者による、間の6版が非表示)
行1: 行1:
以下のコメントアウトを外す
+
==weblick起動準備==
 
+
vi Gemfile
+
gem 'therubyracer', platforms: :ruby
+
 
+
 
  $ gem install bundler
 
  $ gem install bundler
 
  $ bundle install
 
  $ bundle install
 +
 +
==weblick起動==
 
  $ rails server
 
  $ rails server
  
行14: 行12:
 
==http==
 
==http==
 
ttp://localhost:3000でアクセス
 
ttp://localhost:3000でアクセス
 +
 +
==以下エラーが出る場合==
 +
Bundler Error Backtrace: from /home/linux/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:80:in `block (2 levels) in require'
 +
 +
以下のコメントアウトを外す
 +
 +
vi Gemfile
 +
gem 'therubyracer', platforms: :ruby
 +
 +
もう一度
 +
$ rails server
 +
 +
==環境別起動==
 +
$ rails server -e development
 +
$ rails server -e production
 +
$ rails server -e test
 +
$ rails server -e staging
 +
 +
==productionで実行する場合は==
 +
以下2つを実行し、unicornなどのアプリサーバを再起動する
 +
 +
[[ruby/rails/SECRET_KEY_BASE設定]] [ショートカット]
 +
 +
[[ruby/rails/assets作成]] [ショートカット]

2017年11月8日 (水) 05:39時点における最新版

weblick起動準備

$ gem install bundler
$ bundle install

weblick起動

$ rails server

port3000にアクセスできる

ctrl+cで停止

http

ttp://localhost:3000でアクセス

以下エラーが出る場合

Bundler Error Backtrace: from /home/linux/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:80:in `block (2 levels) in require'

以下のコメントアウトを外す

vi Gemfile

gem 'therubyracer', platforms: :ruby

もう一度

$ rails server

環境別起動

$ rails server -e development
$ rails server -e production
$ rails server -e test
$ rails server -e staging

productionで実行する場合は

以下2つを実行し、unicornなどのアプリサーバを再起動する

ruby/rails/SECRET_KEY_BASE設定 [ショートカット]

ruby/rails/assets作成 [ショートカット]