Jake Stevens
Jake Stevens

Reputation: 157

Devise No route matches [GET] "/"

So I'm wanting to use Devise with my web app, and everything tested out fine on localhost, but when I uploaded it to my ec2 instance I get the error ' No route matches [GET] "/" ' and I don't know how to solve this.

Here's my 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"

And here's my Gemfile, keeping in mind that I did try it with just gem: "devise" but that didn't work either.

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"

Here is my routes.rb on my ec2 instance:

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

Upvotes: 0

Views: 1092

Answers (2)

Sachin Singh
Sachin Singh

Reputation: 7225

run this at your root of your application and check whether it returns root route.

rake routes | grep root

Upvotes: 0

Chance Door
Chance Door

Reputation: 231

You can use rake routes to check if you have this route.

Have you runned locally in production mode?

If this problem still cannot be solved, you'd better paste result of rake routes then someone may figure it out.

Upvotes: 1

Related Questions