Bryan, I've checked the routes on dev and prod, the dev version was
only different having these lines
dryml_support /dryml/:action
{:controller=>"hobo/dryml/dryml_support"}
dev_support /dev/:action
{:controller=>"hobo/dev"}
And both of them have these lines
new_status_for_user GET /users/:user_id/statuses/new(.:format)
{:controller=>"statuses", :action=>"new_for_user"}
create_status_for_user POST /users/:user_id/statuses(.:format)
{:controller=>"statuses", :action=>"create_for_user"}
statuses_for_user GET /users/:user_id/statuses(.:format)
{:controller=>"statuses", :action=>"index_for_user"}
and same for messages
new_message_for_user GET /users/:user_id/messages/new(.:format)
{:controller=>"messages", :action=>"new_for_user"}
create_message_for_user POST /users/:user_id/messages(.:format)
{:controller=>"messages", :action=>"create_for_user"}
messages_for_user GET /users/:user_id/messages(.:format)
{:controller=>"messages", :action=>"index_for_user"}
Now I've noticed something, it works for /users/1/messages, but not
for /users/1/statuses
here's the log for production
-
WHEN I RUN users/1/messages - OK!
-----------------
WHEN I RUN users/1/statuses - ERROR 404
Processing UsersController#1 (for 10.0.133.28 at 2010-02-24 10:26:14)
[GET]
Parameters: {"action"=>"1", "id"=>"statuses", "controller"=>"users"}
ActionController::UnknownAction (No action responded to 1. Actions:
access_denied, account, authenticated_user_from_cookie, authorized?,
create, create_auth_cookie, destroy, do_reset_password, do_signup,
edit, forgot_password, ht, index, login, login_from_cookie,
login_required, logout, model, new,redirect_back_or_default,
reset_password, show, signup, store_location, and update):
hobo (1.0.0) lib/hobo/controller.rb:23:in `call'
hobo (1.0.0) lib/hobo/controller.rb:23:in `included_in_class'
passenger (2.2.7) lib/phusion_passenger/rack/request_handler.rb:
95:in `process_request'
passenger (2.2.7) lib/phusion_passenger/abstract_request_handler.rb:
207:in `main_loop'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
374:in `start_request_handler'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
332:in `handle_spawn_application'
passenger (2.2.7) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
330:in `handle_spawn_application'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:163:in
`start'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
209:in `start'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:262:in
`spawn_rails_application'
passenger (2.2.7) lib/phusion_passenger/
abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:256:in
`spawn_rails_application'
passenger (2.2.7) lib/phusion_passenger/
abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.7) lib/phusion_passenger/
abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:255:in
`spawn_rails_application'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:154:in
`spawn_application'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:287:in
`handle_spawn_application'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
Rendering /home/es-server/ess/public/404.html (404 Not Found)
----------------
----------------
WHEN I RUN app/statuses - shows 2 statuses for that user 1 - OK
Processing StatusesController#index (for 10.0.133.28 at 2010-02-24
10:26:18) [GET]
Completed in 162ms (View: 151, DB: 9) | 200 OK [http://
malevich.spidernet.net/statuses]
-----------------
another question: how can i migrate all the database from dev to
production? because when i run in production, it doesn't really
migrate the data - I have to start adding all from the stratch
On Feb 23, 10:30 pm, Bryan Larsen <[email protected]> wrote:
> I suspect that your two environments aren't as identical as you think
> they are. That kind of error is easy to make, I've done it many times.
> For me, it usually involves forgetting to do a 'git add', although I've
> done it many different ways. It's frustrating when things work perfect
> on your dev box and then blow up in deployment.
>
> do
>
> RAILS_ENV=production rake routes
>
> RAILS_ENV=development rake routes
>
> have all of the expected routes, and are they the same?
>
> Bryan
>
> Edward Samokhvalov wrote:
> > I'll check tomorrow if it's above, but how come it works in
> > development and not in production?
> > maybe something was not compiled fully for production?
>
> > thx
>
> > On Feb 23, 9:12 pm, Bryan Larsen <[email protected]> wrote:
> >> This looks like the default routing that Rails puts at the bottom of
> >> config/routes.rb. It explains the failure of users/1/messages and the
> >> success of users/messages
>
> >> Is Hobo.add_routes(map) in your config/routes.rb, and is it above the
> >> rails default route? (which should probably be removed regardless).
>
> >> Bryan
>
> >> Edward Samokhvalov wrote:
> >>> Hello, everyone!
> >>> I have a routing for users/index/messages, which works fine in the
> >>> development mode on Mongrel.
> >>> I tried to migrate it to production like this:
> >>> 1) rake db:migrate RAILS_ENV=production
> >>> 2) sudo /etc/init.d/apache2 start
> >>> It starts, the application works, but when I go
> >>> tohttp://app/users/1/messages
> >>> it shows an error, and that's the production.log
> >>> Processing UsersController#1 (for 10.0.133.28 at 2010-02-23 16:12:57)
> >>> [GET]
> >>> Parameters: {"action"=>"1", "id"=>"statuses", "controller"=>"users"}
> >>> ActionController::UnknownAction (No action responded to 1. Actions:
> >>> access_denied, account, authenticated_user_from_cookie, authorized?,
> >>> create, create_auth_cookie, destroy, do_reset_password, do_signup,
> >>> edit, forgot_password, ht, index, login, login_from_cookie,
> >>> login_required, logout, model, new,redirect_back_or_default,
> >>> reset_password, show, signup, store_location, and update):
> >>> hobo (1.0.0) lib/hobo/controller.rb:23:in `call'
> >>> hobo (1.0.0) lib/hobo/controller.rb:23:in `included_in_class'
> >>> passenger (2.2.7) lib/phusion_passenger/rack/request_handler.rb:
> >>> 95:in `process_request'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_request_handler.rb:
> >>> 207:in `main_loop'
> >>> passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
> >>> 374:in `start_request_handler'
> >>> passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
> >>> 332:in `handle_spawn_application'
> >>> passenger (2.2.7) lib/phusion_passenger/utils.rb:184:in `safe_fork'
> >>> passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
> >>> 330:in `handle_spawn_application'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> >>> `__send__'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> >>> `main_loop'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
> >>> `start_synchronously'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:163:in
> >>> `start'
> >>> passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
> >>> 209:in `start'
> >>> passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:262:in
> >>> `spawn_rails_application'
> >>> passenger (2.2.7) lib/phusion_passenger/
> >>> abstract_server_collection.rb:126:in `lookup_or_add'
> >>> passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:256:in
> >>> `spawn_rails_application'
> >>> passenger (2.2.7) lib/phusion_passenger/
> >>> abstract_server_collection.rb:80:in `synchronize'
> >>> passenger (2.2.7) lib/phusion_passenger/
> >>> abstract_server_collection.rb:79:in `synchronize'
> >>> passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:255:in
> >>> `spawn_rails_application'
> >>> passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:154:in
> >>> `spawn_application'
> >>> passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:287:in
> >>> `handle_spawn_application'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> >>> `__send__'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
> >>> `main_loop'
> >>> passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
> >>> `start_synchronously'
> >>> At the same timehttp://app/statusesworks, showing all the statuses
> >>> (not for particular user).
> >>> Thx in advance.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.