raphaelluchini
raphaelluchini

Reputation: 87

Welcome aboard ActiveRecord::ConnectionNotEstablished

I'm using Ubuntu, with Rails 3.0.1 with mysql2 socket.

When i do runing install, rake db:create and after rails server, my Welcome aboard, shows ActiveRecord::ConnectionNotEstablished in About your application’s environment

What i do?

Upvotes: 1

Views: 1609

Answers (3)

ssand
ssand

Reputation: 69

Had the same problem on rails 3.1.1:
rake db:create - ok
rails console and some DMLs - ok
but accessing info from the web-page resulted in ActiveRecord::ConnectionNotEstablished.
A rails server restart helped.

Upvotes: 3

Pygmalion
Pygmalion

Reputation: 692

It sounds like your MySQL server isn't running. You'll need to install MySQL if you haven't already (apt-get install mysql-server should do it). Once it's running, you'll need to set up a user and database for your app, and note the username and password so that you can put that information in config/database.yml within your app.

This link will be useful if you need any help with those steps.

Upvotes: 0

Matthew Rudy
Matthew Rudy

Reputation: 16844

You'll need to do some more debugging to work it out. How are you running your server?

Make yourself a model. rails generate model Something name:string

Then try running rake db:migrate

Does this work?

If it does, then you must be running your server in a different way (maybe you're running it in production mode?)

Try rails console and try to do Something.count

If all of those work then I'd suggest you try restarting your server.

rails server

Upvotes: 0

Related Questions