summaryrefslogtreecommitdiff
path: root/bin/rails
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rails')
-rwxr-xr-xbin/rails15
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/rails b/bin/rails
index 0138d79b751..228f812ccaf 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,9 +1,14 @@
#!/usr/bin/env ruby
-begin
- load File.expand_path('../spring', __FILE__)
-rescue LoadError => e
- raise unless e.message.include?('spring')
+
+# Remove this block when upgraded to rails 5.0.
+unless %w[1 true].include?(ENV["RAILS5"])
+ begin
+ load File.expand_path('../spring', __FILE__)
+ rescue LoadError => e
+ raise unless e.message.include?('spring')
+ end
end
-APP_PATH = File.expand_path('../../config/application', __FILE__)
+
+APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'