makandra / active_type

Make any Ruby object quack like ActiveRecord
MIT License
1.09k stars 74 forks source link

PG::UndefinedObject: ERROR: type "string" does not exist #43

Closed manivi closed 9 years ago

manivi commented 9 years ago

Newbie to Ruby on Rails + Heroku Deployment .. not sure if this is issue is related to your Gem or with Heroku deployment environment. Works fine in my local (as I am not using PG) Heroku environment details

and this is the model code

class Visitor < ActiveRecord::Base
    has_no_table
    column :email, :string
    validates_presence_of :email
    validates_format_of :email, :with => /\A[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}\z/i
    def subscribe
        mailchimp = Gibbon::API.new
        result = mailchimp.lists.subscribe({
            :id => ENV['MAILCHIMP_LIST_ID'],
            :email => {:email => self.email},
            :double_optin => false,
            :update_existing => true,
            :send_welcome => true
            })
        Rails.logger.info("Subscribed #{self.email} to MailChimp") if result
    end
end

below is the whole log dump

015-07-18T18:52:44.319347+00:00 app[web.1]:     from /app/config.ru:in `new'
2015-07-18T18:52:44.319350+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2015-07-18T18:52:44.319353+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
2015-07-18T18:52:44.319357+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
2015-07-18T18:52:44.319360+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
2015-07-18T18:52:44.319363+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
2015-07-18T18:52:44.319366+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
2015-07-18T18:52:44.319369+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
2015-07-18T18:52:44.319372+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
2015-07-18T18:52:44.319376+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start'
2015-07-18T18:52:44.319382+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:80:in `start'
2015-07-18T18:52:44.319385+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2015-07-18T18:52:44.319389+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-07-18T18:52:44.319392+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-07-18T18:52:44.319396+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2015-07-18T18:52:44.319399+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
2015-07-18T18:52:44.319402+00:00 app[web.1]:    from bin/rails:8:in `require'
2015-07-18T18:52:44.319405+00:00 app[web.1]:    from bin/rails:8:in `<main>'
2015-07-18T18:52:45.246428+00:00 heroku[web.1]: Process exited with status 1
2015-07-18T18:52:45.262519+00:00 heroku[web.1]: State changed from starting to crashed
2015-07-18T18:52:45.263702+00:00 heroku[web.1]: State changed from crashed to starting
2015-07-18T18:52:49.560089+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 52931 -e production`
2015-07-18T18:52:55.289443+00:00 app[web.1]: => Booting Thin
2015-07-18T18:52:55.289470+00:00 app[web.1]: => Rails 4.2.3 application starting in production on http://0.0.0.0:52931
2015-07-18T18:52:55.289473+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-07-18T18:52:55.289474+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-07-18T18:52:55.289475+00:00 app[web.1]: PG::UndefinedObject: ERROR:  type "string" does not exist
2015-07-18T18:52:55.289477+00:00 app[web.1]: LINE 1: SELECT 'string'::regtype::oid
2015-07-18T18:52:55.289478+00:00 app[web.1]:                ^
2015-07-18T18:52:55.289480+00:00 app[web.1]: : SELECT 'string'::regtype::oid
2015-07-18T18:52:55.289533+00:00 app[web.1]: Exiting
2015-07-18T18:52:55.289602+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec': PG::UndefinedObject: ERROR:  type "string" does not exist (ActiveRecord::StatementInvalid)
2015-07-18T18:52:55.289604+00:00 app[web.1]: LINE 1: SELECT 'string'::regtype::oid
2015-07-18T18:52:55.289605+00:00 app[web.1]:                ^
2015-07-18T18:52:55.289609+00:00 app[web.1]: : SELECT 'string'::regtype::oid
2015-07-18T18:52:55.289611+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
2015-07-18T18:52:55.289613+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
2015-07-18T18:52:55.289616+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2015-07-18T18:52:55.289618+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
2015-07-18T18:52:55.289621+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
2015-07-18T18:52:55.289625+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:393:in `lookup_cast_type'
2015-07-18T18:52:55.289631+00:00 app[web.1]:    from /app/app/models/contact.rb:4:in `<class:Contact>'
2015-07-18T18:52:55.289628+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/bundler/gems/activerecord-tableless-800393c52bd2/lib/activerecord-tableless.rb:93:in `column'
2015-07-18T18:52:55.289634+00:00 app[web.1]:    from /app/app/models/contact.rb:1:in `<top (required)>'
2015-07-18T18:52:55.289638+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
2015-07-18T18:52:55.289641+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'
2015-07-18T18:52:55.289648+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
2015-07-18T18:52:55.289645+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
2015-07-18T18:52:55.289654+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:317:in `depend_on'
2015-07-18T18:52:55.289651+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:360:in `require_or_load'
2015-07-18T18:52:55.289657+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:233:in `require_dependency'
2015-07-18T18:52:55.289661+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
2015-07-18T18:52:55.289664+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:471:in `each'
2015-07-18T18:52:55.289675+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:469:in `eager_load!'
2015-07-18T18:52:55.289668+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:471:in `block in eager_load!'
2015-07-18T18:52:55.289683+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
2015-07-18T18:52:55.289679+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application/finisher.rb:56:in `each'
2015-07-18T18:52:55.289686+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `instance_exec'
2015-07-18T18:52:55.289671+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:469:in `each'
2015-07-18T18:52:55.289678+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:346:in `eager_load!'
2015-07-18T18:52:55.289696+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
2015-07-18T18:52:55.289689+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:30:in `run'
2015-07-18T18:52:55.289702+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
2015-07-18T18:52:55.289692+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
2015-07-18T18:52:55.289706+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
2015-07-18T18:52:55.289699+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
2015-07-18T18:52:55.289721+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
2015-07-18T18:52:55.289729+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
2015-07-18T18:52:55.289708+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each'
2015-07-18T18:52:55.289723+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/initializable.rb:54:in `run_initializers'
2015-07-18T18:52:55.289732+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
2015-07-18T18:52:55.289711+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `call'
2015-07-18T18:52:55.289714+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
2015-07-18T18:52:55.289726+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application.rb:352:in `initialize!'
2015-07-18T18:52:55.289718+00:00 app[web.1]:    from /app/vendor/ruby-2.2.2/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
2015-07-18T18:52:55.289735+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'
2015-07-18T18:52:55.289738+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
2015-07-18T18:52:55.289741+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
2015-07-18T18:52:55.289748+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
2015-07-18T18:52:55.289751+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
2015-07-18T18:52:55.289745+00:00 app[web.1]:    from /app/config.ru:3:in `block in <main>'
2015-07-18T18:52:55.289754+00:00 app[web.1]:    from /app/config.ru:in `new'
2015-07-18T18:52:55.289774+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2015-07-18T18:52:55.289776+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
2015-07-18T18:52:55.289780+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
2015-07-18T18:52:55.289781+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
2015-07-18T18:52:55.289783+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
2015-07-18T18:52:55.289787+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
2015-07-18T18:52:55.289790+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:61:in `app'
2015-07-18T18:52:55.289792+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
2015-07-18T18:52:55.289795+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start'
2015-07-18T18:52:55.289798+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/server.rb:80:in `start'
2015-07-18T18:52:55.289801+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2015-07-18T18:52:55.289804+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `tap'
2015-07-18T18:52:55.289808+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:75:in `server'
2015-07-18T18:52:55.289811+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2015-07-18T18:52:55.289814+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
2015-07-18T18:52:55.289817+00:00 app[web.1]:    from bin/rails:8:in `require'
2015-07-18T18:52:55.289820+00:00 app[web.1]:    from bin/rails:8:in `<main>'
2015-07-18T18:52:56.648562+00:00 heroku[web.1]: Process exited with status 1
2015-07-18T18:52:56.673206+00:00 heroku[web.1]: State changed from starting to crashed
mattbrictson commented 9 years ago

Hi, I think you posted this issue in the wrong GitHub project. From your code it appears you are using the activerecord-tableless gem. Did you mean to post here instead?

https://github.com/softace/activerecord-tableless/issues

manivi commented 9 years ago

@mattbrictson oh boy so sorry I will close this and move it there thanks for the Link!