0

I am a newb and when running the below rake task keep getting the error message "Don't know how to build task 'create_postgis_template'".

My rake file looks as follows:

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rdoc/task'
require 'tasks/rails'

namespace :postgres do
  desc "create postgis db template on osx boxes"
  task :create_postgis_template do
    print "Enter your postgres username: "
    user = STDIN.gets
    user.chomp!
    root = File.dirname(__FILE__)
    cmd  = "psql -U #{user} -f assets/sql/postgis_template_osx.sql template1"
    system(cmd)
  end
end
halfer
  • 19,824
  • 17
  • 99
  • 186
BC00
  • 1,589
  • 3
  • 29
  • 47

1 Answers1

1

The create_postgis_template task is defined within the postgres namespace; so it would be called from rake postgres:create_postgis_template command, and not rake create_postgis_template command.

Best to run rake -T to see all the tasks available as rake tasks.

Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74
  • Awesome!thank you! This is my first time using postgres would you know how to create my user password? – BC00 Nov 26 '12 at 02:45