0

We had a developer developed a website under his local Mac, and the developer just transferred the zip file of rails site to me, but I am using Windows.

Could anyone help me over the steps on how to change from his database to my local postgresql database ? Sorry I am new at this.

So far:

1) I've edited the database.yml file, host is localhost port 5432 and database name is data1, so I went into pGAdminII and create the same database name.

2) I've created a super user and supplied the credential to database.yml.

Is that all I need to do ? Do I need to setup anything else ? thanks!

1 Answer 1

1

You'll need to change the adapter in the config/database.yaml file from whatever it was to postgres, something along the lines of:

development:
  adapter: postgresql
  database: data1
  host: localhost
  username: someone
  password: something

You will also need to ensure you have the relevant gem in your gemfile.

gem 'pg'

That should just about do the trick. Run your rake db:version to test the connection, if all seems well go for a rake db:migrate. Post any errors you get.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Matt. The person was using postgresql as well. So it was set to postgresql for adapter. When I do rake db:verison, now it shows ion=>:plain, :enable_starttls_auto=>true} rake aborted! Don't know how to build task 'db:verison' (See full trace by running task with --trace)
Also when I do gem 'pg' I get a ERROR: While executing gem..<RuntimeError> so I went ahead and do gem install pg and it was installing it, then I did bundle install but it is still showing unknown command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.