rspec-rails: irb: warn: can't alias context from irb_context. (3.5.0.beta4 and 3.5.0 final)
Hey,
After upgrading from 3.5.0.beta3 to 3.5.0.beta4 I receive a warning when using the rails console command like:
bundle exec rails console
Loading development environment (Rails 5.0.0.rc2)
irb: warn: can't alias context from irb_context.
irb(main):001:0>
Version beta3 works well, the warning is only visible in beta4.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 9
- Comments: 18 (9 by maintainers)
Commits related to this issue
- Revert "Ensure rspec core is loaded if rspec-rails is." This reverts commit 994cb7afa8919c5f4560c8b765867b2aac15c192. The original fix was never shown to have fixed anything, and looks to have trigg... — committed to rspec/rspec-rails by myronmarston 8 years ago
- Revert "Ensure rspec core is loaded if rspec-rails is." (#1678) This reverts commit 994cb7afa8919c5f4560c8b765867b2aac15c192. The original fix was never shown to have fixed anything, and looks to... — committed to rspec/rspec-rails by myronmarston 8 years ago
- Revert "Ensure rspec core is loaded if rspec-rails is." (#1678) This reverts commit 994cb7afa8919c5f4560c8b765867b2aac15c192. The original fix was never shown to have fixed anything, and looks to ha... — committed to rspec/rspec-rails by myronmarston 8 years ago
- Revert "Ensure rspec core is loaded if rspec-rails is." (#1678) This reverts commit 994cb7afa8919c5f4560c8b765867b2aac15c192. The original fix was never shown to have fixed anything, and looks to... — committed to futurelearn/rspec-rails by myronmarston 8 years ago
- Fix irb_context in rails console Don’t require rspec_junit_formatter gem It’s only needed when running tests (for circleci). It messes with the console, when running `rails c` it causes this warnin... — committed to betagouv/place-des-entreprises by n-b 5 years ago
- Fix irb_context in rails console Don’t require rspec_junit_formatter gem It’s only needed when running tests (for circleci). It messes with the console, when running `rails c` it causes this warning:... — committed to demarches-simplifiees/demarches-simplifiees.fr by n-b 5 years ago
I’m still having issues with:
[EDIT] Just learned many other gems could cause this — I will investigate this further.
Happened via
guard-rspecfor me. See https://github.com/guard/guard-rspec/issues/396.gem 'guard-rspec', require: falsefixed this.That warning is coming from IRB here:
https://github.com/ruby/ruby/blob/32674b167bddc0d737c38f84722986b0f228b44b/lib/irb/extend-command.rb#L188
It’s apparently happening because rspec-core, when loaded, defines
contexton the top level unless you disable monkey patching.Can you provide a repo that repros this? I tried reproing it in isolation and have failed so far.