Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7906597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:03:20+00:00 2026-06-03T11:03:20+00:00

My App works without any problem locally, but as soon as I push it

  • 0

My App works without any problem locally, but as soon as I push it to Heroku the logs show a NoMethodError. Looking through my code, I do not really see what I am missing right away. Especially, why would it work locally but on Heroku it would throw a NoMethod?

Error

Started POST "/users" for <IP>
Processing by UsersController#create as HTML
Completed 500 Internal Server Error in 102ms

app/models/user.rb:38:in `create_remember_token'
app/controllers/users_controller.rb:28:in `create'

NoMethodError (undefined method `remember_token=' for #<User:0x000000052e8fb0>):

user.rb

class User < ActiveRecord::Base
attr_accessible :email, :name, :password, :password_confirmation, :image
has_secure_password
has_many :microposts, dependent: :destroy
mount_uploader :image, AvatarUploader

before_save { |user| user.email = email.downcase }
before_save :create_remember_token

validates :name, presence: true,
        length: { maximum: 50}
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true,
        format: { with: VALID_EMAIL_REGEX },
        uniqueness: { case_sensitive: false }

validates :password, length: {minimum: 6}
validates :password_confirmation, presence: true


private
def create_remember_token
  self.remember_token = SecureRandom.urlsafe_base64
end

user_controller.rb

class UsersController < ApplicationController
before_filter :signed_in_user, only: [:index, :edit, :update, :destroy]
before_filter :correct_user,   only: [:edit, :update]
before_filter :admin_user,     only: :destroy


def index
  @users = User.paginate(page: params[:page])
end

def show
  @user = User.find(params[:id])
  @microposts = @user.microposts.paginate(page: params[:page])
end

def new
  @user = User.new
end

def destroy
  User.find(params[:id]).destroy
  flash[:success] = "User destroyed."
  redirect_to users_path
end

def create
  @user = User.new(params[:user])
  if @user.save
  sign_in @user
  flash[:success] = "Welcome to El Beano"
  redirect_to @user
else
  render 'new'
  end
end

def edit
  @user = User.find(params[:id])
end

def update
  @user = User.find(params[:id])
  if @user.update_attributes(params[:user])
    flash[:success] = 'Profile updated'
    sign_in @user
    redirect_to @user
  else
    render 'edit'
  end
end

private


  def correct_user
    @user = User.find(params[:id])
    redirect_to(root_path) unless current_user?(@user)
  end

  def admin_user
    redirect_to(root_path) unless current_user.admin?
  end
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:03:21+00:00Added an answer on June 3, 2026 at 11:03 am

    It looks as it you’ve uploaded your code to Heroku but the database migration that created that column was not run or did not run correctly.

    Can you verify that the column is there?

    Also, have you tried logging to a console session on your heroku instance:

    heroku run bash --app my_app
    bundle exec rails c
    

    Then testing that you can access that property in that environment?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple app in my project. This app works without any problem. I
My app works fine in the simulator but when I run it on my
My app works perfectly fine in the simulator but crashes on the Device. How
can someone tell me why my app works fine on samsumg galaxy nexus but
I downloaded the PhotoView reference app for Win7 with source. The app works, but
In my Android app I use a TabWidget without any special customization. I'd like
I've been investigating this problem for 3 days now, without any luck. I'm quite
I have a C# service that works without any problems on my laptop (Windows 7).
I have one web app works perfectly under linux with jetty-6.1.22. However, when I
I'm kind of new at this: My app works great in Linux, where I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.