だから私は自分のウェブアプリでDeviseを使いたいと思っていて、localhostですべてがうまくテストされましたが、それを私のec2インスタンスにアップロードすると、「ルートが一致しません[GET] "/"」というエラーが表示され、そうではありませんこれを解決する方法を知っています。
ここに私の Routes.rb があります:
devise_for :users
resources :submissions
root to: 'home#index'
scope "api" do
get "/submissions(.:format)" => "submissions#index"
get "/submissions/:id(.:format)" => "submissions#show"
end
get "/submissions/:id/edit(.:format)" => "submissions#edit"
そして、ここに私のGemfileがあります.gem: "devise"だけで試してみましたが、それもうまくいきませんでした。
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'therubyracer'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "devise", :git => "git://github.com/plataformatec/devise.git"
私のec2インスタンスのroutes.rbは次のとおりです。
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
submissions GET /submissions(.:format) submissions#index
POST /submissions(.:format) submissions#create
new_submission GET /submissions/new(.:format) submissions#new
edit_submission GET /submissions/:id/edit(.:format) submissions#edit
submission GET /submissions/:id(.:format) submissions#show
PUT /submissions/:id(.:format) submissions#update
DELETE /submissions/:id(.:format) submissions#destroy
root / home#index
GET /api/submissions(.:format) submissions#index
GET /api/submissions/:id(.:format) submissions#show
GET /submissions/:id/edit(.:format) submissions#edit