我正在使用Devise和我的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
答案 0 :(得分:2)
我终于解决了这个问题。在我的user.rb模型中有一个:
if Rails.env.production?
Devise在这里设置了几个选项。在本地环境中:已设置可注册。它在生产环境中缺失。这就是为什么路线在当地展示而不是在生产中。
答案 1 :(得分:0)
实际上应该显示路线。 heroku没有什么额外的东西.. 请检查以下内容 -
您在heroku上部署了最新代码
git push heroku master
重启heroku服务器
heroku restart --app [您的应用名称]