Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Fix routing for assets #30

Open
dazza-codes opened this issue Mar 13, 2017 · 0 comments
Open

Fix routing for assets #30

dazza-codes opened this issue Mar 13, 2017 · 0 comments

Comments

@dazza-codes
Copy link
Contributor

dazza-codes commented Mar 13, 2017

The application is failing to find the CSS and JS assets in production mode.

When the app is started using a blazegraph backend in production mode, as in:

bundle install
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake db:seed
RAILS_ENV=production bundle exec rake secrets
# add that value to `config/secrets.yml`
SPARQL_URL=http://localhost:9999/blazegraph/namespace/sparqlite/sparql RAILS_ENV=production bundle exec rake assets:precompile
SPARQL_URL=http://localhost:9999/blazegraph/namespace/sparqlite/sparql RAILS_ENV=production bundle exec rails server

e.g. the log/production.log contains entries like:

I, [2017-03-13T11:18:40.502785 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/_facet_limit.html.erb (228.0ms)
I, [2017-03-13T11:18:40.502997 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/_facets.html.erb (290.2ms)
I, [2017-03-13T11:18:40.503066 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/_search_sidebar.html.erb (291.7ms)
I, [2017-03-13T11:18:40.505406 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/_home_text.html.erb (0.5ms)
I, [2017-03-13T11:18:40.505529 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/_home.html.erb (1.7ms)
I, [2017-03-13T11:18:40.507003 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/shared/_sitelinks_search_box.html.erb (0.7ms)
I, [2017-03-13T11:18:40.507197 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/index.html.erb within layouts/blacklight (298.1ms)
I, [2017-03-13T11:18:40.567493 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/blacklight/nav/_search_history.html.erb (38.7ms)
I, [2017-03-13T11:18:40.567725 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/_user_util_links.html.erb (40.3ms)
I, [2017-03-13T11:18:40.579014 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/catalog/_search_form.html.erb (10.1ms)
I, [2017-03-13T11:18:40.579164 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/shared/_header_navbar.html.erb (66.0ms)
I, [2017-03-13T11:18:40.580473 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/shared/_ajax_modal.html.erb (0.4ms)
I, [2017-03-13T11:18:40.586110 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/_flash_msg.html.erb (2.5ms)
I, [2017-03-13T11:18:40.587237 #24997]  INFO -- :   Rendered /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/blacklight-6.0.1/app/views/shared/_footer.html.erb (0.3ms)
I, [2017-03-13T11:18:40.587544 #24997]  INFO -- : Completed 200 OK in 1263ms (Views: 385.5ms | ActiveRecord: 0.0ms)
I, [2017-03-13T11:18:40.678327 #24997]  INFO -- : Started GET "/assets/application-4d08f0890cc3f9d0df3ce455ad13817fd3baf28f3ffbd564a15cdff6867c1d26.css" for ::1 at 2017-03-13 11:18:40 -0700
F, [2017-03-13T11:18:40.680321 #24997] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/assets/application-4d08f0890cc3f9d0df3ce455ad13817fd3baf28f3ffbd564a15cdff6867c1d26.css"):
  actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.5.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.5.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.5.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.5.1) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
  /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
  /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
  /users/sparql-user/.rbenv/versions/2.2.5/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant