1

I generated a proj with refinerycms. When I launch it in development mode(rails s), it works just fine.

But in production mode I'm getting "We're sorry, but something went wrong." I'm using postgresql.

This's is what I have in terminal:

=> Booting WEBrick
=> Rails 3.2.14 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-09-02 19:32:32] INFO  WEBrick 1.3.1
[2013-09-02 19:32:32] INFO  ruby 1.9.3 (2013-02-22) [x86_64-darwin12.1.0]
[2013-09-02 19:32:32] INFO  WEBrick::HTTPServer#start: pid=6216 port=3000
Started GET "/" for 127.0.0.1 at 2013-09-02 19:32:33 +0400
Processing by Refinery::PagesController#home as HTML
  Parameters: {"locale"=>:en}
Completed 500 Internal Server Error in 4ms

ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "refinery_pages" does not exist
LINE 5:              WHERE a.attrelid = '"refinery_pages"'::regclass
                                        ^
:             SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"refinery_pages"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum
):
  activerecord (3.2.14) lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in `exec'
  activerecord (3.2.14) lib/active_record/connection_adapters/postgresql_adapter.rb:1163:in `exec_no_cache'
  activerecord (3.2.14) lib/active_record/connection_adapters/postgresql_adapter.rb:660:in `block in exec_query'
  activerecord (3.2.14) lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
  activesupport (3.2.14) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activerecord (3.2.14) lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
  activerecord (3.2.14) lib/active_record/connection_adapters/postgresql_adapter.rb:659:in `exec_query'
  activerecord (3.2.14) lib/active_record/connection_adapters/postgresql_adapter.rb:1292:in `column_definitions'
  activerecord (3.2.14) lib/active_record/connection_adapters/postgresql_adapter.rb:855:in `columns'
  activerecord (3.2.14) lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
  activerecord (3.2.14) lib/active_record/model_schema.rb:229:in `yield'
  activerecord (3.2.14) lib/active_record/model_schema.rb:229:in `default'
  activerecord (3.2.14) lib/active_record/model_schema.rb:229:in `columns'
  activerecord (3.2.14) lib/active_record/model_schema.rb:238:in `columns_hash'
  activerecord (3.2.14) lib/active_record/locking/optimistic.rb:131:in `locking_enabled?'
  activerecord (3.2.14) lib/active_record/relation.rb:170:in `exec_queries'
  activerecord (3.2.14) lib/active_record/relation.rb:160:in `block in to_a'
  activerecord (3.2.14) lib/active_record/explain.rb:41:in `logging_query_plan'
  activerecord (3.2.14) lib/active_record/relation.rb:159:in `to_a'
  activerecord (3.2.14) lib/active_record/relation/finder_methods.rb:381:in `find_first'
  activerecord (3.2.14) lib/active_record/relation/finder_methods.rb:122:in `first'
  refinerycms-pages (2.1.0) app/controllers/refinery/pages_controller.rb:74:in `find_page'
  activesupport (3.2.14) lib/active_support/callbacks.rb:429:in `_run__1554083330414178461__process_action__587527534234291184__callbacks'
  activesupport (3.2.14) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.14) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.14) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.14) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.14) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.14) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.14) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.14) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.14) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.14) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.14) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.14) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.14) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.14) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.14) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.14) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.14) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.14) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.14) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.14) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.14) lib/action_dispatch/routing/route_set.rb:608:in `call'
  railties (3.2.14) lib/rails/engine.rb:484:in `call'
  railties (3.2.14) lib/rails/railtie/configurable.rb:30:in `method_missing'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.14) lib/action_dispatch/routing/route_set.rb:608:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  dragonfly (0.9.15) lib/dragonfly/cookie_monster.rb:9:in `call'
  activerecord (3.2.14) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.14) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.14) lib/active_support/callbacks.rb:405:in `_run__1159002294727357788__call__463434542207409353__callbacks'
  activesupport (3.2.14) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.14) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.14) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.14) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.14) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.14) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.14) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.14) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.14) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.14) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.14) lib/rails/engine.rb:484:in `call'
  railties (3.2.14) lib/rails/application.rb:231:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.14) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'

update(production/development modes): production mode development mode

kirqe
  • 2,431
  • 4
  • 37
  • 63

1 Answers1

2

The error is indicating that you have some tables that haven't been set up yet. Have you dumped your development database to production yet? Alternatively, you can start a fresh database install by running the following from command line on your production environment:

rake db:migrate
rake db:seed

UPDATE:

If your stylesheets or other static assets are having difficulty rendering correctly on production, you may want to set up asset precompilation:

# config/application.rb
config.assets.initialize_on_precompile = true
zeantsoi
  • 25,857
  • 7
  • 69
  • 61
  • I made a fresh db instal with these commands, but same problem – kirqe Sep 02 '13 at 16:36
  • 1
    Did you try porting your development DB to your production environment? – zeantsoi Sep 02 '13 at 16:37
  • I changed database: testrefinerycms_production to testrefinerycms_development now it works but with some problems when I go to 0.0.0.0:3000/refinery/users/register there're some losts in css. I doesn't look like in dev mode(the background is white but it supposed to be striped-green. – kirqe Sep 02 '13 at 16:44
  • 1
    Please see the update to my answer. If this helps resolve your issue, please kindly consider accepting/voting up this answer as correct. – zeantsoi Sep 02 '13 at 16:50
  • Now pages load faster but still white background instead of striped-green. I also have this [2013-09-02 21:10:04] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true – kirqe Sep 02 '13 at 17:08
  • 1
    Can you verify whether the striped-green image asset actually exists on your production environment? Can you access it at the same path that you would on your development environment? Also, as an FYI, the message regarding content-length should have any bearing on whether your application works or not – see this answer for more details: http://stackoverflow.com/a/7262974/1086529 – zeantsoi Sep 02 '13 at 19:17
  • Updated the topic. And it's more black than green. – kirqe Sep 02 '13 at 22:40
  • Have you debugged to see whether those styles are being loaded? – zeantsoi Sep 02 '13 at 22:42
  • I stopped digging into refinery cms for a while. Checked ur answer as accepted. ty – kirqe Sep 11 '13 at 21:40