rgeo / activerecord-postgis-adapter

ActiveRecord connection adapter for PostGIS, based on postgresql and rgeo
Other
884 stars 242 forks source link

configs_for_environment fail on rails 3.0.x #64

Closed rdeguzman closed 11 years ago

rdeguzman commented 11 years ago

Running rake db:gis:setup for an existing rails app (v.3.0.10) fails on _configs_forenvironment.

databases.rake

    task :setup => [:load_config, :rails_env] do
      configs_for_environment.each { |config| setup_gis(config) }
    end

Error on rake db:gis:setup

** Invoke db:gis:setup (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Invoke rails_env
** Execute db:gis:setup
rake aborted!
undefined local variable or method `configs_for_environment' for main:Object
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@dfms/gems/activerecord-postgis-adapter-0.6.3/lib/active_record/connection_adapters/postgis_adapter/rails3/databases.rake:53:in `block (3 levels) in <top (required)>'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/rupert/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
Trying to 

/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@dfms/bin/rake:19:in `load'
/Users/rupert/.rvm/gems/ruby-1.9.3-p0@dfms/bin/rake:19:in `<main>'
Tasks: TOP => db:gis:setup
dazuma commented 11 years ago

Hi, thanks for the report. I pushed a fix to git (a little different from your pull request.)

dazuma commented 11 years ago

Fix included in version 0.6.4.