0

Why is my server not running when I try to start my application? I have node.js installed and I believe I have execjs installed as well which neither fixed the issue. No idea what the problem is. Yes I am new so cut me some slack please! Thanks

C:\Users\My-Name\first_app>rails server
=> Booting WEBrick
=> Rails 4.0.8 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/Users/My-Name/first_app/config/environments/development.rb:1:in `<top (required)>': undefined method `configure' for #<FirstApp::Application:0x3b67c30>(NoMethodError)
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
    from C:/Ruby200/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:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/engine.rb:590:in `each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/engine.rb:590:in `block in <class:Engine>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `instance_exec'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `run'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:44:in `each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:44:in `tsort_each_child'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
    from C:/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/initializable.rb:54:in `run_initializers'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/application.rb:215:in `initialize!'
    from C:/Users/Devin Miller/first_app/config/environment.rb:5:in `<top (required)>'
    from C:/Users/Devin Miller/first_app/config.ru:3:in `require'
    from C:/Users/Devin Miller/first_app/config.ru:3:in `block in <main>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from C:/Users/Devin Miller/first_app/config.ru:in `new'
    from C:/Users/Devin Miller/first_app/config.ru:in `<main>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands/server.rb:48:in `app'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands/server.rb:75:in `start'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands.rb:76:in `block in <top (required)>'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands.rb:71:in `tap'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.8/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
sevenseacat
  • 24,699
  • 6
  • 63
  • 88
Devbot10
  • 1,193
  • 18
  • 33

1 Answers1

1

FirstApp? I guess you are taking the Hartl's tutorial. How did you install rails?

If you installed via rails installer for windows, probably you have a version higher than 4.0.8 and you manually switched version in Gemfile which is not good in this case. If this is the scenario, install 4.0.8 from the beginning and create firstapp with it. [1]

There are few syntax changes for development.rb, buy I think even if you manually change text there it will not work. You can try changing Rails.application.configure.do to FirstApp::Application.configure.do

Please tell me how is going. I will try to update my answer when you give more information.

[1]:

$ rails -v
$ gem uninstall rails --version VERSION
$ gem install rails --version VERSION
radubogdan
  • 2,744
  • 1
  • 19
  • 27
  • I ran the first command and got back 4.0.8 because the guide said to get rid of 4.1.6 and get that. Now as far as uninstalling it like you mentioned above I didn't do that. I started with the 4.1.6 version then copy and pasted the gem file it said to use which I then bundled it and now it says 4.0.8. Whether this is proper or not I am not sure, but I didn't know any other way. Should I uninstall rails like you said above then re-install it? And if I do, will this require me to set everything back up again? – Devbot10 Oct 02 '14 at 20:17
  • fixed it by changing the development.rb file and also raking secret and adding the secret_token folder. Thanks! – Devbot10 Oct 02 '14 at 20:43