0

I am new to RoR and have been trying to complete getting started link

http://guides.rubyonrails.org/getting_started.html

I'm getting couple of problems:

  1. I can't run rake db:create
  2. I can't run rake server

Workstation is Ubuntu 12.04, Rails 3.2.8, Ruby 1.9.3p194.

mukeshk@ubuntu:~/NetBeansProjects/rails_work/blog/config$ rake db:create
(in /home/mukeshk/NetBeansProjects/rails_work/blog)
rake aborted!
undefined method `active_record' for #<Rails::Application::Configuration:0x00000002080410>

(See full trace by running task with --trace)

mukeshk@ubuntu:~/NetBeansProjects/rails_work/blog/config$ rails server
/home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x00000002a02f60> (NoMethodError)
    from /home/mukeshk/NetBeansProjects/rails_work/blog/config/application.rb:54:in `<class:Application>'
    from /home/mukeshk/NetBeansProjects/rails_work/blog/config/application.rb:13:in `<module:Blog>'
    from /home/mukeshk/NetBeansProjects/rails_work/blog/config/application.rb:12:in `<top (required)>'
    from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
    from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
    from /home/mukeshk/.rvm/gems/ruby-1.9.3-p194@rails32/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
mukeshk@ubuntu:~/NetBeansProjects/rails_work/blog/config$ 
1
  • Does your application.rb include active record? Commented Aug 15, 2012 at 7:45

1 Answer 1

0

Add this to your config/application.rb:

require "active_record/railtie"
Sign up to request clarification or add additional context in comments.

3 Comments

Sounds like a broken configuration of Rails. Try using this tutorial, which is where I learnt Rails, and is exceedingly helpful and detailed. ruby.railstutorial.org/…. Also check: stackoverflow.com/questions/6087919/… and stackoverflow.com/questions/6122966/…
problem with >rails server resolved. I followed the guideline on ruby.railstutorial.org/…
problem with >rails server resolved. I followed the guideline on ruby.railstuturial.org only thing I changed was specifying specific version of gem in GemFile. I will update on > rake db:create issue shortly. thanks Dane Balia

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.