Ticket #375 (closed defect: worksforme)

Opened 10 months ago

Last modified 9 months ago

Error when I run "script/generate resource user" with merb 0.4.2 and trunk

Reported by: merb.no..@gmail.com Assigned to: j..@blankpad.net
Priority: medium Milestone: 0.4.2
Component: Generators Keywords:
Cc:

Description

I see the following error:

/usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.1/lib/spec/runner/options.rb:216:in `files_to_load': File or directory not found: user (RuntimeError?)

The full output is on this pastie:

http://pastie.caboo.se/131542

Change History

12/26/07 08:05:04 changed by flatt..@gmail.com

  • owner changed.
  • component changed from Merb to Generators.

Same thing for me (Resource name is not important).

12/30/07 18:03:55 changed by e.@brainspl.at

This is a stupid bug in rspec 1.1.1> They have added an at_exit hook that tries to run specs and it gets setup even if you just require 'spec'.

Not sure what the best way to fix this is yet.

12/31/07 00:37:15 changed by flatt..@gmail.com

Uh. That was way to obvious to find it ;-)

01/01/08 18:44:08 changed by cvonklei..@gmail.com

I had to do gem uninstall rspec and then gem install rspec --version 1.0.8 to get it to work. I tried to use rspec-1.1.0, but it had the same behavior. (There might be a version >1.0.8 and <1.1.0 that would work, but 1.0.8 is new enough for me.)

01/01/08 18:46:33 changed by flatt..@gmail.com

Confirmed, 1.0.8 works. That's what I did too.

01/02/08 23:08:35 changed by wyca..@gmail.com

  • status changed from new to closed.
  • resolution set to worksforme.

Cannot reproduce on trunk.

01/04/08 00:29:04 changed by mcs5..@drexel.edu

  • status changed from closed to reopened.
  • resolution deleted.

Still getting this error using merb trunk:

$ gem list | egrep '^(rspec|merb)'
merb (0.5.0)
merb_activerecord (0.4.3)
merb_datamapper (0.4.4)
rspec (1.1.1)

$ script/generate controller posts
Started merb_init.rb ...
Connecting to database...
Loading Application...
Compiling routes..
Loaded DEVELOPMENT Environment...
      exists  app/controllers
      create  app/controllers/posts.rb
      create  app/views/posts
      create  app/views/posts/index.html.erb
      exists  app/helpers/
      create  app/helpers/posts_helper.rb
  dependency  merb_controller_test
      create    spec/controllers
      create    spec/controllers/posts_spec.rb
      create    spec/views/posts
      create    spec/views/posts/index_html_spec.rb
      create    spec/helpers
      create    spec/helpers/posts_helper_spec.rb
/var/lib/gems/1.8/gems/rspec-1.1.1/lib/spec/runner/options.rb:216:in `files_to_load': File or directory not found: posts (RuntimeError)
        from /var/lib/gems/1.8/gems/rspec-1.1.1/lib/spec/runner/options.rb:210:in `each'
        from /var/lib/gems/1.8/gems/rspec-1.1.1/lib/spec/runner/options.rb:210:in `files_to_load'
        from /var/lib/gems/1.8/gems/rspec-1.1.1/lib/spec/runner/options.rb:83:in `run_examples'
        from /var/lib/gems/1.8/gems/rspec-1.1.1/lib/spec.rb:20:in `run'
        from /var/lib/gems/1.8/gems/rspec-1.1.1/lib/spec.rb:34
        from script/generate:28

01/04/08 10:21:27 changed by wyca..@gmail.com

This is a different issue than the one that was reported earlier. I get this one too, but it doesn't seem to impact the actual generation. Perhaps it's an issue with rubigen?

01/05/08 11:52:55 changed by e.@brainspl.at

its the at_exit hook in rspec.

01/06/08 04:17:24 changed by sethrasmuss..@gmail.com

  • status changed from reopened to closed.
  • resolution set to invalid.

Yeah, looks like the same error again.. downgrade your rspec.

01/06/08 12:36:05 changed by wyca..@gmail.com

  • status changed from closed to reopened.
  • resolution deleted.

it is the same error but "downgrade your rspec" is not a good enough solution.

01/06/08 12:37:49 changed by sethrasmuss..@gmail.com

OK sorry, I thought that was why it was closed the first time. i.e. Hacking around 'stupid bugs' in rspec was not the way to go either.

01/08/08 19:44:49 changed by e.@brainspl.at

  • status changed from reopened to closed.
  • resolution set to fixed.

Fixed with a hack.

01/15/08 09:46:48 changed by j..@blankpad.net

  • status changed from closed to reopened.
  • resolution deleted.

This is still happening in 0.5.0 - I'm aware that it's a problem with RSpec really, but it's likely to completely put off new users (such as myself!)

I'm going to assign this to myself, and have a look at it over my lunch break some time I think, because it should be possible to monkey patch RSpec to stop the at_exit nonsense.

01/15/08 09:46:55 changed by j..@blankpad.net

  • owner set to j..@blankpad.net.
  • status changed from reopened to new.

01/15/08 09:47:07 changed by j..@blankpad.net

  • status changed from new to assigned.

01/16/08 09:05:34 changed by j..@blankpad.net

  • status changed from assigned to closed.
  • resolution set to worksforme.

I just tried this using Merb 0.5.2 and RSpec 1.1.2 and it seems to be working now.