在heroku上部署devise / omniauth

时间:2012-07-18 14:35:39

标签: ruby-on-rails heroku devise

运行时:

heroku run rake db:migrate

我收到了错误:

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

这是我在"要求'设计""在我的application.rb文件的顶部。以前(没有这一行),我在运行heroku run rake db时返回了一个不同的错误:migrate say" uninitialized constant Devise"。

我的应用在本地工作正常。我似乎无法找到有同样问题的其他人,所以任何线索都会受到赞赏!

(编辑):添加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

1 个答案:

答案 0 :(得分:3)

问题是:Heroku编译你的gem文件而没有开发或测试组。

修复它只需从这里获取你需要的东西:

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 :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'