2013-05-01 37 views
0

我有一个可以在本地正常工作的应用程序,但是比尝试推送到heroku和root_to路由不起作用。您正在查找的页面不存在。 root_to

我已经看过所有其他帖子,但没有一个是route_to文件,而且我在网上找到的修复程序都没有工作。

我有activeadmin安装,所以我不知道如果这是影响它。我正在使用Devise来处理用户。

请帮忙,这是一个简单的网站,我不知道为什么它造成这么多麻烦。

GitHub库:https://github.com/spq24/seered

的routes.rb

Seered::Application.routes.draw do 
break if ARGV.join.include? 'assets:precompile' 
ActiveAdmin.routes(self) 

devise_for :admin_users, ActiveAdmin::Devise.config 

devise_for :users 

root :to => 'pages#home' 

get "pages/home" 

match '/about',  to: 'pages#about' 

耙路线输出:

   admin_root   /admin(.:format) 
     admin/dashboard#index 
    batch_action_admin_admin_users POST  /admin/admin_users/batch_action(.:for 
    at) admin/admin_users#batch_action 
       admin_admin_users GET  /admin/admin_users(.:format) 
     admin/admin_users#index 
            POST  /admin/admin_users(.:format) 
     admin/admin_users#create 
       new_admin_admin_user GET  /admin/admin_users/new(.:format) 
     admin/admin_users#new 
      edit_admin_admin_user GET  /admin/admin_users/:id/edit(.:format) 
     admin/admin_users#edit 
        admin_admin_user GET  /admin/admin_users/:id(.:format) 
     admin/admin_users#show 
            PUT  /admin/admin_users/:id(.:format) 
     admin/admin_users#update 
            DELETE  /admin/admin_users/:id(.:format) 
     admin/admin_users#destroy 
        admin_dashboard   /admin/dashboard(.:format) 
     admin/dashboard#index 
      batch_action_admin_users POST  /admin/users/batch_action(.:format) 
     admin/users#batch_action 
         admin_users GET  /admin/users(.:format) 
     admin/users#index 
            POST  /admin/users(.:format) 
     admin/users#create 
        new_admin_user GET  /admin/users/new(.:format) 
     admin/users#new 
        edit_admin_user GET  /admin/users/:id/edit(.:format) 
     admin/users#edit 
         admin_user GET  /admin/users/:id(.:format) 
     admin/users#show 
            PUT  /admin/users/:id(.:format) 
     admin/users#update 
            DELETE  /admin/users/:id(.:format) 
     admin/users#destroy 
     batch_action_admin_comments POST  /admin/comments/batch_action(.:format 
     admin/comments#batch_action 
        admin_comments GET  /admin/comments(.:format) 
     admin/comments#index 
            POST  /admin/comments(.:format) 
     admin/comments#create 
        admin_comment GET  /admin/comments/:id(.:format) 
     admin/comments#show 
      new_admin_user_session GET  /admin/login(.:format) 
     active_admin/devise/sessions#new 
       admin_user_session POST  /admin/login(.:format) 
     active_admin/devise/sessions#create 
     destroy_admin_user_session DELETE|GET /admin/logout(.:format) 
     active_admin/devise/sessions#destroy 
       admin_user_password POST  /admin/password(.:format) 
     active_admin/devise/passwords#create 
      new_admin_user_password GET  /admin/password/new(.:format) 
     active_admin/devise/passwords#new 
      edit_admin_user_password GET  /admin/password/edit(.:format) 
     active_admin/devise/passwords#edit 
            PUT  /admin/password(.:format) 
     active_admin/devise/passwords#update 
        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 
      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 
           root   /
     pages#home 
         pages_home GET  /pages/home(.:format) 
     pages#home 
          about   /about(.:format) 

配置/环境/生产

Seered::Application.configure do 
     # Settings specified here will take precedence over those in config/application.rb 

     # Code is not reloaded between requests 
     config.cache_classes = true 

     # Full error reports are disabled and caching is turned on 
     config.consider_all_requests_local  = false 
     config.action_controller.perform_caching = true 

     # Disable Rails's static asset server (Apache or nginx will already do this) 
     config.serve_static_assets = false 

     # Compress JavaScripts and CSS 
     config.assets.compress = true 

     # Don't fallback to assets pipeline if a precompiled asset is missed 
     config.assets.compile = true 

     # Generate digests for assets URLs 
     config.assets.digest = true 

     # Defaults to nil and saved in location specified by config.assets.prefix 
     # config.assets.manifest = YOUR_PATH 

     # Specifies the header that your server uses for sending files 
     # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 
     # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 

     # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 
     # config.force_ssl = true 

     # See everything in the log (default is :info) 
     # config.log_level = :debug 

     # Prepend all log lines with the following tags 
     # config.log_tags = [ :subdomain, :uuid ] 

     # Use a different logger for distributed setups 
     # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 

     # Use a different cache store in production 
     # config.cache_store = :mem_cache_store 

     # Enable serving of images, stylesheets, and JavaScripts from an asset server 
     # config.action_controller.asset_host = "http://assets.example.com" 

     # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) 
     # config.assets.precompile += %w(search.js) 

     # Disable delivery errors, bad email addresses will be ignored 
     # config.action_mailer.raise_delivery_errors = false 

     # Enable threaded mode 
     # config.threadsafe! 

     # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 
     # the I18n.default_locale when a translation can not be found) 
     config.i18n.fallbacks = true 

     # Send deprecation notices to registered listeners 
     config.active_support.deprecation = :notify 

     # Log the query plan for queries taking more than this (works 
     # with SQLite, MySQL, and PostgreSQL) 
     # config.active_record.auto_explain_threshold_in_seconds = 0.5 

     #Domain name for Devise 
     config.action_mailer.default_url_options = { :host => 'localhost:3000' } 
     config.assets.initialize_on_precompile = false 
    end 
+0

你确定你正在使用'master'分支并在​​'heroku'上推送吗? – kiddorails 2013-05-01 16:15:48

+0

@kiddorails看到我留下的评论,但没有其他分支。谢谢你的回答,但是这让我感到困惑,在我看来,所有事情都是正确的。 – 2013-05-01 17:33:41

+2

FWIW ...如果首先放置根路线,会发生什么?这通常是推荐的,因为它通常是应用程序中使用最多的路线。 – 2013-05-01 17:38:34

回答

0

尝试推杆首先根路线。这通常是推荐的,因为它通常是应用程序中访问次数最多的路线。

相关问题