我有一个Rails应用程序,我尝试将其推送到Heroku。在我将它推送到Heroku之后,我收到了应用程序错误消息。
当我运行heroku logs -n 300
时,我得到this(抱歉粘贴Gist中的日志.StackOverflow不允许我发布> 30K字符问题)。
这是我的Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Twitter Bootstrap
gem 'bootstrap-sass', '3.2.0.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Devise for user auth
gem 'devise'
# CanCanCan for user roles
gem 'cancancan', '~> 1.10'
# Gravatar
gem 'gravatar_image_tag'
# Font Awesome
gem 'font-awesome-sass'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
ruby "2.2.2"
我认为错误是因为我没有在Heroku上运行rake db:migrate
。但是,在我运行heroku run rake db:migrate
之后,错误仍然相同。
我该怎么办?
注意:此应用在我的localhost上运行良好。
答案 0 :(得分:2)
您在uninitialized constant Users (NameError)
文件第1行收到app/controllers/Users/confirmations_controller.rb
错误。可能您正在尝试以单数形式使用User
类,并且只是错误输入了它。
答案 1 :(得分:0)
解决。
我将所有用户控制器移到/ controllers /文件夹中。
app/controllers/Users/*_controller.rb
到
app/controllers/
...并删除用户文件夹。