3
votes

I deployed successfully, but after I did. I could not access the configuration sections of "states" and "users". I'm not sure where I should start to solve these issues.

I'm using Spree 1.2, Ruby 1.9.3, Rails 3.2.8 on my local machine. It works just fine. I am using the spree deployment process that worked successfully.

Any pointers on where I should start?

Error I get: "We're sorry, but something went wrong." Is there a way to enable more meaningful errors on the production server?

EDIT

Error:

Processing by Spree::Admin::StatesController#index as HTML
Parameters: {"country_id"=>"214"} Completed 500 Internal Server Error in 16ms

NoMethodError (undefined method states' for nil:NilClass):
spree_core (1.2.0) app/controllers/spree/admin/resource_controller.rb:172:in
collection' spree_core (1.2.0) app/controllers/spree/admin/states_controller.rb:21:in collection'
spree_core (1.2.0) app/controllers/spree/admin/resource_controller.rb:129:in
load_resource' activesupport (3.2.8) lib/active_support/callbacks.rb:473:in _run__4032520494098752802__process_action__736043668495006995__callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:385:in _run_process_action_callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (3.2.8) lib/abstract_controller/callbacks.rb:17:in process_action'
actionpack (3.2.8) lib/action_controller/metal/rescue.rb:29:in
process_action' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:30:in block in process_action' activesupport (3.2.8) lib/active_support/notifications.rb:123:inblock in instrument'
activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:in instrument'
activesupport (3.2.8) lib/active_support/notifications.rb:123:in
instrument' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:29:in process_action' actionpack (3.2.8) lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' activerecord (3.2.8) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (3.2.8) lib/abstract_controller/base.rb:121:inprocess' actionpack (3.2.8) lib/abstract_controller/rendering.rb:45:in process' actionpack (3.2.8) lib/action_controller/metal.rb:203:indispatch' actionpack (3.2.8) lib/action_controller/metal/rack_delegation.rb:14:in dispatch' actionpack (3.2.8) lib/action_controller/metal.rb:246:in block in action' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in call' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:indispatch'
actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:36:in call' journey (1.0.4) lib/journey/router.rb:68:inblock in call'
journey (1.0.4) lib/journey/router.rb:56:in each' journey (1.0.4) lib/journey/router.rb:56:incall' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:in call' spree_core (1.2.0) lib/spree/core/middleware/redirect_legacy_product_url.rb:13:in call' spree_core (1.2.0) lib/spree/core/middleware/seo_assist.rb:27:in call' railties (3.2.8) lib/rails/engine.rb:479:incall' railties (3.2.8) lib/rails/railtie/configurable.rb:30:in method_missing' journey (1.0.4) lib/journey/router.rb:68:inblock in call' journey (1.0.4) lib/journey/router.rb:56:in each' journey (1.0.4) lib/journey/router.rb:56:incall' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:in call' warden (1.1.1) lib/warden/manager.rb:35:inblock in call' warden (1.1.1) lib/warden/manager.rb:34:in catch' warden (1.1.1) lib/warden/manager.rb:34:incall' actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.1) lib/rack/etag.rb:23:incall' rack (1.4.1) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:incall' actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:in call'
actionpack (3.2.8) lib/action_dispatch/middleware/flash.rb:242:in
call' rack (1.4.1) lib/rack/session/abstract/id.rb:205:in context' rack (1.4.1) lib/rack/session/abstract/id.rb:200:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/cookies.rb:339:in call' activerecord (3.2.8) lib/active_record/query_cache.rb:64:in call' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in call' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in _run__4438386178050912955__call__4341646712790791334__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in
__run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:385:in _run_call_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in
run_callbacks' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:incall'
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in
call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall' rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.1) lib/rack/lock.rb:15:in call' rack-cache (1.2) lib/rack/cache/context.rb:136:inforward' rack-cache (1.2) lib/rack/cache/context.rb:245:in fetch' rack-cache (1.2) lib/rack/cache/context.rb:185:inlookup' rack-cache (1.2) lib/rack/cache/context.rb:66:in call!' rack-cache (1.2) lib/rack/cache/context.rb:51:incall' railties (3.2.8) lib/rails/engine.rb:479:in call' railties (3.2.8) lib/rails/application.rb:223:incall' railties (3.2.8) lib/rails/railtie/configurable.rb:30:in method_missing' unicorn (4.3.1) lib/unicorn/http_server.rb:531:inprocess_client' unicorn (4.3.1) lib/unicorn/http_server.rb:606:in worker_loop' unicorn (4.3.1) lib/unicorn/http_server.rb:487:inspawn_missing_workers'
unicorn (4.3.1) lib/unicorn/http_server.rb:137:in start' unicorn (4.3.1) bin/unicorn_rails:209:in'
/data/spree/shared/bundle/ruby/1.9.1/bin/unicorn_rails:23:in load'
/data/spree/shared/bundle/ruby/1.9.1/bin/unicorn_rails:23:in
'

2
Shell into the server and check the production log (log/production.log). Post here any error you don't understand.Robert Rouse
where would I begin to look on the spree production server? I'm not used to ubuntuxivo
It would be wherever you deployed Spree.Robert Rouse
I used the deployment by Spree.xivo
That's not what I said. I said wherever you deployed spree. Whatever directory on your server that you deployed it.Robert Rouse

2 Answers

1
votes

Have you seed the database? Run rake db:seed

Seems like you have no states/countries in your database when expected to.

0
votes

Is your Gemfile.lock under version control? You may be experiencing differences between your development and production environments if bundler is not running off the same Gemfile.lock you're using on your machine.

Barring a problem with that, I'd try running in production mode on your development box to see if the problem comes up. My most frustrating problems to track down have been where production has a problem that doesn't come up when the same code is being run in development. If you can isolate it to a difference in environment, you can debug better. Try bundle exec rails s -e production. If there is a problem, you can install the ruby debugger and force it to break in the problem code. You can also edit config/environments/production.rb to more closely match development.rb, so you can edit code without restarting the server, turn off class caching, etc.

I also had an issue at one point with the states code causing me a 406 Not Acceptable because the request was mistakenly asking for HTML while the states controller only responds with javascript. The solution was to find the offending link in the source and force it to ask for js. You can see it here. You're issue has some of the same hallmarks, but not all of them, so that's a shot in the dark. Good luck.