Heroku + Rails + GeoIp = uninitialized constant GeoIP error -


i'm trying deploy old website heroku. goes well, starts, when access through web browser get

nameerror (uninitialized constant applicantscontroller::geoip): 

i'm using rails 2.3.18 (my website simple , want deploy "as is" , asap; on dedicated server worked well).

i have geoip.dat file in 'db' folder , in controllers/applicants_controller.rb have

line 32:    geoip ||= geoip.new("db/geoip.dat") line 33:    location = geoip.country('google.com') 

if launch irb on heroku looks good:

login@sancho:~$ heroku run bash running `bash` attached terminal... up, run.7785 ~ $ irb irb(main):001:0> require 'geoip' => true irb(main):002:0> geoip ||= geoip.new("db/geoip.dat") => #<geoip:0x00000002b3a6a8 @mutex=#<mutex:0x00000002b3a680>, @flags=0, @database_type=1, @record_length=3, @file=#<file:db/geoip.dat>, @database_segments=[16776960]> irb(main):004:0> geoip.country('google.com') => #<struct geoip::country request="google.com", ip="74.125.228.110", country_code=225, country_code2="us", country_code3="usa", country_name="united states", continent_code="na"> irb(main):005:0>  

here full error log.

2013-05-02t13:08:25.938481+00:00 app[web.1]: processing applicantscontroller#create (for 87.207.27.219 @ 2013-05-02 13:08:25) [post] 2013-05-02t13:08:25.938481+00:00 app[web.1]:   parameters: {"status"=>"complete"} 2013-05-02t13:08:26.029730+00:00 app[web.1]:  2013-05-02t13:08:26.029730+00:00 app[web.1]: nameerror (uninitialized constant applicantscontroller::geoip): 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:131:in `rescue in const_missing' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:610:in `perform_action_with_filters' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/flash.rb:151:in `perform_action_with_flash' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:87:in `dispatch' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:121:in `_call' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:29:in `block in call' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/session/cookie_store.rb:99:in `call' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   <internal:prelude>:10:in `synchronize' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:120:in `const_missing' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:532:in `process' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   app/controllers/applicants_controller.rb:32:in `create' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:391:in `process' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:617:in `call_filters' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:386:in `call' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:1333:in `perform_action' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:606:in `process_with_filters' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:29:in `call' 2013-05-02t13:08:26.029730+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark' 2013-05-02t13:08:26.030057+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/routing/route_set.rb:438:in `call' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:9:in `cache' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/activerecord-2.3.18/lib/active_record/query_cache.rb:28:in `call' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/params_parser.rb:15:in `call' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `catch' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/string_coercion.rb:25:in `call' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:79:in `pre_process' 2013-05-02t13:08:26.030750+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/server.rb:159:in `start' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:54:in `process' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in `start' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run' 2013-05-02t13:08:26.030750+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:81:in `block in pre_process' 2013-05-02t13:08:26.030750+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/dispatcher.rb:106:in `call' 2013-05-02t13:08:26.030750+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine' 2013-05-02t13:08:26.030520+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/connection.rb:39:in `receive_data' 2013-05-02t13:08:26.030750+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/bin/thin:19:in `load' 2013-05-02t13:08:26.030298+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/actionpack-2.3.18/lib/action_controller/failsafe.rb:26:in `call' 2013-05-02t13:08:26.030750+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:86:in `start' 2013-05-02t13:08:26.030750+00:00 app[web.1]: rendering /app/public/500.html (500 internal server error) 

bundle log heroku:

   running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment    source :gemcutter deprecated because http requests insecure.    please change source 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.    using rake (0.8.7)    using activesupport (2.3.18)    using rack (1.1.6)    using actionpack (2.3.18)    using actionmailer (2.3.18)    using activerecord (2.3.18)    using activeresource (2.3.18)    using daemons (1.1.9)    using eventmachine (1.0.3)    using geoip (1.2.1)    using pg (0.15.1)    using rails (2.3.18)    using thin (1.5.1)    using bundler (1.3.2)    bundle complete! installed ./vendor/bundle 

thanks in advance help!

problem solved.

i forgot edit config/boot.rb , create edit/preinitializer.rb described here http://gembundler.com/v1.3/rails23.html


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -