1

我在我的 rails 应用程序中使用设计。它在本地工作得很好。我已将所有内容推送到 Heroku,但是当我运行 heroku rake 路线时,Devise 路线没有出现。我只是得到:

    home_index GET    /home/index(.:format)     home#index
 deals_new GET    /deals/new(.:format)      deals#new
 deals_all GET    /deals/all(.:format)      deals#all
     deals GET    /deals(.:format)          deals#index
           POST   /deals(.:format)          deals#create
  new_deal GET    /deals/new(.:format)      deals#new
 edit_deal GET    /deals/:id/edit(.:format) deals#edit
      deal GET    /deals/:id(.:format)      deals#show
           PUT    /deals/:id(.:format)      deals#update
           DELETE /deals/:id(.:format)      deals#destroy
      root        /                         home#index

更新:

我已经让它大部分工作了。但是,仍然缺少 sign_up 路线:

          home_index GET    /home/index(.:format)         home#index
           deals_new GET    /deals/new(.:format)          deals#new
           deals_all GET    /deals/all(.:format)          deals#all
               deals GET    /deals(.:format)              deals#index
                     POST   /deals(.:format)              deals#create
            new_deal GET    /deals/new(.:format)          deals#new
           edit_deal GET    /deals/:id/edit(.:format)     deals#edit
                deal GET    /deals/:id(.:format)          deals#show
                     PUT    /deals/:id(.:format)          deals#update
                     DELETE /deals/:id(.:format)          deals#destroy
    new_user_session GET    /user/sign_in(.:format)       devise/sessions#new
        user_session POST   /user/sign_in(.:format)       devise/sessions#create
destroy_user_session DELETE /user/sign_out(.:format)      devise/sessions#destroy
       user_password POST   /user/password(.:format)      devise/passwords#create
   new_user_password GET    /user/password/new(.:format)  devise/passwords#new
  edit_user_password GET    /user/password/edit(.:format) devise/passwords#edit
                     PUT    /user/password(.:format)      devise/passwords#update
                root        /                             home#index
4

2 回答 2

2

我终于解决了这个问题。在我的 user.rb 模型中有一个:

 if Rails.env.production?

设计在这里设置了几个选项。在本地环境中 :registerable 已设置。它在生产环境中丢失。这就是为什么路线在本地而不是在生产中显示的原因。

于 2012-08-04T10:58:29.787 回答
0

实际上路线应该已经显示出来了。heroku 没有什么额外的.. 请检查以下内容-

  1. 您在 heroku 上部署了最新代码

    git push heroku 大师

  2. 重启heroku服务器

    heroku restart --app [你的应用名称]

于 2012-08-03T11:28:37.303 回答