This problem has been around since before I can remember, and it's
only a problem with _one_ rails application. I have stepped through
the code and used Unroller to no avail, b/c the "irb:warn" occurs
within irb itself.
I'm guessing I haven't given enough information, so please tell me
what (if anything) you guys need to help.
Loading development environment (Rails 2.1.0)
irb: warn: can't alias context from irb_context.
exit
Finished in 0.039212 seconds
0 examples, 0 failures
weird, right? And it doesn't happen w/ script/server.
The test runs are generally caused by requiring test/unit outside of
your tests. It adds code to run at exit. The warning is something
I've never seen before.
I'm guessing I haven't given enough information, so please tell me
what (if anything) you guys need to help.
Odds are it's caused by one of your plugins. Try disabling them one
by one until you find which one is causing these messages.
Odds are it's caused by one of your plugins. Try disabling them one
by one until you find which one is causing these messages.
I tried ditching my whole /vendor directory, and got the same two
problems. But, I have another idea: I don't get 'the test problem'
when I boot the rails server (both mongrel and WEBrick). Presumably
the code that loads test/unit i loaded for the app's console, but not
the app's server. Also, presumably not much code can meet this
criteria.
Anybody know what said code is?
and oh yea:
egrep -R "^require.+test\/unit" *
from RAILS_ROOT doesn't give me anything outside of /vendor.
are you requiring rspec in yr environment.rb? i've seen someone do
this and get similar errors. [if you are... just remove that line,
rspec will load itself in test environment.]
Although I'm too smart to require rspec at boot, I'm too stupid to
realize that's exactly what's happening when I pull a
config.gem 'rspec' , :lib => 'spec'
I took rspec, rcov, syntax and all my testing stuff out of that
list, and needless to say, BOTH problems were solved.
The only part that sucks is that apparently I can't use Rails 2.1 to
manage my apps' gem dependencies (automated installation/freezing) if
they're not supposed to be loaded at boot.
Any ideas on how to do that? Does gems on rails do it?
I was obviously using gem dependency management for the wrong thing
part of the time. I froze all gems needed by a developer into /vendor/
gems so that everything needed would be available out-of-box, and so
everybody's using the same gems/rails versions (rspec in particular
can be quite finicky about versions).
So yea, ideas on how to do that? It's not a super-huge problem, since
as long as I don't reference rspec & company in environment.rb, I get
no problems, even if they exist in /vendor/gems and /vendor/plugins
(which they still do).
Or use GemInstaller (http://geminstaller.rubyforge.org/) via
preinitializer.rb, if you still cannot get things loaded in the order
you need. preinitializer.rb happens before boot or any of the env
files are parsed...
i use vendor/plugins/rspec and rspec-rails [cause i use edge a decent
amount] so it's never been an issue. i've had a few vendor/gems before
but they all just worked with config.gem out of the box. [thank you
rails team!] what's the specifics on the gem that's not loading right?
I had a similar problem and I finally traced it down to the way I
named and loaded my models. I don't know if this applies to your
situation it might give you a clue.
I had a model Spec::AppComponent which is used in a platform system we
were building. When that model was referenced in the initialzers it
would cause the errors described above to occur. When I renamed the
model to AppComponent the issue disappeared. My guess, is that
because I have rspec as a plugin, that the reference to the Spec
module is somehow causing rspec to load. Hope this helps.