0

I have basically a bare-bones rails 3.1 application that I want to deploy to heroku. I have followed this tutorial to use Devise, Cancan, and Rolify. (I added a username column to Users table)

Everything is working just fine on my development server, but when I try to run heroku run rake db:migrate I get the error "rake aborted! uninitialized constant Rolify::Roles"

Here is my user.rb file

class User < ActiveRecord::Base
  include Rolify::Roles
  has_and_belongs_to_many :roles, :join_table => :users_roles

  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  attr_accessible :email, :password, :password_confirmation, :remember_me, :username
end

I have tried running heroku restart then trying the migration again, but no good.

n_i_c_k
  • 1,504
  • 10
  • 18

2 Answers2

1

change include Rolify::Roles to rolify

Menno
  • 35
  • 2
  • 6
0

So, I had already solved this question and forgot to post the answer here. I had been using an older version of rolify in my dev env than what heroku was using, so I ran bundle update and followed the update instructions on rolify git page and all was well.

n_i_c_k
  • 1,504
  • 10
  • 18