2

I'm working through chapter 3 of Michael Hartl's tutorial and I tried running "rails generate rspec:install" and I get the error message below.

C:\Sites\sample_app>rails generate rspec:install
DL is deprecated, please use Fiddle
C:/Sites/sample_app/config/environments/development.rb:1:in `<top (required)>':
undefined method `configure' for #<SampleApp::Application:0x380cda8> (NoMethodEr
ror)
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
4.0.8/lib/active_support/dependencies.rb:229:in `require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/activesupport-
4.0.8/lib/active_support/dependencies.rb:229:in `require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/engine.rb:590:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/engine.rb:590:in `block in <class:Engine>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:150:in `block i
n tsort_each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:183:in `block (
2 levels) in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:210:in `block (
2 levels) in each_strongly_connected_component_from'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:219:in `each_st
rongly_connected_component_from'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:209:in `block i
n each_strongly_connected_component_from'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/initializable.rb:44:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/initializable.rb:44:in `tsort_each_child'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:203:in `each_st
rongly_connected_component_from'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:182:in `block i
n each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:180:in `each_st
rongly_connected_component'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/tsort.rb:148:in `tsort_e
ach'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/application.rb:215:in `initialize!'
        from C:/Sites/sample_app/config/environment.rb:5:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/application.rb:189:in `require'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/application.rb:189:in `require_environment!'
        from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.0.8
/lib/rails/commands.rb:44:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Here is my gemfile

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.8'

group :development, :test do
  gem 'sqlite3', '1.3.8'
  gem 'rspec-rails', '2.13.1'
end

group :test do
  gem 'selenium-webdriver', '2.35.1'
  gem 'capybara', '2.1.0'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

The first line of my config/enivronments/development.rb file

Rails.application.configure do

I looked up some other answers to this question. And they suggested changing the first line in my development.rb file to SampleApp:Application.configure.do; but that just leads to another error 'unitialized constant SampleApp'. So I I changed it back to default.

EDIT: Fixed it to SampleApp::Application, got this cmd line message after running "rails generate rspec:install"

C:\Sites\sample_app>rails generate rspec:install
DL is deprecated, please use Fiddle
      create  .rspec
      create  spec
      create  spec/spec_helper.rb
user3808138
  • 109
  • 1
  • 11
  • Can you post the first line of your `development.rb` file? in `app/config/environments/development.rb`. Also, when you ran the `rails new ...` generator command, what did you name your app..`SampleApp`?? – Justin Jul 05 '14 at 17:28
  • Thanks, ok change the first line to `SampleApp::Application.configure do`. Looks like you missed the double `::`. If that doesn't work, I have one more suggestion that may fix it. – Justin Jul 05 '14 at 17:30
  • Hi, that might have been the trick. Can you look at my new cmd line message above and tell me if it worked correctly? – user3808138 Jul 05 '14 at 17:53
  • Yes that created the necessary files to use `Rspec`. Updated my answer below. – Justin Jul 05 '14 at 17:55
  • Thanks do I have to worry about "DL is deprecated, use fiddle instead"? – user3808138 Jul 05 '14 at 17:59
  • Nope, it's just a warning for Windows. I assume you are running on Windows. Here is a good [S.O. post](http://stackoverflow.com/a/15601984/2456549) that talks about it. – Justin Jul 05 '14 at 18:02

1 Answers1

-1

Thanks, ok change the first line to

SampleApp::Application.configure do

Looks like you missed the double ::.

Credit to this S.O. answer.

Community
  • 1
  • 1
Justin
  • 4,922
  • 2
  • 27
  • 69
  • Sorry I actually made a mistake in my question. I tried to do "rails generate:install" And I got the above error – user3808138 Jul 05 '14 at 17:23