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
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.