aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorNathan Wenneker <nathan@preferral.com>2017-07-26 19:12:52 -0600
committerNathan Wenneker <nathan@preferral.com>2017-07-26 19:33:24 -0600
commita5da9d92e1dd85ae5a3e7cb223158c6551d8958c (patch)
treea23c0d79c1ec6c8ebd658b984b3588053499057d /railties
parentd3c1266c338c3a37181c0a131c7d983e5e30c8d0 (diff)
downloadrails-a5da9d92e1dd85ae5a3e7cb223158c6551d8958c.tar.gz
rails-a5da9d92e1dd85ae5a3e7cb223158c6551d8958c.tar.bz2
rails-a5da9d92e1dd85ae5a3e7cb223158c6551d8958c.zip
Improve bundler binstub error message
Rails displays an error message if you have a bundler-generated binstub at `./bin/rails` instead of a Rails-generated binstub. This error message is misleading because it makes it seem as though Rails 5 introduced recent changes in how binstubs are used, when these changes were actually introduced way back in Rails 4. The suggested upgrade steps are appropriate for an app that was created in Rails 3, but they likely aren't the correct fix for someone who sees this error message today on a modern app. I believe the `--binstubs` option on bundler is a more likely culprit and troubleshooting path.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/app_loader.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/railties/lib/rails/app_loader.rb b/railties/lib/rails/app_loader.rb
index 3dc4fe5414..a5d22fa9bc 100644
--- a/railties/lib/rails/app_loader.rb
+++ b/railties/lib/rails/app_loader.rb
@@ -10,13 +10,19 @@ module Rails
BUNDLER_WARNING = <<EOS
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
-In Rails #{Rails::VERSION::MAJOR}, your app's bin/ directory contains executables that are versioned
+Beginning In Rails 4, your app's bin/ directory contains executables that are versioned
like any other source code, rather than stubs that are generated on demand.
-Here's how to upgrade:
+If your application was created in Rails 4+, you might be seeing this message
+if your bundle install command is using the --binstubs option and thereby overriding the
+standard Rails bin/rails binstub. You might need to stop using the --binstubs option,
+or at least ensure that it is using a path other than ./bin. You may need to coordinate
+this change with your environment's PATH.
+
+If your application was created prior to Rails 4, here's how to upgrade:
bundle config --delete bin # Turn off Bundler's stub generator
- rails app:update:bin # Use the new Rails 5 executables
+ rails app:update:bin # Use the new Rails executables
git add bin # Add bin/ to source control
You may need to remove bin/ from your .gitignore as well.