Reputation: 21
I installed postgresql. I put the localhost port to 3000 on pgadmin. Then it started to throw this error since the localhost port for my ruby app is also at port 3000. Address already in use - bind(2) for "localhost" port 3000 (Errno::EADDRINUSE
I tried to uninstall it and the error still comes up. I tried to delete pgadmin. I tried to set an environment variable export PGPORT=5432. After all this the error still comes up. I just want to get rid of postgres and re-install everything to see what went wrong. I am completely confused. I am faily new with ruby and postgres. I usually use node mongodb etc.
Questions: What is the best way to get rid of postgresql and reinstall it? Any other ideas on how to edit the port? How to delete db on postgresql?
I know it sounds like I am all over the place because I am right now. I just want to start fresh. So please any help.
Upvotes: 0
Views: 539
Reputation: 5112
you may also use different port.
rails s -p 81
if you want to always start with different port..create Rakefile
and add a task..
task :server81 do
`bundle exec rails s -p 8081`
end
you can use it directly by rake server81
Upvotes: 0
Reputation: 6321
Best way to install and use PG/Mongo/MySql on Mac OSX is Brew.
If brew not installed, install it by copy/pasting into Terminal.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
To install Postgresql
brew install postgresql
To use DB (run/restart/stop)
brew services list
brew services start postgres
brew services stop postgres
Upvotes: 2