2

I started this tutorial for Rails. I just created the app and was going to test the default welcome page and this happened:

D:\Programming\Rails Projects\simpleCMS>rails server
    C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.3/lib/action_view/helpers.rb:40:in `<module:Helpers>': uninitialized constant ActionView::Helpers::ActiveModelHelper (NameError)
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.3/lib/action_view/helpers.rb:4:in `<module:ActionView>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.3/lib/action_view/helpers.rb:3:in `<top (required)>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.3/lib/action_view/base.rb:5:in `require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/actionview-4.2.3/lib/action_view/base.rb:5:in `<top (required)>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:7:in `<class:Template>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:6:in `<module:WebConsole>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console/template.rb:1:in `<top (required)>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web_console.rb:12:in `<top (required)>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.2.1/lib/web-console.rb:1:in `<top (required)>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
            from D:/Programming/Rails Projects/simpleCMS/config/application.rb:7:in `<top (required)>'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:78:in `require'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:78:in `block in server'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
            from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
            from bin/rails:4:in `require'
            from bin/rails:4:in `<main>'

My gemfile (without the comments):

source 'https://rubygems.org'
gem 'rails', '4.2.3'
gem 'mysql2'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
    gem 'byebug'
    gem 'web-console', '~> 2.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Rabeez Riaz
  • 442
  • 5
  • 15
  • What is on line 7 of `config/application.rb`? – Ruby Racer Aug 01 '15 at 22:36
  • `Bundler.require(*Rails.groups)` – Rabeez Riaz Aug 01 '15 at 22:38
  • Try commenting the line out, so it will not run, and add this line instead: `Bundler.require(:default, Rails.env)`. Not sure it will work, but your syntax does not sound very familiar to me... – Ruby Racer Aug 01 '15 at 22:42
  • exactly same error as before @RubyRacer. As for the syntax I haven't even gotten around to editing even a single line of code so this is all what Rails did on its own. – Rabeez Riaz Aug 01 '15 at 22:46
  • Ok. I wasn't sure about it, as I said. Have you run `bundle install` before trying to run the server? – Ruby Racer Aug 01 '15 at 22:48
  • yeah, tried it after making your edit as well, same result – Rabeez Riaz Aug 01 '15 at 22:49
  • @RabeezRiaz Did you create the Rails project with `rails new`? – eirikir Aug 01 '15 at 23:14
  • @RabeezRiaz So you just did `rails new`, then `cd` into the new directory, then `rails s` and you get this error? What version of rails are you using? How did you install rails? – eirikir Aug 01 '15 at 23:18
  • yes @eirikir I created the project, tried to start the server and got the error. I have Rails version 4.2.3 and installed it using `gem install rails` – Rabeez Riaz Aug 01 '15 at 23:22
  • @RabeezRiaz I just tried this on my local and did not have any problems, so its not the Rails version. What OS are you on? Can you paste your Gemfile here? – eirikir Aug 01 '15 at 23:35
  • Windows 10 I'll add the gemfile to the OP @eirikir – Rabeez Riaz Aug 01 '15 at 23:38

2 Answers2

2

Uninstall railties gem because just uninstalling the rails gem doesn't work. Then install an older version of the rails gem (4.0.0 in my case because that was the one from the tutotial).

This fixed the issue.

Rabeez Riaz
  • 442
  • 5
  • 15
0

you might need to bind an ip address why dont you try this: rails server -b localhost

  • You should explain more about the solution. – Sweeper Aug 02 '15 at 03:03
  • i assumed he already did db:migrate & db:seed therefore he did rails server; i took a saas course online before an remembered that sometimes depending on where you are running your app you might need to add "-b 127.0.0.1"(ie local host) however if you use cloud9 or nitrous then it'd be different but still -b ###(some ip address) here. clear enough? –  Aug 02 '15 at 07:20