function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KunjanKunjan 

Heroku Error: App crashed

Hi, I deployed my application on heroku and while visiting it form url http://blooming-day-347.heroku.com/ it gives me app crashed error. By log file I see the below error: ==> dyno-4757045.log (crash) <== /disk1/home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/app/models/salesforce /account.rb:1: superclass mismatch for class Account (TypeError) from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 :in `gem_original_require' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 :in `require' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/act ivesupport-2.3.8/lib/active_support/dependencies.rb:158:in `require' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/act ivesupport-2.3.8/lib/active_support/dependencies.rb:265:in `require_or_load' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/act ivesupport-2.3.8/lib/active_support/dependencies.rb:224:in `depend_on' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/act ivesupport-2.3.8/lib/active_support/dependencies.rb:136:in `require_dependency' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:414:in `load_application_classes' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:413:in `each' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:413:in `load_application_classes' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:411:in `each' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:411:in `load_application_classes' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:197:in `process' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:113:in `send' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rai ls-2.3.8/lib/initializer.rb:113:in `run' from /disk1/home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/config/e nvironment.rb:9 from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 :in `gem_original_require' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31 :in `require' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/r ails.rb:42:in `load_application' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/r ails.rb:23:in `initialize' from /home/heroku_rack/heroku.ru:29:in `new' from /home/heroku_rack/heroku.ru:29 from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:46:in `instance_eval' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:46:in `initialize' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:63:in `new' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:63:in `map' from /home/heroku_rack/heroku.ru:18 from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:46:in `instance_eval' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:46:in `initialize' from /home/heroku_rack/heroku.ru:11:in `new' from /home/heroku_rack/heroku.ru:11 from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:46:in `instance_eval' from /home/slugs/1e63ec9f-b582-4585-b5ae-5fafc992e826/mnt/.gems/gems/rac k-1.1.0/lib/rack/builder.rb:46:in `initialize' from /home/heroku_rack/heroku.ru:1:in `new' from /home/heroku_rack/heroku.ru:1 -----> Your application crashed. I am communicating with salesforce and it's working fine on locally. Please help me to figure out the above error. Thanks in advance
cloudcodercloudcoder

It looks like you are missing a dependency in your Gemfile. Can you please post what your file looks like as well as your yml and environments.rb file?

KunjanKunjan

My salesforce.yml file looks like:
salesforce-default-realm:
    adapter: activesalesforce
    url: https://www.salesforce.com
    username: salesforce user name
    password: password + security token
    api_version: 20.0

My environment.rb file looks like:
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
  config.database_configuration_file = File.join(RAILS_ROOT, 'config', 'salesforce.yml')
  config.gem "asf-soap-adapter", :lib => "asf-soap-adapter"
  config.time_zone = 'UTC'
end

My .gems file looks like:
asf-soap-adapter --version 1.0.4
rails --version 2.3.8

My model file looks like:
class Salesforce::Account < ActiveRecord::Base
end

cloudcodercloudcoder

Are you using bundler? Can you post the contents of your 'Gemfile'. Heroku requires that all gems are 'bundled' with the app.

 

KunjanKunjan

I am using manifest, not bundler.

I have created .gems file and content of that file like:

 

asf-soap-adapter --version 1.0.4
rails --version 2.3.8

cloudcodercloudcoder

For standard objects such as Account in your example, you do not need to make a model class. This is provided for you by the toolkit. The problem you are seeing is related to the Account model that you created. If you want to create a custom object the syntax is like the following:

 

class Salesforce::MyCustomObject < SfBase

end

 

Note I am using SfBase, not Active Record as in your example