-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails/Present Autocorrect breaks bin/bundle #104
Comments
Perhaps rubocop-rails should ignore anything in |
Resolves rubocop#104. `bin/bundle` was generated by Bundler. And Bundler doesn't depend on Active Support (Rails). This PR prevents the following error. ```console % cd path/to/new-rails-app % bin/rails -v Rails 6.0.0.rc2 % bundle exec rubocop -a --only Rails/Present % g diff diff --git a/bin/bundle b/bin/bundle index 4f5e057..fa7b83b 100755 --- a/bin/bundle +++ b/bin/bundle @@ -39,7 +39,7 @@ m = Module.new do def gemfile gemfile = ENV["BUNDLE_GEMFILE"] - return gemfile if gemfile && !gemfile.empty? + return gemfile if gemfile.present? File.expand_path("../../Gemfile", __FILE__) end % ./bin/bundle Traceback (most recent call last): 2: from ./bin/bundle:101:in `<main>' 1: from ./bin/bundle:71:in `load_bundler!' ./bin/bundle:42:in `gemfile': undefined method `present?' for nil:NilClass (NoMethodError) ```
I agreed and opened a PR #108. |
[Fix #104] Exclude Rails-independent `bin/bundle` by default
RuboCop Rails 2.3.1 has been released to resolve this issue. Thank you. |
I'm not sure that #108 is sufficient if you have already have an I hit this very problem and I'm on rubocop-rails 2.3.1 |
Rubocop autocorrect previously mangled this file which caused deploys to break. See rubocop/rubocop-rails#104
Rubocop auto-correction breaks some binstubs. See: rubocop/rubocop-rails#104 and https://github.com/sul-dlss/argo/pull/1585/files This is preventing Puma from running in containerland.
Same here, I am using rubocop-rails (2.23.1) |
👋 @ismailarilik this was closed over 4 years ago – it would be better to open a new issue. |
Autocorrect for
Rails/Present
introduces an error in a default railsbin/bundle
because the Rails libraries are not loaded at that point in the loading process.Note that this is using ruby 2.7.0-preview1 and edge rails.
Actual behavior
Steps to reproduce the problem
At this point,
bin/bundle
works:bin/bundle
:RuboCop version
The text was updated successfully, but these errors were encountered: