Skip to content

Fix NameError if only 'railties' (not 'rails') gem is installed#58

Open
ojab wants to merge 1 commit intoalexrothenberg:mainfrom
ojab:master
Open

Fix NameError if only 'railties' (not 'rails') gem is installed#58
ojab wants to merge 1 commit intoalexrothenberg:mainfrom
ojab:master

Conversation

@ojab
Copy link

@ojab ojab commented Oct 26, 2016

If a project depends on 'ammeter' and 'railties', require 'ammeter/init' fails with

 NameError: uninitialized constant ActionView::Template::Handlers::ERB::ENCODING_FLAG

We need only 'rails/engine', so let's require it explicitly.

If a project depends on 'ammeter' and 'railties', `require 'ammeter/init'`
fails with
  NameError: uninitialized constant ActionView::Template::Handlers::ERB::ENCODING_FLAG
We need only 'rails/engine', so let's require it explicitly.
@ojab
Copy link
Author

ojab commented Oct 26, 2016

…and I can't find any more or less proper way to fix the same in up-to-date rspec-rails so far, unfortunately, but I hope that PR will be pulled and this issue will be fixed in ammeter codebase at least.

Base automatically changed from master to main February 24, 2021 16:13
@KellyBennett
Copy link

I'm facing this same issue. I thought about forking this gem until this issue is fixed, but when I tried your fix @ojab , it didn't work for me. I get the same error from the require 'rspec/rails' statement 😢

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

Successfully merging this pull request may close these issues.

2 participants