Skip to content

Commit

Permalink
Try redefine env for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
majioa committed Oct 22, 2017
1 parent 614c940 commit 1f62515
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 1 addition & 3 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# This file is used by Rack-based servers to start the application.

e = "{config.ru}: rails_env: #{rails_env}, ENV[RAILS_ENV]: #{ENV['RAILS_ENV']}"
$stderr.puts e
$stdout.puts e
$stdout.puts "{config.ru}: ENV[RAILS_ENV]: #{ENV['RAILS_ENV']}"

require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
12 changes: 8 additions & 4 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
require "active_record"

rails_env = Rails.env.to_s
environment rails_env

e = "{puma.rb}: rails_env: #{rails_env}, ENV[RAILS_ENV]: #{ENV['RAILS_ENV']}"
$stderr.puts e
$stdout.puts e
if ! ENV['RAILS_ENV']
# required in prod since it is blank
ENV['RAILS_ENV'] = Rails.env = rails_env = 'production'
end

$stdout.puts "{puma.rb}: rails_env: #{rails_env}, ENV[RAILS_ENV]: #{ENV['RAILS_ENV']}"

environment rails_env

if Rails.env.production?
app_dir = File.expand_path("../..", __FILE__)
Expand Down

0 comments on commit 1f62515

Please sign in to comment.