1

I'm a newb to rails, so please excuse this question but I've been searching everywhere for how to do it. I have a github project I cloaned that I'm going to have to eventually work on, but need to view it now in the browser (will be crash coursing to get up to speed the next couple months). I've downloaded the directory and ran bundle install. Now I'm trying to start the rails server and I get this:

    Chriss-MacBook-Pro:chris cgood$ rails server
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x007fc07b649c48> (NoMethodError)
    from /Users/cgood/event/chris/config/application.rb:69:in `<class:Application>'
    from /Users/cgood/event/chris/config/application.rb:25:in `<module:ChrisGood>'
    from /Users/cgood/event/chris/config/application.rb:24:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:53:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Any help would be really appreciated! I've been pulling out hair for hours tackling error message after error message. This one has me stuck as hard to find anything on the internet about it.

I have xcode, rails installer, homebrew and postgreSQL installed. Thanks.

cgood
  • 165
  • 1
  • 1
  • 16
  • are you missing the `database.yml` file? It should be inside your `config` directory – macool Feb 24 '13 at 16:20
  • I have a database.yml.example file in my config directory. I was having issues earlier with finding database.yml, but I used this as a workaround: 'require "rails" %w( action_controller action_mailer active_resource rails/test_unit ).each do |framework| begin require "#{framework}/railtie" rescue LoadError end end' – cgood Feb 24 '13 at 16:47

1 Answers1

1

2 things:

  1. upgrade rails!! there's a post about the dangers of using 3.2.11
  2. your app needs a file called database.yml, read this and this to find out what to put in it

Normally your app would have that file in it already, but since it usually contains sensitive data, like database user passwords, people tend to leave it out of their github repos. So you just need to make your own one.

Community
  • 1
  • 1
stephenmurdoch
  • 34,024
  • 29
  • 114
  • 189