Skip to content
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

Use "require: false" with rubocop in Gemfile #362

Open
dcki opened this issue Jun 7, 2017 · 1 comment
Open

Use "require: false" with rubocop in Gemfile #362

dcki opened this issue Jun 7, 2017 · 1 comment

Comments

@dcki
Copy link

dcki commented Jun 7, 2017

Is it possible to make rails_apps_composer add "require: false" for rubocop when adding it to a Gemfile?

A Rails app I work on was built a couple of months ago using this gem. I'm not sure exactly how the gem was used to create the project.

The resulting Gemfile checked in by a collaborator included the rubocop gem without specifying "require: false". In rubocop's README.md it says to specify "require: false" for rubocop if you put it in a Gemfile. Since this didn't happen there were "NameError: uninitialized constant Net::HTTP" errors in the production environment. (Fortunately this app has not been deployed to production yet.)

This is how the error occurred:

  • rubocop requires net/http.
  • rubocop is only in the development and test groups in the Gemfile created using rails_apps_composer, so rubocop and net/http were required in the development environment but not in the production environment.
  • Some code in the app referenced Net::HTTP without requiring it, and it worked in development so it was assumed it was correct.

This seems like a cool project, thanks for your work on it.

@DanielKehoe
Copy link
Member

Thanks for the alert. I'll follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants