最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Heroku

运维笔记admin11浏览0评论

Heroku

Heroku

Heroku - 页面不存在(Heroku - Page Doesn't Exist)

在尝试访问我的应用程序时出现我的页面不存在的错误。 它在本地工作,但不是在系统上,我运行耙路和重新启动,没有解决。 虽然“页面不存在”显示我的自定义图标。 这是一个简单的一页应用程序,用于我的个人公司,我自己,非常基本,没有顶部,一套脚手架,这就是它....在RubyMine

路线文件:

BoothLeads::Application.routes.draw do resources :leads # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. #root :to => 'leads#index.html' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id))(.:format)'end

迁移

class CreateLeads < ActiveRecord::Migration def change create_table :leads do |t| t.string :name t.string :address t.string :phone t.text :interest t.timestamps end endend

LEADS控制器

class LeadsController < ApplicationController # GET /leads # GET /leads.json def index @leads = Lead.all respond_to do |format| format.html # index.html.erb format.json { render json: @leads } end end # GET /leads/1 # GET /leads/1.json def show @lead = Lead.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @lead } end end # GET /leads/new # GET /leads/new.json def new @lead = Lead.new respond_to do |format| format.html # new.html.erb format.json { render json: @lead } end end # GET /leads/1/edit def edit @lead = Lead.find(params[:id]) end # POST /leads # POST /leads.json def create @lead = Lead.new(params[:lead]) respond_to do |format| if @lead.save format.html { redirect_to @lead, notice: 'Lead was successfully created.' } format.json { render json: @lead, status: :created, location: @lead } else format.html { render action: "new" } format.json { render json: @lead.errors, status: :unprocessable_entity } end end end # PUT /leads/1 # PUT /leads/1.json def update @lead = Lead.find(params[:id]) respond_to do |format| if @lead.update_attributes(params[:lead]) format.html { redirect_to @lead, notice: 'Lead was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @lead.errors, status: :unprocessable_entity } end end end # DELETE /leads/1 # DELETE /leads/1.json def destroy @lead = Lead.find(params[:id]) @lead.destroy respond_to do |format| format.html { redirect_to leads_url } format.json { head :no_content } end endend

任何其他需要让我知道。

谢谢您的帮助。

CMD PROMPT:Heroku日志

C:\Users\Jeff Gray\RubymineProjects\BoothLeads>heroku logs2013-04-01T05:34:12+00:00 app[web.1]: Completed 200 OK in 218ms (Views: 61.9ms | ActiveRecord: 63.6ms)2013-04-01T05:34:13+00:00 heroku[router]: at=info method=GET path=/assets/application-01780e1cf08fc467414520399232647f.css host=peaceful-chamber-6371.herokuapp.com fwd="110.32.193.201" dyno=web.1 connect=1ms service=32ms status=200 bytes=2546292013-04-01T05:34:13+00:00 heroku[router]: at=info method=GET path=/assets/application-5909661ad10a83c2e0ae36fac77e7706.js host=peaceful-chamber-6371.herokuapp.com fwd="110.32.193.201" dyno=web.1 connect=1ms service=19ms status=200 bytes=1283952013-04-01T05:34:21+00:00 heroku[web.1]: Stopping all processes with SIGTERM2013-04-01T05:34:22+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'2013-04-01T05:34:22+00:00 app[web.1]: [2013-04-01 05:34:22] ERROR SignalException: SIGTERM2013-04-01T05:34:33+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL2013-04-01T05:34:33+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM2013-04-01T05:34:35+00:00 heroku[web.1]: Process exited with status 1372013-04-01T05:37:42+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by jeff.slim.gray@gmail.com2013-04-01T05:37:45+00:00 heroku[run.2185]: Awaiting client2013-04-01T05:37:45+00:00 heroku[run.2185]: Starting process with command `bundle exec rake db:migrate`2013-04-01T05:37:46+00:00 heroku[run.2185]: State changed from starting to up2013-04-01T05:37:54+00:00 heroku[run.2185]: Process exited with status 12013-04-01T05:37:54+00:00 heroku[run.2185]: State changed from up to complete2013-04-01T05:38:00+00:00 heroku[web.1]: State changed from up to starting2013-04-01T05:38:02+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 47627`2013-04-01T05:38:03+00:00 heroku[web.1]: Stopping all processes with SIGTERM2013-04-01T05:38:04+00:00 app[web.1]: [2013-04-01 05:38:04] ERROR SignalException: SIGTERM2013-04-01T05:38:04+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'2013-04-01T05:38:06+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: . (called from <top (required)> at /app/config/environment.rb:5)2013-04-01T05:38:06+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: . (called from <top (required)> at /app/config/environment.rb:5)2013-04-01T05:38:10+00:00 app[web.1]: => Booting WEBrick2013-04-01T05:38:10+00:00 app[web.1]: => Rails 3.2.12 application starting in production on :476272013-04-01T05:38:10+00:00 app[web.1]: => Call with -d to detach2013-04-01T05:38:10+00:00 app[web.1]: => Ctrl-C to shutdown server2013-04-01T05:38:10+00:00 app[web.1]: Connecting to database specified by DATABASE_URL2013-04-01T05:38:10+00:00 app[web.1]: [2013-04-01 05:38:10] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]2013-04-01T05:38:10+00:00 app[web.1]: [2013-04-01 05:38:10] INFO WEBrick 1.3.12013-04-01T05:38:10+00:00 app[web.1]: [2013-04-01 05:38:10] INFO WEBrick::HTTPServer#start: pid=2 port=476272013-04-01T05:38:11+00:00 heroku[web.1]: State changed from starting to up2013-04-01T05:38:14+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM2013-04-01T05:38:14+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL2013-04-01T05:38:17+00:00 heroku[web.1]: Process exited with status 1372013-04-01T05:38:36+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-chamber-6371.herokuapp.com fwd="75.170.18.86" dyno=web.1 connect=6ms service=194ms status=404 bytes=7282013-04-01T05:38:36+00:00 app[web.1]: Started GET "/" for 75.170.18.86 at 2013-04-01 05:38:35 +00002013-04-01T05:38:36+00:00 app[web.1]:2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'2013-04-01T05:38:36+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'2013-04-01T05:38:36+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'2013-04-01T05:38:36+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'2013-04-01T05:38:36+00:00 app[web.1]:2013-04-01T05:38:36+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'2013-04-01T05:38:36+00:00 app[web.1]:2013-04-01T05:39:44+00:00 app[web.1]: Started GET "/" for 75.170.18.86 at 2013-04-01 05:39:44 +00002013-04-01T05:39:44+00:00 app[web.1]:2013-04-01T05:39:44+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'2013-04-01T05:39:44+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-chamber-6371.herokuapp.com fwd="75.170.18.86" dyno=web.1 connect=2ms service=46ms status=404 bytes=7282013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'2013-04-01T05:39:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'2013-04-01T05:39:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'2013-04-01T05:39:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'2013-04-01T05:39:44+00:00 app[web.1]:2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'2013-04-01T05:39:44+00:00 app[web.1]:2013-04-01T05:39:54+00:00 app[web.1]: Started GET "/leads" for 110.32.193.201 at 2013-04-01 05:39:54 +00002013-04-01T05:39:54+00:00 app[web.1]: Processing by LeadsController#index as HTML2013-04-01T05:39:54+00:00 app[web.1]: Rendered leads/index.html.erb within layouts/application (12.6ms)2013-04-01T05:39:54+00:00 app[web.1]: Completed 200 OK in 207ms (Views: 60.8ms | ActiveRecord: 60.4ms)2013-04-01T05:39:54+00:00 heroku[router]: at=info method=GET path=/leads host=peaceful-chamber-6371.herokuapp.com fwd="110.32.193.201" dyno=web.1 connect=1ms service=228ms status=304 bytes=0

Production.rb

BoothLeads::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 = "" # 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.5end

Development.rb

BoothLeads::Application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger config.active_support.deprecation = :log # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin # Raise exception on mass assignment protection for Active Record models config.active_record.mass_assignment_sanitizer = :strict # 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 # Do not compress assets config.assets.compress = false # Expands the lines which load the assets config.assets.debug = trueend

猫/配置/ routes.rb中

C:\Users\Jeff Gray\RubymineProjects\BoothLeads>heroku run cat config/routes.rbRunning `cat config/routes.rb` attached to terminal... up, run.2943BoothLeads::Application.routes.draw do resources :solds resources :leads # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => 'welcome#index' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id))(.:format)'end

Getting an error that my page doesn't exist when trying to reach my application. It works locally, but not on the system, i have run rake and routes and restart, with no resolve. The "Page Doesn't" Exist does show my custom favicon though. THIS IS A SIMPLE ONE PAGE APP FOR USE WITHIN MY PERSONAL COMPANY I OWN, VERY BASIC, nothing over the top, one set of scaffolds and thats it.... Was developed in RubyMine

Routes File:

BoothLeads::Application.routes.draw do resources :leads # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. #root :to => 'leads#index.html' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id))(.:format)'end

Migrate

class CreateLeads < ActiveRecord::Migration def change create_table :leads do |t| t.string :name t.string :address t.string :phone t.text :interest t.timestamps end endend

LEADS CONTROLLER

class LeadsController < ApplicationController # GET /leads # GET /leads.json def index @leads = Lead.all respond_to do |format| format.html # index.html.erb format.json { render json: @leads } end end # GET /leads/1 # GET /leads/1.json def show @lead = Lead.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @lead } end end # GET /leads/new # GET /leads/new.json def new @lead = Lead.new respond_to do |format| format.html # new.html.erb format.json { render json: @lead } end end # GET /leads/1/edit def edit @lead = Lead.find(params[:id]) end # POST /leads # POST /leads.json def create @lead = Lead.new(params[:lead]) respond_to do |format| if @lead.save format.html { redirect_to @lead, notice: 'Lead was successfully created.' } format.json { render json: @lead, status: :created, location: @lead } else format.html { render action: "new" } format.json { render json: @lead.errors, status: :unprocessable_entity } end end end # PUT /leads/1 # PUT /leads/1.json def update @lead = Lead.find(params[:id]) respond_to do |format| if @lead.update_attributes(params[:lead]) format.html { redirect_to @lead, notice: 'Lead was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @lead.errors, status: :unprocessable_entity } end end end # DELETE /leads/1 # DELETE /leads/1.json def destroy @lead = Lead.find(params[:id]) @lead.destroy respond_to do |format| format.html { redirect_to leads_url } format.json { head :no_content } end endend

Anything else needed let me know.

Thanks for the help.

CMD PROMPT: Heroku Logs

C:\Users\Jeff Gray\RubymineProjects\BoothLeads>heroku logs2013-04-01T05:34:12+00:00 app[web.1]: Completed 200 OK in 218ms (Views: 61.9ms | ActiveRecord: 63.6ms)2013-04-01T05:34:13+00:00 heroku[router]: at=info method=GET path=/assets/application-01780e1cf08fc467414520399232647f.css host=peaceful-chamber-6371.herokuapp.com fwd="110.32.193.201" dyno=web.1 connect=1ms service=32ms status=200 bytes=2546292013-04-01T05:34:13+00:00 heroku[router]: at=info method=GET path=/assets/application-5909661ad10a83c2e0ae36fac77e7706.js host=peaceful-chamber-6371.herokuapp.com fwd="110.32.193.201" dyno=web.1 connect=1ms service=19ms status=200 bytes=1283952013-04-01T05:34:21+00:00 heroku[web.1]: Stopping all processes with SIGTERM2013-04-01T05:34:22+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'2013-04-01T05:34:22+00:00 app[web.1]: [2013-04-01 05:34:22] ERROR SignalException: SIGTERM2013-04-01T05:34:33+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL2013-04-01T05:34:33+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM2013-04-01T05:34:35+00:00 heroku[web.1]: Process exited with status 1372013-04-01T05:37:42+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by jeff.slim.gray@gmail.com2013-04-01T05:37:45+00:00 heroku[run.2185]: Awaiting client2013-04-01T05:37:45+00:00 heroku[run.2185]: Starting process with command `bundle exec rake db:migrate`2013-04-01T05:37:46+00:00 heroku[run.2185]: State changed from starting to up2013-04-01T05:37:54+00:00 heroku[run.2185]: Process exited with status 12013-04-01T05:37:54+00:00 heroku[run.2185]: State changed from up to complete2013-04-01T05:38:00+00:00 heroku[web.1]: State changed from up to starting2013-04-01T05:38:02+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 47627`2013-04-01T05:38:03+00:00 heroku[web.1]: Stopping all processes with SIGTERM2013-04-01T05:38:04+00:00 app[web.1]: [2013-04-01 05:38:04] ERROR SignalException: SIGTERM2013-04-01T05:38:04+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'2013-04-01T05:38:06+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: . (called from <top (required)> at /app/config/environment.rb:5)2013-04-01T05:38:06+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: . (called from <top (required)> at /app/config/environment.rb:5)2013-04-01T05:38:10+00:00 app[web.1]: => Booting WEBrick2013-04-01T05:38:10+00:00 app[web.1]: => Rails 3.2.12 application starting in production on :476272013-04-01T05:38:10+00:00 app[web.1]: => Call with -d to detach2013-04-01T05:38:10+00:00 app[web.1]: => Ctrl-C to shutdown server2013-04-01T05:38:10+00:00 app[web.1]: Connecting to database specified by DATABASE_URL2013-04-01T05:38:10+00:00 app[web.1]: [2013-04-01 05:38:10] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]2013-04-01T05:38:10+00:00 app[web.1]: [2013-04-01 05:38:10] INFO WEBrick 1.3.12013-04-01T05:38:10+00:00 app[web.1]: [2013-04-01 05:38:10] INFO WEBrick::HTTPServer#start: pid=2 port=476272013-04-01T05:38:11+00:00 heroku[web.1]: State changed from starting to up2013-04-01T05:38:14+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM2013-04-01T05:38:14+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL2013-04-01T05:38:17+00:00 heroku[web.1]: Process exited with status 1372013-04-01T05:38:36+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-chamber-6371.herokuapp.com fwd="75.170.18.86" dyno=web.1 connect=6ms service=194ms status=404 bytes=7282013-04-01T05:38:36+00:00 app[web.1]: Started GET "/" for 75.170.18.86 at 2013-04-01 05:38:35 +00002013-04-01T05:38:36+00:00 app[web.1]:2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'2013-04-01T05:38:36+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'2013-04-01T05:38:36+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'2013-04-01T05:38:36+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'2013-04-01T05:38:36+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'2013-04-01T05:38:36+00:00 app[web.1]:2013-04-01T05:38:36+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'2013-04-01T05:38:36+00:00 app[web.1]:2013-04-01T05:39:44+00:00 app[web.1]: Started GET "/" for 75.170.18.86 at 2013-04-01 05:39:44 +00002013-04-01T05:39:44+00:00 app[web.1]:2013-04-01T05:39:44+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call'2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call'2013-04-01T05:39:44+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-chamber-6371.herokuapp.com fwd="75.170.18.86" dyno=web.1 connect=2ms service=46ms status=404 bytes=7282013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call'2013-04-01T05:39:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'2013-04-01T05:39:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'2013-04-01T05:39:44+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'2013-04-01T05:39:44+00:00 app[web.1]:2013-04-01T05:39:44+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'2013-04-01T05:39:44+00:00 app[web.1]:2013-04-01T05:39:54+00:00 app[web.1]: Started GET "/leads" for 110.32.193.201 at 2013-04-01 05:39:54 +00002013-04-01T05:39:54+00:00 app[web.1]: Processing by LeadsController#index as HTML2013-04-01T05:39:54+00:00 app[web.1]: Rendered leads/index.html.erb within layouts/application (12.6ms)2013-04-01T05:39:54+00:00 app[web.1]: Completed 200 OK in 207ms (Views: 60.8ms | ActiveRecord: 60.4ms)2013-04-01T05:39:54+00:00 heroku[router]: at=info method=GET path=/leads host=peaceful-chamber-6371.herokuapp.com fwd="110.32.193.201" dyno=web.1 connect=1ms service=228ms status=304 bytes=0

Production.rb

BoothLeads::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 = "" # 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.5end

Development.rb

BoothLeads::Application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger config.active_support.deprecation = :log # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin # Raise exception on mass assignment protection for Active Record models config.active_record.mass_assignment_sanitizer = :strict # 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 # Do not compress assets config.assets.compress = false # Expands the lines which load the assets config.assets.debug = trueend

Cat/Config/Routes.rb

C:\Users\Jeff Gray\RubymineProjects\BoothLeads>heroku run cat config/routes.rbRunning `cat config/routes.rb` attached to terminal... up, run.2943BoothLeads::Application.routes.draw do resources :solds resources :leads # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => 'welcome#index' # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id))(.:format)'end 最满意答案

您的页面实际上即将发布(请尝试 ),只是没有为根目录定义路由( / )。

既然你打算这是一个单页的网站,我会“移动”到根源:

BoothLeads::Application.routes.draw do resources :leads, path: ''end

这将使您的潜在客户可以在本地使用localhost:3000,而在Heroku上的/ 。

Your pages are actually coming up (try ), it's just that there's no route defined for the root (/).

Since you intend this to be a single-page site, I'd "move" leads up to the root:

BoothLeads::Application.routes.draw do resources :leads, path: ''end

That will make your leads available at localhost:3000 locally, and at / on Heroku.

发布评论

评论列表(0)

  1. 暂无评论