po.studio
po.studio

Reputation: 4127

deploying devise/omniauth on heroku

When running:

heroku run rake db:migrate

I am returned the error:

Running `rake db:migrate` attached to terminal... up, run.1
rake aborted!
no such file to load -- devise

This is the error I see with a "require 'devise'" line in the top of my application.rb file. Previously (without this line), I was being returned a different error when running heroku run rake db:migrate saying "uninitialized constant Devise".

My app is working fine locally. I can't seem to find anyone else with the same problem, so any leads would be appreciated!

(edit): adding Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'bootstrap-sass', '2.0.0'

group :development do

gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.9.0'
gem 'guard-rspec', '0.5.5'
gem 'devise'
gem 'omniauth-linkedin'
gem 'nifty-generators', :group => :development
gem 'debugger'
gem 'linkedin', :git => "git://github.com/pengwynn/linkedin.git"

end 

group :assets do

gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
gem 'jquery-rails'#, '2.0.0'

end

group :test do

gem 'rspec-rails', '2.9.0'
gem 'capybara', '1.1.2'
gem 'rb-fsevent', '0.4.3.1', :require => false
gem 'growl', '1.0.3'
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.0'

end

group :production do

gem 'pg', '0.12.2'

end

gem "mocha", :group => :test

Upvotes: 1

Views: 489

Answers (1)

Nicos Karalis
Nicos Karalis

Reputation: 3773

The problem is: Heroku compiles your gem file without development or test groups.

to fix it just take what you need from here:

group :development do

gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.9.0'
gem 'guard-rspec', '0.5.5'
gem 'devise'
gem 'omniauth-linkedin'
gem 'nifty-generators', :group => :development
gem 'debugger'
gem 'linkedin', :git => "git://github.com/pengwynn/linkedin.git"

end 

and move it to anywhere outside groups of development or test, like this:

group :development do

gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.9.0'
gem 'guard-rspec', '0.5.5'
gem 'omniauth-linkedin'
gem 'nifty-generators', :group => :development
gem 'debugger'
gem 'linkedin', :git => "git://github.com/pengwynn/linkedin.git"

end 

gem 'devise'

Upvotes: 3

Related Questions