-2

last day I have get a ruby on rails project. Know my question: How can I open this project (with postgres).

More information: My contribution is Windows. Ruby and Rails are both installed.

  1. First I navigate via cmd to my project folder

  2. I install the gemfiles with this prompt "bundle install"

  3. After that I try to run the thin server with this prompt "rails server"

Now I get the message that the database is confused. Database.yml is existing in the config folder.

Can someone help me?

Mr_X
  • 7
  • 1
  • First thing I'd try is make sure that config/database.yml has the correct configuration to your database. try running postgres at the command line using the credentials, database name, host and port from that configuration. Look here for how to do run that tool: https://www.postgresql.org/docs/8.4/static/app-psql.html – jaydel Jul 13 '16 at 18:46

1 Answers1

0

If you're starting from scratch one option is to generate a fresh rails app with postgresql already set up as the default database.

From the command line: rails new MyApp --database=postgresql

Then move into the project directory with cd MyApp, bundle install your gemfile, and then create and migrate the database and run the server:

bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rails server   

Since you tagged Heroku, take a look at this guide from heroku for more detailed info

Hope that helps

Ren
  • 1,379
  • 2
  • 12
  • 24