Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes on Heroku :-( #38

Open
carlesjove opened this issue Jan 25, 2015 · 2 comments
Open

App crashes on Heroku :-( #38

carlesjove opened this issue Jan 25, 2015 · 2 comments

Comments

@carlesjove
Copy link
Owner

Working as expected on development. Tests passing.

Running `rails c` attached to terminal... up, run.7511
/app/app/serializers/bill_serializer.rb:6:in `block in <class:BillSerializer>': undefined method `bills_url' for #<Module:0x007f3a1eab8d58> (NoMethodError)
    from /app/vendor/bundle/ruby/2.1.0/gems/collection_json_serializer-0.3.2/lib/collection_json_serializer/serializer.rb:42:in `instance_eval'
    from /app/vendor/bundle/ruby/2.1.0/gems/collection_json_serializer-0.3.2/lib/collection_json_serializer/serializer.rb:42:in `items'
    from /app/app/serializers/bill_serializer.rb:2:in `<class:BillSerializer>'
    from /app/app/serializers/bill_serializer.rb:1:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:360:in `require_or_load'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:317:in `depend_on'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:233:in `require_dependency'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:471:in `each'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:471:in `block in eager_load!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:469:in `each'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:469:in `eager_load!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:346:in `eager_load!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application/finisher.rb:56:in `each'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
    from /app/config/environment.rb:5:in `<top (required)>'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:328:in `require_environment!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:142:in `require_application_and_environment!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:67:in `console'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
    from /app/bin/rails:8:in `require'
    from /app/bin/rails:8:in `<main>'

Here's the serializer:

class BillSerializer < CollectionJson::Serializer
  items do
    attributes :id, :description, :subtotal, :total, :vat_amount, :taxes_amount,
               :applicable_vat, :applicable_taxes

    href Rails.application.routes.url_helpers.bills_url << "/{id}"

    links pdf: {
            href: Rails.application.routes.url_helpers.pdf_index_url << "/{id}.pdf"
          }
  end

  template :identifier, :description, :amount, :amount_is, :vat, :taxes

  links create: {
          href: Rails.application.routes.url_helpers.bills_url,
          prompt: "Add a New Bill"
        }
end
@carlesjove
Copy link
Owner Author

This are the methods available for Rails.[...].url_helpers on Heroku:

["url_for", "optimize_routes_generation?", "_routes", "url_options",
  "append_features", "included", "class_methods", "freeze", "===", "==",
  "\u003c=\u003e", "\u003c", "\u003c=", "\u003e", "\u003e=", "to_s", "inspect",
  "included_modules", "include?", "name", "ancestors", "instance_methods",
  "public_instance_methods", "protected_instance_methods",
  "private_instance_methods", "constants", "const_get", "const_set",
  "const_defined?", "class_variables", "remove_class_variable",
  "class_variable_get", "class_variable_set", "class_variable_defined?",
  "public_constant", "private_constant", "singleton_class?", "include",
  "prepend", "module_exec", "class_exec", "module_eval", "class_eval",
  "method_defined?", "public_method_defined?", "private_method_defined?",
  "protected_method_defined?", "public_class_method", "private_class_method",
  "autoload", "autoload?", "instance_method", "public_instance_method",
  "mattr_reader", "cattr_reader", "mattr_writer", "cattr_writer",
  "mattr_accessor", "cattr_accessor", "remove_possible_method",
  "redefine_method", "delegate", "alias_method_chain", "alias_attribute",
  "deprecate", "parent_name", "parent", "parents", "local_constants",
  "attr_internal_reader", "attr_internal_writer", "attr_internal_accessor",
  "attr_internal", "anonymous?", "reachable?", "psych_yaml_as", "yaml_as",
  "qualified_const_defined?", "qualified_const_get", "qualified_const_set",
  "methods_transplantable?", "const_missing", "guess_for_anonymous",
  "unloadable", "concerning", "concern", "blank?", "present?", "presence",
  "acts_like?", "duplicable?", "deep_dup", "itself", "try", "try!", "in?",
  "presence_in", "to_param", "to_query", "instance_values",
  "instance_variable_names", "to_json_with_active_support_encoder",
  "to_json_without_active_support_encoder", "to_json", "as_json",
  "with_options", "html_safe?", "psych_to_yaml", "to_yaml",
  "to_yaml_properties", "`", "require_or_load", "require_dependency",
  "load_dependency", "nil?", "=~", "!~", "eql?", "hash", "class",
  "singleton_class", "clone", "dup", "taint", "tainted?", "untaint", "untrust",
  "untrusted?", "trust", "frozen?", "methods", "singleton_methods",
  "protected_methods", "private_methods", "public_methods",
  "instance_variables", "instance_variable_get", "instance_variable_set",
  "instance_variable_defined?", "remove_instance_variable", "instance_of?",
  "kind_of?", "is_a?", "tap", "send", "public_send", "respond_to?", "extend",
  "display", "method", "public_method", "singleton_method",
  "define_singleton_method", "object_id", "to_enum", "enum_for", "gem",
  "silence_warnings", "enable_warnings", "with_warnings", "silence_stderr",
  "silence_stream", "suppress", "capture", "silence", "quietly",
  "suppress_warnings", "equal?", "!", "!=", "instance_eval", "instance_exec",
  "__send__", "__id__"
]

This is the list of methods on development:

["url_for", "optimize_routes_generation?", "_routes", "url_options",
  "pdf_index_path", "pdf_path", "users_path", "user_path", "login_path",
  "expenses_path", "expense_path", "bills_path", "bill_path",
  "rails_info_properties_path", "rails_info_routes_path", "rails_info_path",
  "rails_mailers_path", "pdf_index_url", "pdf_url", "users_url", "user_url",
  "login_url", "expenses_url", "expense_url", "bills_url", "bill_url",
  "rails_info_properties_url", "rails_info_routes_url", "rails_info_url",
  "rails_mailers_url", "append_features", "included", "class_methods", "freeze",
  "===", "==", "\u003c=\u003e", "\u003c", "\u003c=", "\u003e", "\u003e=",
  "to_s", "inspect", "included_modules", "include?", "name", "ancestors",
  "instance_methods", "public_instance_methods", "protected_instance_methods",
  "private_instance_methods", "constants", "const_get", "const_set",
  "const_defined?", "class_variables", "remove_class_variable",
  "class_variable_get", "class_variable_set", "class_variable_defined?",
  "public_constant", "private_constant", "singleton_class?", "include",
  "prepend", "module_exec", "class_exec", "module_eval", "class_eval",
  "method_defined?", "public_method_defined?", "private_method_defined?",
  "protected_method_defined?", "public_class_method", "private_class_method",
  "autoload", "autoload?", "instance_method", "public_instance_method",
  "mattr_reader", "cattr_reader", "mattr_writer", "cattr_writer",
  "mattr_accessor", "cattr_accessor", "remove_possible_method",
  "redefine_method", "delegate", "alias_method_chain", "alias_attribute",
  "deprecate", "parent_name", "parent", "parents", "local_constants",
  "attr_internal_reader", "attr_internal_writer", "attr_internal_accessor",
  "attr_internal", "anonymous?", "reachable?", "psych_yaml_as", "yaml_as",
  "qualified_const_defined?", "qualified_const_get", "qualified_const_set",
  "example_group", "describe", "context", "xdescribe", "xcontext", "fdescribe",
  "fcontext", "shared_examples", "shared_context", "shared_examples_for",
  "methods_transplantable?", "const_missing", "guess_for_anonymous",
  "unloadable", "concerning", "concern", "blank?", "present?", "presence",
  "acts_like?", "duplicable?", "deep_dup", "itself", "try", "try!", "in?",
  "presence_in", "to_param", "to_query", "instance_values",
  "instance_variable_names", "to_json_with_active_support_encoder",
  "to_json_without_active_support_encoder", "to_json", "as_json",
  "with_options", "html_safe?", "psych_to_yaml", "to_yaml",
  "to_yaml_properties", "`", "require_or_load", "require_dependency",
  "load_dependency", "nil?", "=~", "!~", "eql?", "hash", "class",
  "singleton_class", "clone", "dup", "taint", "tainted?", "untaint", "untrust",
  "untrusted?", "trust", "frozen?", "methods", "singleton_methods",
  "protected_methods", "private_methods", "public_methods",
  "instance_variables", "instance_variable_get", "instance_variable_set",
  "instance_variable_defined?", "remove_instance_variable", "instance_of?",
  "kind_of?", "is_a?", "tap", "send", "public_send", "respond_to?", "extend",
  "display", "method", "public_method", "singleton_method",
  "define_singleton_method", "object_id", "to_enum", "enum_for", "gem",
  "silence_warnings", "enable_warnings", "with_warnings", "silence_stderr",
  "silence_stream", "suppress", "capture", "silence", "quietly",
  "suppress_warnings", "equal?", "!", "!=", "instance_eval", "instance_exec",
  "__send__", "__id__"
]

As seen, any of the actual routes is present in production.

@carlesjove
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant