我在 rails 2.3.12 中遇到了 geokit-rails 插件的问题。我有一个名为 place 的简单模型,如下所示:
class Place < ActiveRecord::Base <br>
attr_accessible :lat, :long, :name <br>
:acts_as_mappable
end
在我的控制器索引操作中:
def index
@places = Place.all
@places.find_within(105, :origin => Place.last)
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @places }
end
end
现在的问题是 thar\ti 无法访问任何 Mapplee 方法,例如:distance_between、find_within 等。它给出错误:未定义的方法“find_within”
.我的完整跟踪:
/home/nascenia/awlad/dtf/daytripfinder/app/controllers/attractions_controller.rb:70:in `search'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/base.rb:1333:in `send'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/base.rb:1333:in `perform_action_without_filters'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/filters.rb:617:in `call_filters'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activesupport-2.3.12/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activesupport-2.3.12/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/flash.rb:151:in `perform_action_without_newrelic_trace'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:in `perform_action'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in `trace_execution_scoped'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:248:in `perform_action'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/base.rb:532:in `send'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/base.rb:532:in `process_without_filters'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/filters.rb:606:in `sass_old_process'
/home/nascenia/awlad/dtf/daytripfinder/vendor/plugins/haml/lib/sass/plugin/rails.rb:20:in `process'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/base.rb:391:in `process'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/base.rb:386:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/routing/route_set.rb:438:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:87:in `dispatch'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:121:in `_call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:9:in `cache'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:28:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:9:in `cache'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:28:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/newrelic_rpm-3.1.0/lib/new_relic/rack/browser_monitoring.rb:18:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/newrelic_rpm-3.1.0/lib/new_relic/rack/developer_mode.rb:24:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/string_coercion.rb:25:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/head.rb:9:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/params_parser.rb:15:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/facebooker-1.0.75/lib/rack/facebook.rb:43:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/session/cookie_store.rb:99:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/failsafe.rb:26:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:114:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/reloader.rb:34:in `run'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:108:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rails-2.3.12/lib/rails/rack/static.rb:31:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `each'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rails-2.3.12/lib/rails/rack/log_tailer.rb:17:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:82:in `start'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run'
/home/nascenia/.rvm/gems/ruby-1.8.7-p370@daytrip/gems/rails-2.3.12/lib/commands/server.rb:111
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
/home/nascenia/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `require'
/home/nascenia/awlad/dtf/daytripfinder/script/server:3
-e:1:in `load'
-e:1
任何的想法 ...?
提前致谢