views:

107

answers:

2

Hello guys,

I'm having some troubles after installing in Windows 7 ruby 1.8.6, rails 2.3.8, some basic gems(also ruby-postgres) and the IDE Rubymine from Jetbrains.

So, after creating a simple project with Rubymine(default PostgresSQL configuration in database.yml), I run it in localhost:3000 but it seems not be recognizing nothing like:

When I first click on the main page of Ruby on Rails at "About your application’s environment" it returns an Error: "We're sorry, but something went wrong." and even when I create a simple controller with a view and opens the right URL it tells the same problem.

I don't know if the problem is about database or something like this, but also I would like to know how to configure it in database.yml.

Default:

  adapter: postgresql
  encoding: unicode
  database: (name of the project)_(type: test, production or development)
  pool: 5
  username: (name of the project)
  password: (no password)

What I did:

  adapter: postgresql
  encoding: utf-8
  database: (name of database)_(type: test, production or development)
  pool: 5
  username: ruby
  password: (no password)
  host: localhost
  port: 3000

Is it right?

+1  A: 

I don't know much about running Rails on Windows, but looking at your database.yml file above, you shouldn't be saying port: 3000. That's the default port for the rails application to run on. You need to be putting the port that PostgreSQL is running, which is typically 5432.

theIV
A: 

assuming your project is called foo, and you've created the correct databases in postgres, and postgres is listening on the default port on localhost

 development:
    adapter: postgresql
    encoding: utf-8
    database: foo_development 
    pool: 5
    user: ruby

As stated port 3000 is where rails listens, so that will cause problems. Also you need to make sure the pga_hba.conf allows connections to the database.

Doon
Thanks for the info, I did all but the only thing I can't find in Rubymine is where do I change the port 3000 to 5432, because everytime I run the project it goes to 3000. (I have changed the database.yml port)
Mateus Maso
you don't need to change the port to 5432, 5432 is the default port that postgresql server will listen on when it starts. Port 3000 is the default port that the ruby on rails development server runs on. Each process needs it own port number or else it will will fail to bind and won't run. Unless you have an odd configuration there is no need to change either the postgresql port or the ruby on rails development port numbers.
Doon