-
Notifications
You must be signed in to change notification settings - Fork 901
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
After installing paper_trail, get "irb: warn: can't alias context from irb_context." from rails console #381
Comments
Hmm, that is odd. Does this still happen if you comment out the If you haven't already, you might try bundling the Sorry for the delayed response, I've been in the middle of a move which has been keeping me swamped. |
No problem! You're the one doing me a favor :) I'm using If I comment out So somehow, adding the gem itself is what's causing the problem. One other developer on my team has the same problem as well. Is there any other information I can provide? |
I'm getting the same issue in |
Also, can you share your |
I'm also using
|
Just copied that Gemfile into my test app, re-bundled, and ran rails c (but swapped in sqlite3 for MySql) and everything seemed to work fine. I'm also running on mavericks so I really don't know what the issue is. There is no stack trace available beyond that one warning message? |
No stack trace, unfortunately -- it prints on the command line.
The other thing I just found though, is that if I comment out |
Hmm... What does your |
It's actually one gigantic block of comments.
|
This is our
|
Are you able to run specs? Was this an app that you recently upgraded to |
I've posted my findings in the related SO question. HTH! |
@wicz - I think I understand what you are saying, however, I'm not sure what the proper solution is here? Are you saying that we should stop loading the RSpec helpers automatically if RSpec is >= version 3? When is the proper time to load these helpers in? Or the users are supposed to now manually include them using a |
Well, I wouldn't call it the proper solution, but one solution. Mostly because it is based on my personal taste of not loading things automatically and letting users decide to do what and when. And it's your gem after all, so it's yours the final call. Anyway, my suggestion is to let users manually I see |
@wicz - Fair enough. I think I'm starting to agree with you that it makes the most sense to have the RSpec helper includes be optional. For many years I used gems like FactoryGirl, CarrierWave, Capybara, etc. where they had RSpec helpers which automatically got loaded when running RSpec but I know that when we made the transition to having RSpec helpers automatically loaded after v3.0.0, some complained that it lacked the control they desired. I think it makes sense to let the users load it manually as they desire, so I'll target that for v3.1.0. |
Great! 👍 |
👍 from me as well 😄 |
@waynn - just to clarify, this is just a warning, it doesn't totally break the console, correct? This is the next issue I want to work on though. Seems like the ideal solution is updating syntax to be compatible and also making it an optional/manual include. |
Yeah, it's just a warning, and the console doesn't break. On Wed, Oct 8, 2014 at 9:04 PM, Ben Atkins [email protected] wrote:
|
@wicz - Can you link me to a wiki or page describing the approach FactoryGirl takes? I just checked out their README and don't see something referencing manually requiring a helper onto your Mainly I'm just trying to figure out whether my instructions will need to tell users to require the helper AFTER they have declared their own |
Hello @batter, I'm taking the next days off and will be completely offline. Could you wait until Monday, so I could give you more precise information? |
Sure, in the meantime I'll work on a feature branch and play around with it myself. |
Hey @batter, here are my findings. Just as I suspected, # rspec_then_irb.rb
require "irb"
require "rspec/core"
require "rspec/matchers"
IRB.start
# bundle exec ruby rspec_then_irb.rb
# irb: warn: can't alias context from irb_context.
# irb(main):001:0> And we happen to see this warning when loading the This doesn't happen with other gems, e.g. If we make users to manually load My tests show that we can achieve this by instructing users to manually HTH! |
I've tested this by running
rails c
both before and aftergit stash
. On Rails 4.1 in Mavericks, after following the instructions to add theversions
table and addinghas_paper_trail
to three models, whenever I runrails c
I getI've spent some time Googling without much luck, there's old threads talking about
rspec
, but I don't see how that's relevant since I'm not using it. Any ideas why this is happening?The text was updated successfully, but these errors were encountered: