Michael Koziarski
2008-Oct-10 11:00 UTC
Re: can''t run: rake gems:install if application.rb depends on initializers
> In general a task that installs a gem shouldn''t need to rely on much.The gem tasks depend on the initializer firing up because they allow things like config.gem ''rspec'' in test.rb but not development.rb. Can you reproduce this in an empty test app? So unless I''m misreading this, it seems we''re requiring application.rb before we try to run the gem installs, but we *haven''t* fired the initializers yet? Is it perhaps caused by one of your plugins (rspec f.ex) requiring application.rb? -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Stephen Bannasch
2008-Oct-10 19:08 UTC
can''t run: rake gems:install if application.rb depends on initializers
At 1:00 PM +0200 10/10/08, Michael Koziarski wrote:> > In general a task that installs a gem shouldn''t need to rely on much. > >The gem tasks depend on the initializer firing up because they allow >things like config.gem ''rspec'' in test.rb but not development.rb. Can >you reproduce this in an empty test app?This problem is NOT reproducible in a simple test app: rails test2_1_1 cd rails2_1_1 echo ''MY_CONSTANT = true'' > config/initializers/test2_1_1.rb add: if MY_CONSTANT puts "MY_CONSTANT exists" end to app/application.rb add to end of Rails::Initializer.run do |config| block: config.gem "rspec-rails", :lib => "spec" $ rake gems:install (in /Users/stephen/dev/rails/test2_1_1) MY_CONSTANT exists $ rake gems:unpack (in /Users/stephen/dev/rails/test2_1_1) MY_CONSTANT exists Unpacked gem: ''/Users/stephen/dev/rails/test2_1_1/vendor/gems/rspec-rails-1.1.8''>So unless I''m misreading this, it seems we''re requiring application.rb >before we try to run the gem installs, but we *haven''t* fired the >initializers yet? > >Is it perhaps caused by one of your plugins (rspec f.ex) requiring >application.rb? >--There''s something different between the apps -- -- I will investigate further -- if I find anything further that might indicate a rails problem I''ll update this thread. Thanks for your response. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Kenneth Kalmer
2008-Nov-24 12:38 UTC
Re: can''t run: rake gems:install if application.rb depends on initializers
On Fri, Oct 10, 2008 at 9:08 PM, Stephen Bannasch <stephen.bannasch@deanbrook.org> wrote:>>So unless I''m misreading this, it seems we''re requiring application.rb >>before we try to run the gem installs, but we *haven''t* fired the >>initializers yet? >> >>Is it perhaps caused by one of your plugins (rspec f.ex) requiring >>application.rb? >>-- > > There''s something different between the apps -- -- I will investigate further -- if I find anything further that might indicate a rails problem I''ll update this thread.Stephen, did you ever figure out what caused the issue? Battling with it now and trying to find the offending piece of code loading application.rb Best -- Kenneth Kalmer kenneth.kalmer@gmail.com http://opensourcery.co.za --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Cruft
2008-Nov-25 13:26 UTC
Re: can''t run: rake gems:install if application.rb depends on initializers
I''ve seen this behavior as well: my initializers were not being run during a gem install, but application.rb was being required. Inside initializer.rb, the "gems_dependencies_loaded" test was not being met and so the "load_application_initializers" method had no effect. In my case, the initializers were defining some constants needed for application.rb. I resorted to installing the gem manually. -Chris On Oct 10, 6:00 am, "Michael Koziarski" <mich...@koziarski.com> wrote:> > In general a task that installs a gem shouldn''t need to rely on much. > > The gem tasks depend on the initializer firing up because they allow > things like config.gem ''rspec'' in test.rb but not development.rb. Can > you reproduce this in an empty test app? > > So unless I''m misreading this, it seems we''re requiring application.rb > before we try to run the gem installs, but we *haven''t* fired the > initializers yet? > > Is it perhaps caused by one of your plugins (rspec f.ex) requiring > application.rb? > -- > Cheers > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
matthewrudyjacobs@gmail.com
2008-Nov-25 23:31 UTC
Re: can''t run: rake gems:install if application.rb depends on initializers
I''ve seen something similar, where application.rb gets required when I''m trying to run rake db:migrate. I guess there''s some plugin we''re all using. On Nov 25, 1:26 pm, Chris Cruft <c...@hapgoods.com> wrote:> I''ve seen this behavior as well: my initializers were not being run > during a gem install, but application.rb was being required. Inside > initializer.rb, the "gems_dependencies_loaded" test was not being met > and so the "load_application_initializers" method had no effect. > > In my case, the initializers were defining some constants needed for > application.rb. I resorted to installing the gem manually. > > -Chris > > On Oct 10, 6:00 am, "Michael Koziarski" <mich...@koziarski.com> wrote: > > > > In general a task that installs a gem shouldn''t need to rely on much. > > > The gem tasks depend on the initializer firing up because they allow > > things like config.gem ''rspec'' in test.rb but not development.rb. Can > > you reproduce this in an empty test app? > > > So unless I''m misreading this, it seems we''re requiring application.rb > > before we try to run the gem installs, but we *haven''t* fired the > > initializers yet? > > > Is it perhaps caused by one of your plugins (rspec f.ex) requiring > > application.rb? > > -- > > Cheers > > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Kenneth Kalmer
2008-Nov-26 05:49 UTC
Re: can''t run: rake gems:install if application.rb depends on initializers
Please have a look at http://groups.google.com/group/rubyonrails-core/browse_thread/thread/73f21c47d114b88e I managed to split this thread when changing the subject. On edge, application.rb won''t be loaded by default anymore (Matt did give the details), so it''s not a plugin issue at all. Best On Wed, Nov 26, 2008 at 1:31 AM, matthewrudyjacobs@gmail.com <matthewrudyjacobs@gmail.com> wrote:> > I''ve seen something similar, > where application.rb gets required when I''m trying to run rake > db:migrate. > > I guess there''s some plugin we''re all using. > > On Nov 25, 1:26 pm, Chris Cruft <c...@hapgoods.com> wrote: >> I''ve seen this behavior as well: my initializers were not being run >> during a gem install, but application.rb was being required. Inside >> initializer.rb, the "gems_dependencies_loaded" test was not being met >> and so the "load_application_initializers" method had no effect. >> >> In my case, the initializers were defining some constants needed for >> application.rb. I resorted to installing the gem manually. >> >> -Chris >> >> On Oct 10, 6:00 am, "Michael Koziarski" <mich...@koziarski.com> wrote: >> >> > > In general a task that installs a gem shouldn''t need to rely on much. >> >> > The gem tasks depend on the initializer firing up because they allow >> > things like config.gem ''rspec'' in test.rb but not development.rb. Can >> > you reproduce this in an empty test app? >> >> > So unless I''m misreading this, it seems we''re requiring application.rb >> > before we try to run the gem installs, but we *haven''t* fired the >> > initializers yet? >> >> > Is it perhaps caused by one of your plugins (rspec f.ex) requiring >> > application.rb? >> > -- >> > Cheers >> >> > Koz > > >-- Kenneth Kalmer kenneth.kalmer@gmail.com http://opensourcery.co.za --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---