RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

Membership Site loads fine locally, but when pushed to Heroku I get an error loading the signup page #164

Closed beardedguru closed 7 years ago

beardedguru commented 7 years ago

Hey Guys/Gals, want to thank you for your detailed tutorials. I recently was introduced to Rails from a friend that was trying to get me to build this membership product in rails instead of the current platform I am using.

I've worked on this for the past week and problem after problem trying to get this to go live lol. I managed to overcome all of the issues locally but when I push to Heroku I keep getting an error when clicking on the signup link:

2017-01-02T22:09:30.705597+00:00 app[web.1]: I, [2017-01-02T22:09:30.705508 #4]  INFO -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e] Started GET "/users/sign_up" for 99.231.32.114 at 2017-01-02 22:09:30 +0000
2017-01-02T22:09:30.707104+00:00 app[web.1]: I, [2017-01-02T22:09:30.707047 #4]  INFO -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e] Processing by RegistrationsController#new as HTML
2017-01-02T22:09:30.711700+00:00 app[web.1]: D, [2017-01-02T22:09:30.711605 #4] DEBUG -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]   Plan Load (1.2ms)  SELECT  "plans".* FROM "plans" ORDER BY "plans"."id" DESC LIMIT $1  [["LIMIT", 1]]
2017-01-02T22:09:30.713648+00:00 app[web.1]: I, [2017-01-02T22:09:30.713579 #4]  INFO -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]   Rendering devise/registrations/new.html.erb within layouts/application
2017-01-02T22:09:30.714252+00:00 app[web.1]: I, [2017-01-02T22:09:30.714192 #4]  INFO -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]   Rendered vendor/bundle/ruby/2.2.0/gems/payola-payments-1.5.0/app/views/payola/transactions/_stripe_header.html.erb (0.2ms)
2017-01-02T22:09:30.716584+00:00 app[web.1]: I, [2017-01-02T22:09:30.716300 #4]  INFO -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]   Rendered devise/registrations/new.html.erb within layouts/application (2.6ms)
2017-01-02T22:09:30.716958+00:00 app[web.1]: I, [2017-01-02T22:09:30.716899 #4]  INFO -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e] Completed 500 Internal Server Error in 10ms (ActiveRecord: 1.2ms)
2017-01-02T22:09:30.719108+00:00 app[web.1]: F, [2017-01-02T22:09:30.719020 #4] FATAL -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]   
2017-01-02T22:09:30.719207+00:00 app[web.1]: F, [2017-01-02T22:09:30.719151 #4] FATAL -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e] ActionView::Template::Error (undefined method `plan_class' for nil:NilClass):
2017-01-02T22:09:30.719528+00:00 app[web.1]: F, [2017-01-02T22:09:30.719470 #4] FATAL -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]      5:   <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :role => 'form',
2017-01-02T22:09:30.719530+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e]      6:         :class => 'payola-onestep-subscription-form',
2017-01-02T22:09:30.719531+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e]      7:         'data-payola-base-path' => payola_path,
2017-01-02T22:09:30.719532+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e]      8:         'data-payola-plan-type' => resource.plan.plan_class,
2017-01-02T22:09:30.719533+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e]      9:         'data-payola-plan-id' => resource.plan.id}) do |f| %>
2017-01-02T22:09:30.719534+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e]     10:     <h3>Sign up</h3>
2017-01-02T22:09:30.719535+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e]     11:     <div>
2017-01-02T22:09:30.719606+00:00 app[web.1]: F, [2017-01-02T22:09:30.719555 #4] FATAL -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e]   
2017-01-02T22:09:30.719685+00:00 app[web.1]: F, [2017-01-02T22:09:30.719636 #4] FATAL -- : [1da9d422-f2b8-4461-9474-10de5b5e1a4e] app/views/devise/registrations/new.html.erb:8:in `_app_views_devise_registrations_new_html_erb__2325709040735767357_70274222505740'
2017-01-02T22:09:30.719686+00:00 app[web.1]: [1da9d422-f2b8-4461-9474-10de5b5e1a4e] app/controllers/registrations_controller.rb:12:in `new'
2017-01-02T22:09:30.724433+00:00 heroku[router]: at=info method=GET path="/users/sign_up" host=guruscriptz.herokuapp.com request_id=1da9d422-f2b8-4461-9474-10de5b5e1a4e fwd="99.231.32.114" dyno=web.1 connect=1ms service=17ms status=500 bytes=1669

Any idea here on how to get this fixed?

beardedguru commented 7 years ago

Scratch that it looks like its happening on my local host as well ><

No method error:

<% end %>
<div class="authform">
  <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :role => 'form',
        :class => 'payola-onestep-subscription-form',
        'data-payola-base-path' => payola_path,
        'data-payola-plan-type' => resource.plan.plan_class,
        'data-payola-plan-id' => resource.plan.id}) do |f| %>
    <h3>Sign up</h3>
    <div>
      <br />
      <span id="error_explanation" class="payola-payment-error"></span>

Seems to be an issue with 'data-payola-plan-type' => resource.plan.plan_class