I have the Rails Environment setup on my Mac.
Local: ~/GitHub/Warehouse/
Server: http://localhost:3001/
Here is my /config/routes.rb:
Warehouse::Application.routes.draw do
resources :events
resources :locations
resources :categories
resources :items
get "home/index"
root :to => "home#index"
end
I put my application on the server in a folder ~/warehouse. It has a symbolic link of ~/public_html/warehouse/ that points to ~/warehouse/public.
So my url is:
http://showtime.www77.a2hosting.com/warehouse
I get the following error:
Started GET "/warehouse" for 184.175.153.98 at Sat Nov 24 21:47:24 -0500 2012
ActionController::RoutingError (No route matches [GET] "/warehouse"):
vendor/bundle/ruby/1.8/gems/actionpack-3.2.9/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
vendor/bundle/ruby/1.8/gems/actionpack-3.2.9/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/rack/logger.rb:32:in `call_app'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/rack/logger.rb:16:in `call'
vendor/bundle/ruby/1.8/gems/activesupport-3.2.9/lib/active_support/tagged_logging.rb:22:in `tagged'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/rack/logger.rb:16:in `call'
vendor/bundle/ruby/1.8/gems/actionpack-3.2.9/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/1.8/gems/activesupport-3.2.9/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
vendor/bundle/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
vendor/bundle/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
vendor/bundle/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
vendor/bundle/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
vendor/bundle/ruby/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/engine.rb:479:in `call'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/application.rb:223:in `call'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `send'
vendor/bundle/ruby/1.8/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
passenger (3.0.15) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.15) lib/phusion_passenger/abstract_request_handler.rb:516:in `accept_and_process_next_request'
passenger (3.0.15) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.15) lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
passenger (3.0.15) lib/phusion_passenger/rack/application_spawner.rb:171:in `send'
passenger (3.0.15) lib/phusion_passenger/rack/application_spawner.rb:171:in `handle_spawn_application'
passenger (3.0.15) lib/phusion_passenger/utils.rb:470:in `safe_fork'
passenger (3.0.15) lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.15) lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
passenger (3.0.15) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rack_application'
passenger (3.0.15) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.15) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rack_application'
passenger (3.0.15) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.15) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.15) lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
passenger (3.0.15) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
passenger (3.0.15) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.15) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.15) helper-scripts/passenger-spawn-server:99
What should my routes.rb table be like?? I’m confused with this. Please let me know what I should do to make this work. Thank you in advance!
Try changing your
config.ruThis mounts your application and rack middleware to the specified path or URI and all the children paths under it, so your routes should work properly. If you have problems with your assets then, adjust
config.action_controller.asset_hostwithin your environment configuration files in config/environments.