I just upgraded to beta.13 and I''m running into an issue where when I run ''rake spec'', I get an ''uninitialized constant Comment'' error. Comment is the first model (alphabetically) in my project. If I switch back to beta.12, it works. If I use ''spec .'' and not ''rake spec'', it also works. Environment: Rails master, Mongoid master.
On Jun 24, 2010, at 1:23 PM, geetarista wrote:> I just upgraded to beta.13 and I''m running into an issue where when I > run ''rake spec'', I get an ''uninitialized constant Comment'' error. > Comment is the first model (alphabetically) in my project. If I > switch back to beta.12, it works. If I use ''spec .'' and not ''rake > spec'', it also works. > > Environment: Rails master, Mongoid master.Did you run ''bundle update''?
I did both ''bundle install'' and ''bundle update''. On Jun 24, 12:03?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 24, 2010, at 1:23 PM, geetarista wrote: > > > I just upgraded to beta.13 and I''m running into an issue where when I > > run ''rake spec'', I get an ''uninitialized constant Comment'' error. > > Comment is the first model (alphabetically) in my project. ?If I > > switch back to beta.12, it works. ?If I use ''spec .'' and not ''rake > > spec'', it also works. > > > Environment: Rails master, Mongoid master. > > Did you run ''bundle update''? > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Jun 24, 2010, at 2:24 PM, geetarista wrote:> On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 24, 2010, at 1:23 PM, geetarista wrote: >> >>> I just upgraded to beta.13 and I''m running into an issue where when I >>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. >>> Comment is the first model (alphabetically) in my project. If I >>> switch back to beta.12, it works. If I use ''spec .'' and not ''rake >>> spec'', it also works. >> >>> Environment: Rails master, Mongoid master. >> >> Did you run ''bundle update''? > I did both ''bundle install'' and ''bundle update''.Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. HTH, David
I''m using Rails master. On Jun 24, 7:10?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 24, 2010, at 2:24 PM, geetarista wrote: > > > On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jun 24, 2010, at 1:23 PM, geetarista wrote: > > >>> I just upgraded to beta.13 and I''m running into an issue where when I > >>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. > >>> Comment is the first model (alphabetically) in my project. ?If I > >>> switch back to beta.12, it works. ?If I use ''spec .'' and not ''rake > >>> spec'', it also works. > > >>> Environment: Rails master, Mongoid master. > > >> Did you run ''bundle update''? > > I did both ''bundle install'' and ''bundle update''. > > Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. > > HTH, > David > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Thu, Jun 24, 2010 at 10:12 PM, geetarista <geetarista at gmail.com> wrote:> > On Jun 24, 7:10?pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 24, 2010, at 2:24 PM, geetarista wrote: >> >> > On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> >> On Jun 24, 2010, at 1:23 PM, geetarista wrote: >> >> >>> I just upgraded to beta.13 and I''m running into an issue where when I >> >>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. >> >>> Comment is the first model (alphabetically) in my project. ?If I >> >>> switch back to beta.12, it works. ?If I use ''spec .'' and not ''rake >> >>> spec'', it also works. >> >> >>> Environment: Rails master, Mongoid master. >> >> >> Did you run ''bundle update''? >> > I did both ''bundle install'' and ''bundle update''. >> >> Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. > > I''m using Rails master.I''m at a loss. Please run "rake spec --trace" and post the full backtrace.
Here''s the backtrace and the spec file: http://gist.github.com/452355 Also, if I delete that spec file, it just goes to the next alphabetical file and gives the same error for that model name. On Jun 24, 8:21?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Thu, Jun 24, 2010 at 10:12 PM, geetarista <geetari... at gmail.com> wrote: > > > On Jun 24, 7:10?pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jun 24, 2010, at 2:24 PM, geetarista wrote: > > >> > On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> >> On Jun 24, 2010, at 1:23 PM, geetarista wrote: > > >> >>> I just upgraded to beta.13 and I''m running into an issue where when I > >> >>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. > >> >>> Comment is the first model (alphabetically) in my project. ?If I > >> >>> switch back to beta.12, it works. ?If I use ''spec .'' and not ''rake > >> >>> spec'', it also works. > > >> >>> Environment: Rails master, Mongoid master. > > >> >> Did you run ''bundle update''? > >> > I did both ''bundle install'' and ''bundle update''. > > >> Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. > > > I''m using Rails master. > > I''m at a loss. Please run "rake spec --trace" and post the full backtrace. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Jun 24, 2010, at 10:36 PM, geetarista wrote:> On Jun 24, 8:21 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Thu, Jun 24, 2010 at 10:12 PM, geetarista <geetari... at gmail.com> wrote: >> >>> On Jun 24, 7:10 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>> On Jun 24, 2010, at 2:24 PM, geetarista wrote: >> >>>>> On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>>>> On Jun 24, 2010, at 1:23 PM, geetarista wrote: >> >>>>>>> I just upgraded to beta.13 and I''m running into an issue where when I >>>>>>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. >>>>>>> Comment is the first model (alphabetically) in my project. If I >>>>>>> switch back to beta.12, it works. If I use ''spec .'' and not ''rake >>>>>>> spec'', it also works. >> >>>>>>> Environment: Rails master, Mongoid master. >> >>>>>> Did you run ''bundle update''? >>>>> I did both ''bundle install'' and ''bundle update''. >> >>>> Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. >> >>> I''m using Rails master. >> >> I''m at a loss. Please run "rake spec --trace" and post the full backtrace. > Here''s the backtrace and the spec file: http://gist.github.com/452355 > > Also, if I delete that spec file, it just goes to the next > alphabetical file and gives the same error for that model name.What''s in spec_helper.rb? The backtace makes It look as though the rails framework is not loaded.
http://gist.github.com/452385 (It''s the default generated from rails g rspec:install). I''m not sure what else it could be. I literally change my Gemfile from beta.12 (where specs work) to beta.13 run ''bundle install/update'' and it then fails. On Jun 24, 8:49?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 24, 2010, at 10:36 PM, geetarista wrote: > > > > > > > On Jun 24, 8:21 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Thu, Jun 24, 2010 at 10:12 PM, geetarista <geetari... at gmail.com> wrote: > > >>> On Jun 24, 7:10 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>> On Jun 24, 2010, at 2:24 PM, geetarista wrote: > > >>>>> On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>>>> On Jun 24, 2010, at 1:23 PM, geetarista wrote: > > >>>>>>> I just upgraded to beta.13 and I''m running into an issue where when I > >>>>>>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. > >>>>>>> Comment is the first model (alphabetically) in my project. ?If I > >>>>>>> switch back to beta.12, it works. ?If I use ''spec .'' and not ''rake > >>>>>>> spec'', it also works. > > >>>>>>> Environment: Rails master, Mongoid master. > > >>>>>> Did you run ''bundle update''? > >>>>> I did both ''bundle install'' and ''bundle update''. > > >>>> Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. > > >>> I''m using Rails master. > > >> I''m at a loss. Please run "rake spec --trace" and post the full backtrace. > > Here''s the backtrace and the spec file:http://gist.github.com/452355 > > > Also, if I delete that spec file, it just goes to the next > > alphabetical file and gives the same error for that model name. > > What''s in spec_helper.rb? The backtace makes It look as though the rails framework is not loaded. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Jun 24, 2010, at 11:05 PM, geetarista wrote:> http://gist.github.com/452385 > > (It''s the default generated from rails g rspec:install). > > I''m not sure what else it could be. I literally change my Gemfile > from beta.12 (where specs work) to beta.13 run ''bundle install/update'' > and it then fails.I seriously doubt this will fix the problem, but try changing Rspec to RSpec on line 11.> > On Jun 24, 8:49 pm, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 24, 2010, at 10:36 PM, geetarista wrote: >> >> >> >> >> >>> On Jun 24, 8:21 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>> On Thu, Jun 24, 2010 at 10:12 PM, geetarista <geetari... at gmail.com> wrote: >> >>>>> On Jun 24, 7:10 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>>>> On Jun 24, 2010, at 2:24 PM, geetarista wrote: >> >>>>>>> On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: >>>>>>>> On Jun 24, 2010, at 1:23 PM, geetarista wrote: >> >>>>>>>>> I just upgraded to beta.13 and I''m running into an issue where when I >>>>>>>>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. >>>>>>>>> Comment is the first model (alphabetically) in my project. If I >>>>>>>>> switch back to beta.12, it works. If I use ''spec .'' and not ''rake >>>>>>>>> spec'', it also works. >> >>>>>>>>> Environment: Rails master, Mongoid master. >> >>>>>>>> Did you run ''bundle update''? >>>>>>> I did both ''bundle install'' and ''bundle update''. >> >>>>>> Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. >> >>>>> I''m using Rails master. >> >>>> I''m at a loss. Please run "rake spec --trace" and post the full backtrace. >>> Here''s the backtrace and the spec file:http://gist.github.com/452355 >> >>> Also, if I delete that spec file, it just goes to the next >>> alphabetical file and gives the same error for that model name. >> >> What''s in spec_helper.rb? The backtace makes It look as though the rails framework is not loaded. >> _______________________________________________ >> rspec-users mailing list >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
That did not fix it. On Jun 25, 3:41?am, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 24, 2010, at 11:05 PM, geetarista wrote: > > >http://gist.github.com/452385 > > > (It''s the default generated from rails g rspec:install). > > > I''m not sure what else it could be. ?I literally change my Gemfile > > from beta.12 (where specs work) to beta.13 run ''bundle install/update'' > > and it then fails. > > I seriously doubt this will fix the problem, but try changing Rspec to RSpec on line 11. > > > > > > > > > On Jun 24, 8:49 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >> On Jun 24, 2010, at 10:36 PM, geetarista wrote: > > >>> On Jun 24, 8:21 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>> On Thu, Jun 24, 2010 at 10:12 PM, geetarista <geetari... at gmail.com> wrote: > > >>>>> On Jun 24, 7:10 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>>>> On Jun 24, 2010, at 2:24 PM, geetarista wrote: > > >>>>>>> On Jun 24, 12:03 pm, David Chelimsky <dchelim... at gmail.com> wrote: > >>>>>>>> On Jun 24, 2010, at 1:23 PM, geetarista wrote: > > >>>>>>>>> I just upgraded to beta.13 and I''m running into an issue where when I > >>>>>>>>> run ''rake spec'', I get an ''uninitialized constant Comment'' error. > >>>>>>>>> Comment is the first model (alphabetically) in my project. ?If I > >>>>>>>>> switch back to beta.12, it works. ?If I use ''spec .'' and not ''rake > >>>>>>>>> spec'', it also works. > > >>>>>>>>> Environment: Rails master, Mongoid master. > > >>>>>>>> Did you run ''bundle update''? > >>>>>>> I did both ''bundle install'' and ''bundle update''. > > >>>>>> Did you upgrade rails as well? rspec-rails-2.0.0.beta.13 only works with rails-3.0.0.beta4. > > >>>>> I''m using Rails master. > > >>>> I''m at a loss. Please run "rake spec --trace" and post the full backtrace. > >>> Here''s the backtrace and the spec file:http://gist.github.com/452355 > > >>> Also, if I delete that spec file, it just goes to the next > >>> alphabetical file and gives the same error for that model name. > > >> What''s in spec_helper.rb? The backtace makes It look as though the rails framework is not loaded. > >> _______________________________________________ > >> rspec-users mailing list > >> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
El 25/06/2010, a las 15:38, geetarista escribi?:> That did not fix it.What have you got in your Gemfile? Cheers, Wincent
Gemfile: http://gist.github.com/453032 On Jun 25, 7:41?am, Wincent Colaiuta <w... at wincent.com> wrote:> El 25/06/2010, a las 15:38, geetarista escribi?: > > > That did not fix it. > > What have you got in your Gemfile? > > Cheers, > Wincent > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
El 25/06/2010, a las 17:44, geetarista escribi?:> Gemfile: http://gist.github.com/453032 > > On Jun 25, 7:41 am, Wincent Colaiuta <w... at wincent.com> wrote: >> El 25/06/2010, a las 15:38, geetarista escribi?: >> >>> That did not fix it. >> >> What have you got in your Gemfile?(Aside: please don''t top-post; it makes your replies cumbersome to read.) Was kind of hoping I''d see something glaringly weird in your Gemfile, but nothing leaps out at me. Why do you have the ":require => nil" for RSpec in your test environment? AFAIK this won''t explain the failure you''re seeing, but I still wonder why you''re doing it. On a tangent, you''re 10 releases of Haml behind, and a lot of Rails 3 fixes have been made since 3.0.3. Cheers, Wincent
Sorry about that. For some reason I thought Google Reader stripped that automatically. I added ":require => nil" because I had read somewhere that it was good to do so. Can''t remember why or where. Taking it out does not fix the failure. I just haven''t upgraded Haml because it''s not top priority and I haven''t run into any issues yet.
On Jun 25, 2010, at 4:51 PM, geetarista wrote:> Sorry about that. For some reason I thought Google Reader stripped > that automatically. > > I added ":require => nil" because I had read somewhere that it was > good to do so. Can''t remember why or where. Taking it out does not > fix the failure. > > I just haven''t upgraded Haml because it''s not top priority and I > haven''t run into any issues yet.I figured out the problem. It boils down to these two lines in spec/spec_helper.rb ENV["RAILS_ENV"] ||= ''test'' require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails) I''m changing those to this for the next release: ENV[''RAILS_ENV''] = ENV[''RSPEC_RAILS_ENV''] || ''test'' require File.expand_path("../../config/environment", __FILE__) Do that in your spec_helper now and it should work correctly. Please confirm. Thx, David
On Jun 25, 2010, at 4:51 PM, geetarista wrote:> Sorry about that. For some reason I thought Google Reader stripped > that automatically. > > I added ":require => nil" because I had read somewhere that it was > good to do so. Can''t remember why or where. Taking it out does not > fix the failure. > > I just haven''t upgraded Haml because it''s not top priority and I > haven''t run into any issues yet.I''ve been able to reproduce the issue, and should have a fix in place soon. Assuming I''ve got the fix, I''ll explain what happened once it''s pushed to github. Cheers, David
On Jun 26, 2010, at 12:13 PM, David Chelimsky wrote:> On Jun 25, 2010, at 4:51 PM, geetarista wrote: > >> Sorry about that. For some reason I thought Google Reader stripped >> that automatically. >> >> I added ":require => nil" because I had read somewhere that it was >> good to do so. Can''t remember why or where. Taking it out does not >> fix the failure. >> >> I just haven''t upgraded Haml because it''s not top priority and I >> haven''t run into any issues yet. > > I''ve been able to reproduce the issue, and should have a fix in place soon. > > Assuming I''ve got the fix, I''ll explain what happened once it''s pushed to github.What I believe to be the fix is now up in github. Geetarista, would you do me a favor and update your gemfile to point to the git repos: gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git" gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git" gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git" gem "rspec", :git => "git://github.com/rspec/rspec.git" Need to get all of them from git for this to work (just temporary until I get a release out). Then ''bundle install'' and ''rake spec'' and let me know if all is well. Thanks, David
That fixed it. Thanks so much, David!> What I believe to be the fix is now up in github. Geetarista, would you do me a favor and update your gemfile to point to the git repos: > > gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" > gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git" > gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git" > gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git" > gem "rspec", :git => "git://github.com/rspec/rspec.git" > > Need to get all of them from git for this to work (just temporary until I get a release out). > > Then ''bundle install'' and ''rake spec'' and let me know if all is well. > > Thanks, > David > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Jun 26, 2010, at 10:38 PM, geetarista wrote:>> What I believe to be the fix is now up in github. Geetarista, would you do me a favor and update your gemfile to point to the git repos: >> >> gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" >> gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git" >> gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git" >> gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git" >> gem "rspec", :git => "git://github.com/rspec/rspec.git" >> >> Need to get all of them from git for this to work (just temporary until I get a release out). >> >> Then ''bundle install'' and ''rake spec'' and let me know if all is well. >> >> Thanks, >> David> That fixed it. Thanks so much, David!Great. Thanks. Release coming in the next day or so.
Thank you all for this discussion and the fix I ran into the same issue this morning, but with "Factory" being the class that was undefined (using Factory Girl) The fix explained in this discussion worked for me. As a reminder for others : 1 - update spec_helper require File.expand_path("../../config/environment", __FILE__) instead of require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails) 2 - update gemfile gem ''rspec-rails'', "2.0.0.beta.14.1" 3 - bundle install or bundle update (depending on your version of bundler) On Jun 27, 5:39?am, David Chelimsky <dchelim... at gmail.com> wrote:> On Jun 26, 2010, at 10:38 PM, geetarista wrote: > > >> What I believe to be the fix is now up in github. Geetarista, would you do me a favor and update your gemfile to point to the git repos: > > >> gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" > >> gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git" > >> gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git" > >> gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git" > >> gem "rspec", :git => "git://github.com/rspec/rspec.git" > > >> Need to get all of them from git for this to work (just temporary until I get a release out). > > >> Then ''bundle install'' and ''rake spec'' and let me know if all is well. > > >> Thanks, > >> David > > That fixed it. ?Thanks so much, David! > > Great. Thanks. Release coming in the next day or so. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
On Jun 28, 2010, at 6:10 AM, Julien wrote:> On Jun 27, 5:39 am, David Chelimsky <dchelim... at gmail.com> wrote: >> On Jun 26, 2010, at 10:38 PM, geetarista wrote: >> >>>> What I believe to be the fix is now up in github. Geetarista, would you do me a favor and update your gemfile to point to the git repos: >> >>>> gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git" >>>> gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git" >>>> gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git" >>>> gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git" >>>> gem "rspec", :git => "git://github.com/rspec/rspec.git" >> >>>> Need to get all of them from git for this to work (just temporary until I get a release out). >> >>>> Then ''bundle install'' and ''rake spec'' and let me know if all is well. >> >>>> Thanks, >>>> David >>> That fixed it. Thanks so much, David! >> >> Great. Thanks. Release coming in the next day or so.> Thank you all for this discussion and the fix > > I ran into the same issue this morning, but with "Factory" being the > class that was undefined (using Factory Girl) > > The fix explained in this discussion worked for me. > As a reminder for others : > > 1 - update spec_helper > require File.expand_path("../../config/environment", __FILE__) > instead of > require File.dirname(__FILE__) + "/../config/environment" unless > defined?(Rails)This is already updated in 2.0.0.beta.14.1 - you just have to follow the installation instructions and re-run ''script/rails generate rspec-install''> > 2 - update gemfile > gem ''rspec-rails'', "2.0.0.beta.14.1" > > 3 - bundle install or bundle update (depending on your version of > bundler)