Skip to content

Commit 4fcd610

Browse files
committed
Remove setting RAILS_ENV from RACK_ENV
Per #3200
1 parent f17442f commit 4fcd610

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

lib/install/bin/webpack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require "bundler/setup"
55
require "webpacker"
66
require "webpacker/webpack_runner"
77

8-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
8+
ENV["RAILS_ENV"] ||= "development"
99
ENV["NODE_ENV"] ||= "development"
1010
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
1111

lib/install/bin/webpack-dev-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22

3-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
3+
ENV["RAILS_ENV"] ||= "development"
44
ENV["NODE_ENV"] ||= "development"
55

66
require "pathname"

test/mounted_app/test/dummy/bin/yarn

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env ruby
2+
3+
APP_ROOT = File.expand_path("..", __dir__)
4+
Dir.chdir(APP_ROOT) do
5+
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
6+
select { |dir| File.expand_path(dir) != __dir__ }.
7+
product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"]).
8+
map { |dir, file| File.expand_path(file, dir) }.
9+
find { |file| File.executable?(file) }
10+
11+
if yarn
12+
exec yarn, *ARGV
13+
else
14+
$stderr.puts "Yarn executable was not detected in the system."
15+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
16+
exit 1
17+
end
18+
end

test/test_app/bin/webpack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22

3-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
3+
ENV["RAILS_ENV"] ||= "development"
44
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
55

66
require "pathname"

test/test_app/bin/webpack-dev-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22

3-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
3+
ENV["RAILS_ENV"] ||= "development"
44
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
55

66
require "pathname"

0 commit comments

Comments
 (0)