Note that there are some explanatory texts on larger screens.

plurals
  1. PO"uninitialized constant Users (NameError)" w/ Heroku deploy
    primarykey
    data
    text
    <p>I've built a basic Rails app with Mongoid, Devise and Omniauth for Facebook login. I've got no problem running it locally, but when I try to push to Heroku, I'm getting this error:</p> <pre><code>"/app/app/controllers/Users/omniauth_callbacks_controller.rb:1:in `': uninitialized constant Users (NameError)" </code></pre> <p>I've Googled the hell out of this with little luck. I've committed the User model, I've ran "heroku run rake db:migrate", etc. No luck. Here's my stack.</p> <pre><code>Ruby 1.9.2 Rails 3.2.1 </code></pre> <p>Gemfile:</p> <pre><code>require 'rbconfig' HOST_OS = RbConfig::CONFIG['host_os'] source 'https://rubygems.org' gem 'rails', '3.2.1' group :assets do gem 'sass-rails', '~&gt; 3.2.3' gem 'coffee-rails', '~&gt; 3.2.1' gem 'uglifier', '&gt;= 1.0.3' end gem 'jquery-rails' gem "bson_ext", "&gt;= 1.6.1" gem "mongoid" gem "devise" gem "zurb-foundation" gem "omniauth" gem 'omniauth-facebook' gem 'gravatar_image_tag' </code></pre> <p>Gemfile.lock:</p> <pre><code>GEM remote: https://rubygems.org/ specs: actionmailer (3.2.1) actionpack (= 3.2.1) mail (~&gt; 2.4.0) actionpack (3.2.1) activemodel (= 3.2.1) activesupport (= 3.2.1) builder (~&gt; 3.0.0) erubis (~&gt; 2.7.0) journey (~&gt; 1.0.1) rack (~&gt; 1.4.0) rack-cache (~&gt; 1.1) rack-test (~&gt; 0.6.1) sprockets (~&gt; 2.1.2) activemodel (3.2.1) activesupport (= 3.2.1) builder (~&gt; 3.0.0) activerecord (3.2.1) activemodel (= 3.2.1) activesupport (= 3.2.1) arel (~&gt; 3.0.0) tzinfo (~&gt; 0.3.29) activeresource (3.2.1) activemodel (= 3.2.1) activesupport (= 3.2.1) activesupport (3.2.1) i18n (~&gt; 0.6) multi_json (~&gt; 1.0) addressable (2.2.7) arel (3.0.2) bcrypt-ruby (3.0.1) bson (1.6.1) bson_ext (1.6.1) bson (~&gt; 1.6.1) builder (3.0.0) coffee-rails (3.2.2) coffee-script (&gt;= 2.2.0) railties (~&gt; 3.2.0) coffee-script (2.2.0) coffee-script-source execjs coffee-script-source (1.2.0) devise (2.0.4) bcrypt-ruby (~&gt; 3.0) orm_adapter (~&gt; 0.0.3) railties (~&gt; 3.1) warden (~&gt; 1.1.1) erubis (2.7.0) execjs (1.3.0) multi_json (~&gt; 1.0) faraday (0.7.6) addressable (~&gt; 2.2) multipart-post (~&gt; 1.1) rack (~&gt; 1.1) gravatar_image_tag (1.0.0) hashie (1.2.0) hike (1.2.1) i18n (0.6.0) journey (1.0.3) jquery-rails (2.0.2) railties (&gt;= 3.2.0, &lt; 5.0) thor (~&gt; 0.14) json (1.6.6) mail (2.4.4) i18n (&gt;= 0.4.0) mime-types (~&gt; 1.16) treetop (~&gt; 1.4.8) mime-types (1.18) mongo (1.6.1) bson (~&gt; 1.6.1) mongoid (2.4.7) activemodel (~&gt; 3.1) mongo (~&gt; 1.3) tzinfo (~&gt; 0.3.22) multi_json (1.2.0) multipart-post (1.1.5) oauth2 (0.5.2) faraday (~&gt; 0.7) multi_json (~&gt; 1.0) omniauth (1.0.3) hashie (~&gt; 1.2) rack omniauth-facebook (1.2.0) omniauth-oauth2 (~&gt; 1.0.0) omniauth-oauth2 (1.0.0) oauth2 (~&gt; 0.5.0) omniauth (~&gt; 1.0) orm_adapter (0.0.7) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) rack (&gt;= 0.4) rack-ssl (1.3.2) rack rack-test (0.6.1) rack (&gt;= 1.0) rails (3.2.1) actionmailer (= 3.2.1) actionpack (= 3.2.1) activerecord (= 3.2.1) activeresource (= 3.2.1) activesupport (= 3.2.1) bundler (~&gt; 1.0) railties (= 3.2.1) railties (3.2.1) actionpack (= 3.2.1) activesupport (= 3.2.1) rack-ssl (~&gt; 1.3.2) rake (&gt;= 0.8.7) rdoc (~&gt; 3.4) thor (~&gt; 0.14.6) rake (0.9.2.2) rdoc (3.12) json (~&gt; 1.4) sass (3.1.15) sass-rails (3.2.5) railties (~&gt; 3.2.0) sass (&gt;= 3.1.10) tilt (~&gt; 1.3) sprockets (2.1.2) hike (~&gt; 1.2) rack (~&gt; 1.0) tilt (~&gt; 1.1, != 1.3.0) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) polyglot polyglot (&gt;= 0.3.1) tzinfo (0.3.32) uglifier (1.2.4) execjs (&gt;= 0.3.0) multi_json (&gt;= 1.0.2) warden (1.1.1) rack (&gt;= 1.0) zurb-foundation (2.2.0.2) jquery-rails (&gt;= 1.0) rails (~&gt; 3.1) PLATFORMS ruby DEPENDENCIES bson_ext (&gt;= 1.6.1) coffee-rails (~&gt; 3.2.1) devise gravatar_image_tag jquery-rails mongoid omniauth omniauth-facebook rails (= 3.2.1) sass-rails (~&gt; 3.2.3) uglifier (&gt;= 1.0.3) zurb-foundation </code></pre> <p>Controller:</p> <pre><code>class Users::OmniauthCallbacksController &lt; Devise::OmniauthCallbacksController def facebook # You need to implement the method below in your model @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind =&gt; "Facebook" sign_in_and_redirect @user, :event =&gt; :authentication else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end end </code></pre> <p>Any thoughts ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload