[rspec-users] Error while running rspec after unpacking rails gems

Amiruddin Nagri amir.nagri at gmail.com
Wed Jun 9 16:45:08 EDT 2010


Hi David,

I am using autospec and it by default runs using 'spec' rather than
'script/spec'. Can you give me a quick direction of how to configure it to
use the former.

Thanks,
Amiruddin Nagri,
Bangalore, 560008, KA
India

Y! IM : amir_nagri at yahoo.com
GTalk : amir.nagri at gmail.com



On Tue, Jun 8, 2010 at 5:56 PM, David Chelimsky <dchelimsky at gmail.com>wrote:

> On Jun 8, 2010, at 4:05 AM, Amiruddin Nagri wrote:
>
> > I have a bunch of rspec test that are running fine when I don't freeze
> them in the vendor folder.
> >
> > But when I freeze the rails gems, the spec starts failing with the stack
> >
> >
> /home/xuser/myprojects/xproject/config/../vendor/rails/railties/lib/initializer.rb:271:in
> `require_frameworks': can't activate rack (~> 1.0.1, runtime) for [],
> already activated rack-1.1.0 for ["rspec-rails-1.3.2"] (RuntimeError)
> >     from
> /home/xuser/myprojects/xproject/config/../vendor/rails/railties/lib/initializer.rb:134:in
> `process'
> >     from
> /home/xuser/myprojects/xproject/config/../vendor/rails/railties/lib/initializer.rb:113:in
> `send'
> >     from
> /home/xuser/myprojects/xproject/config/../vendor/rails/railties/lib/initializer.rb:113:in
> `run'
> >     from /home/xuser/myprojects/xproject/config/environment.rb:9
> >     from /home/xuser/myprojects/xproject/spec/spec_helper.rb:4:in
> `require'
> >     from /home/xuser/myprojects/xproject/spec/spec_helper.rb:4
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/spec_helper.rb:1:in
> `require'
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/spec_helper.rb:1
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/users_controller_spec.rb:1:in
> `require'
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/users_controller_spec.rb:1
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in
> `load'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in
> `load_files'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in
> `each'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in
> `load_files'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/options.rb:133:in
> `run_examples'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in
> `run'
> >     from /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/bin/spec:5
>
> Try using 'script/spec' instead of 'spec'.
>
> >
> > I zeroed down the error to this line in spec_helper in spec folder
> >
> > > require
> File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
> >
> > But when I remove this line the specs starts failing with the below stack
> >
> > /home/xuser/myprojects/xproject/spec/spec_helper.rb:5:in `require': no
> such file to load -- spec/rails (LoadError)
> >     from /home/xuser/myprojects/xproject/spec/spec_helper.rb:5
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/spec_helper.rb:1:in
> `require'
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/spec_helper.rb:1
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/users_controller_spec.rb:1:in
> `require'
> >     from
> /home/xuser/myprojects/xproject/spec/controllers/users_controller_spec.rb:1
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in
> `load'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in
> `load_files'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in
> `each'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in
> `load_files'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/options.rb:133:in
> `run_examples'
> >     from
> /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in
> `run'
> >     from /home/xuser/.gem/ruby/1.8/gems/rspec-1.3.0/bin/spec:5
> >
> >
> > Is there anything I am missing ? I want to freeze my gems and check them
> in with the application.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100610/afa4d28d/attachment.html>


More information about the rspec-users mailing list