[rspec-users] can't get RSpec 2.3.1 to work in Rails 3.0.3 - uninitialized constant Rails (NameError)

David Chelimsky dchelimsky at gmail.com
Sat Jan 1 12:20:00 EST 2011

On Dec 30, 2010, at 4:37 PM, Kurt wrote:

> I just installed rspec-rails 2.3.1 gem into a new Rails 3.0.3 app, ran
> the rspec:install generator, but the system doesn't see any other
> RSpec generators (like rspec_controller),

There is an rspec:controller generator, but Rails hides it from you because it is intended (by Rails) to be run with the Rails controller generator. When you run `rails generate controller Accounts name:string`, Rails generates the controller file and then delegates to RSpec to run the spec file.

> and the server will no longer start.

The server? What command are you typing?

> Both report this error:
> /.rvm/gems/ruby-1.9.2-p0 at rails3/gems/rspec-rails-2.3.1/lib/rspec-
> rails.rb:3:in `<module:Rails>': uninitialized constant Rails
> (NameError)
> Here's a clip of the file referenced by the error:
> module RSpec
>  module Rails
>    class Railtie < ::Rails::Railtie
> I've used RSpec 2.0 and 2.1 with Rails 3 before without problems.  Any
> suggestions greatly appreciated..
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users


More information about the rspec-users mailing list