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

Heroku db migration error #107

Closed laurenierullo closed 9 years ago

laurenierullo commented 9 years ago

Everything works fine locally, and the homepage loads on heroku just fine. But when I click "log in" I get an error page. I followed all instructions and when I migrate I get the issue below.

$ heroku run rake db:migrate Running rake db:migrate attached to terminal... up, run.7585 rake aborted! cannot load such file -- teaspoon/console

In the heroku app when I click "log in" on the homepage and then look at heroku logs it says:

ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "users" does not exist LINE 5: WHERE a.attrelid = ' "users" '::regclass ^

Please help!

tmock12 commented 9 years ago

Is the teaspoon gem in a test/development group? Should look something like:

gem "teaspoon", ">= 0.7.4", :group => [:development, :test]
laurenierullo commented 9 years ago

Yep. It looks like this:

gem "teaspoon", ">= 0.7.4", :group => [:development, :test]

tmock12 commented 9 years ago

I may have found it. Look in

lib/tasks/spec.rake

Line 2 should only require "teaspoon/console" if the environment is test or development. So change line 2 to something like

require "teaspoon/console" if %w[development test].include?(Rails.env)
laurenierullo commented 9 years ago

IT WORKED! Thank you for your quick responses. :D

tmock12 commented 9 years ago

No problem, happy I could help.