Created
November 18, 2011 20:33
-
-
Save JasonGiedymin/1377670 to your computer and use it in GitHub Desktop.
Easy PostgreSQL Start/Stop Rake tasks for OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Don't want to run PostgreSQL as a service? Want to manually start and stop it? | |
# >> bundle exec rake postgresql:mac:start | |
# >> bundle exec rake postgresql:mac:stop | |
# | |
namespace :postgresql do | |
namespace :mac do | |
desc "Starts a Mac brew installed Postgres DB." | |
task :start do | |
result = %x[pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start] | |
puts result | |
end | |
desc "Stops a Mac brew installed Postgres DB." | |
task :stop do | |
result = %x[pg_ctl -D /usr/local/var/postgres stop -s -m fast] | |
puts result | |
end | |
desc "64bit pg gem install" | |
task :install64bit do | |
puts 'Manually run this command for native 64bit pg gem install:' | |
puts 'env ARCHFLAGS="-arch x86_64" gem install pg' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment