(滑轨3.1,Heroku的雪松,红宝石1.9.3,MacOSX的,蚀,GIT)设计用户定制导致MissingTemplate上的用户,索引作用在root_path在Heroku
我的应用程序被部署在Heroku雪松,和色器件登录图层在最新版本中运行良好,但用户路径现在引发了缺少的模板错误。它在我的开发机器上工作正常。
我对最新做出的两大改变是 - 1)从Devise生成用户模型/视图/控制器,以便我可以自定义。 2)为设计用户路径添加了路径前缀(即注册)
作为对Heroku的测试,将root_path更改为允许访问应用程序的不同控制器/索引(即messages_path)。一切工作,除点击主页链接,这将再次尝试去users_path(同样缺少模板错误):
<%= link_to image_tag("homeIcon.png"), users_path, :method =>"GET", :id =>"menulink", :title => "Go Home." %>
我绝望任何洞察到这个问题,因为我想不出什么除了在Heroku上不使用Devise和Users这种方式。 任何和所有的想法,非常感谢!
感谢, 安妮
(注意研究:搜索上的错误信息,类似的问题,但没有约未能进入用户#指标,没有相关的设计和用户定制导致的错误消息的root_path;通过计算器ENGIN提出的审查问题清单)中的Eclipe
登录输出当地的发展:在Heroku
Started GET "/" for 127.0.0.1
(0.2ms) SHOW search_path
Processing by UsersController#index as HTML
Redirected to [local-machine]/myprefix/users/sign_in
...
Started GET "/" for 127.0.0.1 at 2014-05-17 08:31:13 -0400
Processing by UsersController#index as HTML
User Load (0.3ms) SELECT "users".* FROM "users"
登录输出。 用户登录,但users/index.html页面导致“对不起,但出错了”页面。
Started GET "/myprefix/users/sign_in" for ...
heroku[router]: at=info method=GET path=/assets/application...dyno=web.1
Rendered devise/sessions/new.html.erb within layouts/application (53.2ms)
Processing by Devise::SessionsController#new as HTML
cache: [GET /myprefix/users/sign_in] miss
…
heroku[router]: at=info method=POST path=/myprefix/users/sign_in
host=myapp.herokuapp.com
…
Started POST "/myprefix/users/sign_in"
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓"...
Redirected to http://myapp.herokuapp.com/
cache: [POST /myprefix/users/sign_in] invalidate, pass
method=GET path=/ host=myapp.herokuapp.com request_id=f...
Processing by UsersController#index as HTML
Completed 500 Internal Server Error in 49ms
Started GET "/" for ...
ActionView::MissingTemplate (Missing template users/index, application/index
with {:handlers=>[:erb, :builder, :coffee], :formats=>[:html], :locale=>[:en, :en]}.
Searched in:
ActionView::MissingTemplate (Missing template users/index, application/index with
{:handlers=>[:erb, :builder, :coffee], :formats=>[:html], :locale=>[:en, :en]}.
Searched in:
* "/app/app/views"
* "/app/vendor/bundle/ruby/1.9.1/gems/devise-2.2.8/app/views"
):
cache: [GET /] miss
(no other output)
File.properties shows location (i.e. eclipse ide)
[path-to-my-rail-app]/app/views/users/index.html.erb
[path-to-my-rail-app]/app/views/layouts/application.html.erb
routes.rb
MyApp::Application.routes.do
devise_for :views
devise_for :admins
devise_for :users, :path_prefix => 'myprefix'
resources :users do
resources :x, only: [:new, :create, :index, :edit,:destroy]
resources :y, only: [:new, :create, :index, :update, :destroy]
resources :z, only: [:new, :create, :index, :edit,:destroy,:update] do
get :q, :on => :member
end
end
rake routes output:
new_user_session GET
/myprefix/users/sign_in(.:format)
{:action=>"new", :controller=>"devise/sessions"}
user_session POST
/myprefix/users/sign_in(.:format)
{:action=>"create", :controller=>"devise/sessions"}
destroy_user_session DELETE
/myprefix/users/sign_out(.:format)
{:action=>"destroy", :controller=>"devise/sessions"}
user_password POST
/myprefix/users/password(.:format)
{:action=>"create", :controller=>"devise/passwords"}
new_user_password GET
/myprefix/users/password/new(.:format)
{:action=>"new", :controller=>"devise/passwords"}
edit_user_password
GET
/myprefix/users/password/edit(.:format)
{:action=>"edit", :controller=>"devise/passwords"}
PUT /myprefix/users/password(.:format)
{:action=>"update", :controller=>"devise/passwords"}
cancel_user_registration
GET /myprefix/users/cancel(.:format)
{:action=>"cancel", :controller=>"devise/registrations"}
user_registration POST /myprefix/users(.:format)
{:action=>"create", :controller=>"devise/registrations"}
new_user_registration GET
/myprefix/users/sign_up(.:format)
{:action=>"new", :controller=>"devise/registrations"}
edit_user_registration GET
/myprefix/users/edit(.:format)
{:action=>"edit", :controller=>"devise/registrations"}
PUT /myprefix/users(.:format)
{:action=>"update", :controller=>"devise/registrations"}
DELETE /myprefix/users(.:format)
{:action=>"destroy", :controller=>"devise/registrations"}
users GET /users(.:format) {:action=>"index", :controller=>"users"}
POST /users(.:format) {:action=>"create", :controller=>"users"}
new_user GET /users/new(.:format)
{:action=>"new", :controller=>"users"}
edit_user GET /users/:id/edit(.:format)
{:action=>"edit", :controller=>"users"}
user GET /users/:id(.:format)
{:action=>"show", :controller=>"users"}
PUT /users/:id(.:format)
{:action=>"update", :controller=>"users"}
DELETE /users/:id(.:format)
{:action=>"destroy", :controller=>"users"}
root /
{:controller=>"users", :action=>"index"}
的Gemfile: 源 'http://rubygems.org' 宝石 '捆绑' 红宝石 “1.9.2” 宝石 '轨道', '3.1.3' 宝石 'rails_12factor' ,组:::生产 gem'pg' gem'devise'
users_controller.rb:
class UsersController < ApplicationController
def index
@users = User.active_users
end
end
appliction.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'devise'
我对heroku相当陌生,无法找到如何验证服务器上的文件。我所要做的就是git仓库。 Heroku在说“一切都是最新的”。 我正在寻找heroku CLI,但找不到任何东西。 – user3647592