Reputation: 308
in database.yml
development:
adapter: postgresql
encoding: unicode
database: demo_test_development
pool: 5
username: adarsh
password:
timeout: 5000
host: localhost
port: 5432
test:
adapter: postgresql
encoding: unicode
database: demo_test_test
pool: 5
username: adarsh
password:
timeout: 5000
host: localhost
port: 5432
in gem file
group :development do
gem 'pg'
gem 'taps'
end
then I do
1) Bundle install (is working)
2)rake db:setup,db:create,db:migrate(but is not working)
Getting error : could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? Couldn't create 'demo_test_development' database. Please check your configuration.
Upvotes: 1
Views: 460
Reputation: 3605
You need to install postgresql package into your system you can refer to this link for instruction regarding installing postgres all you need to do is execute the following commands
sudo apt-get install postgresql postgresql-contrib
this installs postgres into your system
then you need to create a user with the details that you have mentioned in the database.yml file of your rails application
You can use pgadmin for db browser you can refer to this question for other tools
to install pgadmin3 run the following command
sudo apt-get install pgadmin3
then configure it with the details like host port etc that you are using(refer to database.yml)
Upvotes: 1
Reputation: 3721
You are using gem 'pg' in development group in gem file.
group :development do
gem 'pg'
gem 'taps'
end
Include it in every environment by moving this line out of development
group.
Upvotes: 0