Switch from Development to Production

81 views
Skip to first unread message

Rusty Myers

unread,
Nov 12, 2014, 3:10:25 PM11/12/14
to openconfe...@googlegroups.com
Forgive me if this is more of a Rails question and not specific to OCW, but how do I switch OCW from development to production? 

I believe there are some database transfers done when doing so, is that true?

Thanks,
Rusty

Rusty Myers

unread,
Nov 12, 2014, 3:55:50 PM11/12/14
to openconfe...@googlegroups.com
I switched to production environment using the -e production flag when starting the rails server. You can also set the ENV variable to be production.

Rusty Myers

unread,
Nov 20, 2014, 11:12:37 AM11/20/14
to openconfe...@googlegroups.com
Hello all,

I tried switching the server to production, as I posted in this thread, and now I'm not getting the CSS and javascript to apply to the site. The errors are:


I, [2014-11-20T10:57:43.477758 #37021]  INFO -- : Started GET "/" for IPADDRESS at 2014-11-20 10:57:43 -0500
I, [2014-11-20T10:57:43.479002 #37021]  INFO -- : Processing by OpenConferenceWare::ProposalsController#proposals_or_sessions as HTML
I, [2014-11-20T10:57:43.481200 #37021]  INFO -- : assigned to current event
I, [2014-11-20T10:57:43.482004 #37021]  INFO -- : Redirected to http://SITENAME/events/EVENTNAME/proposals
I, [2014-11-20T10:57:43.482211 #37021]  INFO -- : Completed 302 Found in 3ms (ActiveRecord: 0.6ms)
I, [2014-11-20T10:57:43.490661 #37021]  INFO -- : Started GET "/events/EVENTNAME/proposals" for IPADDRESS at 2014-11-20 10:57:43 -0500
I, [2014-11-20T10:57:43.491813 #37021]  INFO -- : Processing by OpenConferenceWare::ProposalsController#index as HTML
I, [2014-11-20T10:57:43.491918 #37021]  INFO -- :   Parameters: {"event_id"=>"EVENTNAME"}
I, [2014-11-20T10:57:43.496583 #37021]  INFO -- : Read fragment views/proposals_index,event_1,admin_false,accepting_true,sort_submitted_at,dir_desc/cfca502f71f2eced4f3eb12fe5add99a (0.2ms)
I, [2014-11-20T10:57:43.496762 #37021]  INFO -- :   Rendered open_conference_ware/proposals/index.html.erb within layouts/open_conference_ware/application (0.5ms)
I, [2014-11-20T10:57:43.497848 #37021]  INFO -- : Read fragment views/layout,event_track_styles,event_1/1b2cf0ef4b2c3ea1c633c947b209503f (0.1ms)
I, [2014-11-20T10:57:43.499361 #37021]  INFO -- :   Rendered layouts/open_conference_ware/_header.html.erb (1.1ms)
I, [2014-11-20T10:57:43.499959 #37021]  INFO -- : Completed 200 OK in 8ms (Views: 3.8ms | ActiveRecord: 1.0ms)
I, [2014-11-20T10:57:43.527921 #37021]  INFO -- : Started GET "/stylesheets/open_conference_ware/application.css" for IPADDRESS at 2014-11-20 10:57:43 -0500
F, [2014-11-20T10:57:43.529368 #37021] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/stylesheets/open_conference_ware/application.css"):
  actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.0.2) lib/rails/engine.rb:511:in `call'
  railties (4.0.2) lib/rails/application.rb:97:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /usr/local/rvm/rubies/ruby-1.9.3-p550/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /usr/local/rvm/rubies/ruby-1.9.3-p550/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /usr/local/rvm/rubies/ruby-1.9.3-p550/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'


I, [2014-11-20T10:57:43.532104 #37021]  INFO -- : Started GET "/javascripts/open_conference_ware/application.js" for IPADDRESS at 2014-11-20 10:57:43 -0500
F, [2014-11-20T10:57:43.533443 #37021] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/javascripts/open_conference_ware/application.js"):
  actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.0.2) lib/rails/engine.rb:511:in `call'
  railties (4.0.2) lib/rails/application.rb:97:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /usr/local/rvm/rubies/ruby-1.9.3-p550/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /usr/local/rvm/rubies/ruby-1.9.3-p550/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /usr/local/rvm/rubies/ruby-1.9.3-p550/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

I'm now starting the server with this command for testing:
rails server -p 80 -e production

How should I fix this?

Thanks, Rusty

rei...@gmail.com

unread,
Nov 20, 2014, 4:53:03 PM11/20/14
to openconfe...@googlegroups.com
By default, since your JS and CSS assets aren’t going to be changing between requests on your production server, Rails doesn’t serve assets dynamically when in the production environment. 

If you just want to test things in the production environment, you can edit config/environments/production.rb and set config.serve_static_assets and config.assets.compile to true. However, you really do not want to commit these changes, as rails asset serving is incredibly slow and you’ll have a real web server in front of the application in an actual deployment.

For more information, you might take a look at: http://guides.rubyonrails.org/asset_pipeline.html

Do you know what kind of a system you’ll be using to deploy OCW to the public?

Best,
Reid



--
You received this message because you are subscribed to the Google Groups "openconferenceware" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openconferencew...@googlegroups.com.
To post to this group, send email to openconfe...@googlegroups.com.
Visit this group at http://groups.google.com/group/openconferenceware.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages