Rails Generate Rspec:Install Config/Environments/Development.Rb:1:In '<Top (Required)>': Undefined Method 'Configure'

rails generate rspec:install config/environments/development.rb:1:in ` top (required) ': undefined method `configure'

In config/environments/development.rb:

change

Rails.application.configure do 

to

SampleApp::Application.configure do

I checked a couple of my applications, and thats the format I have them.

Undefined method error when running rails generate rspec:install

Thanks, ok change the first line to

SampleApp::Application.configure do

Looks like you missed the double ::.

Credit to this S.O. answer.

`rails new`: different behaviour in Linux and Windows

OK, my mistake was copy-pasting the contents of a Gemfile from the project I was writing in Windows. The Gemfile in Windows had the following line:

gem 'rails', '4.0.4'

whereas the line in the original Gemfile generated by rails new in the linux box was:

gem 'rails', '4.1.1'

Therefore I was having version mismatch problems. Now I have copy-pasted the contents of the Gemfile from Windows but preserving the line gem 'rails', '4.1.1' and it works.



Related Topics



Leave a reply



Submit