ruby on rails - Vendor assets not showing in heroku staging environment -
my assets (i.e. css , js) in vendor folders not showing in heroku staging environment, however, images in app/assets/images works , works in development environment though. not want move assets in vendors folder app folder because want keep vendor templates separate.
below setup , list of things have tried:
app/assets/stylesheets/application.css.scss
*= require_tree . *= require_self *= require style.default
app/assets/stylesheets/application.js
//= require jquery //= require jquery_ujs //= require turbolinks //= require jquery-1.11.1.min //= require jquery-migrate-1.2.1.min //= require jquery-ui-1.10.3.min //= require modernizr.min //= require bootstrap.min //= require jquery.sparkline.min //= require toggles.min //= require retina.min //= require jquery.cookies //= require custom //= require dashboard //= require_tree .
config/initializers/assets.rb
rails.application.config.assets.precompile += %w( *.css *.js )
ran following command in terminal
rails_env=production rake assets:precompile rails_env=staging rake assets:precompile rake assets:precompile heroku run rake assets:precompile
results pushing heroku using "git push staging master". manifest file detected shown below.
remote: bundle complete! 35 gemfile dependencies, 85 gems installed. remote: gems in groups development , test not installed. remote: bundled gems installed ./vendor/bundle. remote: bundle completed (1.14s) remote: cleaning bundler cache. remote: detected manifest file, assuming assets compiled locally
environments/staging.rb
config.serve_static_files = true
environments/production.rb
config.serve_static_files = true
heroku config
rack_env: staging rails_env: staging
gemfile
group :production gem 'unicorn' gem 'rails_12factor' gem 'pg' gem 'heroku-deflater' end
rails version
rails 4.2.0
ruby version
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]
note: "config.assets.compile = true" works, idea precompile assets, not rely on compile
many taking effort @ work.
update
group :production :staging gem 'unicorn' gem 'rails_12factor' gem 'pg' gem 'heroku-deflater' end
adding :staging in gemfile didnt work.
config/application.rb
config.serve_static_assets = true
adding config.serve_static_assets in application.rb file didnt work..
so further ran following command in staging heroku:
rails.application.config.assets
{:_blocks=>[#<proc:0x007fbbb0bf1558@/app/vendor/bundle/ruby/2.1.0/gems/autoprefixer-rails-5.1.8/lib/autoprefixer-rails/railtie.rb:14>, #<proc:0x007fbbb39ac0d8@/app/vendor/bundle/ruby/2.1.0/gems/sass-rails-5.0.3/lib/sass/rails/railtie.rb:56>], :paths=>["/app/app/assets/images", "/app/app/assets/javascripts", "/app/app/assets/stylesheets", "/app/vendor/assets/fonts", "/app/vendor/assets/javascripts", "/app/vendor/assets/stylesheets", "/app/vendor/bundle/ruby/2.1.0/gems/bootstrap_form-2.2.0/app/assets/stylesheets", "/app/vendor/bundle/ruby/2.1.0/gems/turbolinks-2.5.3/lib/assets/javascripts", "/app/vendor/bundle/ruby/2.1.0/gems/jquery-rails-4.0.3/vendor/assets/javascripts", "/app/vendor/bundle/ruby/2.1.0/gems/coffee-rails-4.1.0/lib/assets/javascripts"], :prefix=>"/assets", :manifest=>nil, :precompile=>[#<proc:0x007fbbb1c00228@/app/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/railtie.rb:60 (lambda)>, /(?:\/|\\|\a)application\.(css|js)$/, "*.css", "*.js"], :version=>"1.0", :debug=>false, :compile=>false, :digest=>true, :js_compressor=>:uglifier, :css_compressor=>:sass}
rails.application.config.assets.precompile
[#<proc:0x007fbbb1c00228@/app/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.2.4/lib/sprockets/railtie.rb:60 (lambda)>, /(?:\/|\\|\a)application\.(css|js)$/, "*.css", "*.js"]
also ran "heroku run rails c" executed following:
irb(main):002:0> puts helper.asset_path("style.default.css") /assets/style.default-84d0516848a763e0b8b8b7005f7ae816.css
used following debugging method heroku staging:
$ heroku run bash $ ls public/assets
output below
angular.min-4d194b7f4f12ed8eafec2d7a0c835904.js angular.min-4d194b7f4f12ed8eafec2d7a0c835904.js.gz animate.delay-0faaa57b808dee7f42f39ede364a56fb.css animate.delay-0faaa57b808dee7f42f39ede364a56fb.css.gz animate.min-fa7d9f43baff3065a44d391f5fb24dec.css animate.min-fa7d9f43baff3065a44d391f5fb24dec.css.gz application-30c5d5ea113f5d302dc72bac7a453e2c.js application-30c5d5ea113f5d302dc72bac7a453e2c.js.gz application-76133410c1e24aced49dbeb2178152ad.css application-76133410c1e24aced49dbeb2178152ad.css.gz basketcats-4984b24e5c745a825577436dcb5b1f7d.jpg blogger-icon-5330825185af26ebf796626aab07992f.png bootstrap-07c26bce6cfb4d4d3e91c2a7f3316ddd.js bootstrap-07c26bce6cfb4d4d3e91c2a7f3316ddd.js.gz bootstrap-datetimepicker.min-23b3c4525c36203db02c2000791bc8ee.js bootstrap-datetimepicker.min-23b3c4525c36203db02c2000791bc8ee.js.gz bootstrap-editable-c6281cc109e5208b5848e765b4d14da8.css bootstrap-editable-c6281cc109e5208b5848e765b4d14da8.css.gz bootstrap-editable.min-86d8ede345d06aca30530a7f95bb3931.js bootstrap-editable.min-86d8ede345d06aca30530a7f95bb3931.js.gz bootstrap-f2f6511fea58665b99245ff7db3724e8.css bootstrap-f2f6511fea58665b99245ff7db3724e8.css.gz bootstrap.min-237197a13514aaac49ee55c33a5ad363.css bootstrap.min-237197a13514aaac49ee55c33a5ad363.css.gz bootstrap.min-b0cd0a0791f795c4eb27679904b83f74.js bootstrap.min-b0cd0a0791f795c4eb27679904b83f74.js.gz bootstrap-override-2285f5091ba098ac5e5b620d7db3ca55.css bootstrap-override-2285f5091ba098ac5e5b620d7db3ca55.css.gz bootstrap-override-rtl-bdad9b2be471ec2aef1e04ac90377f0f.css bootstrap-override-rtl-bdad9b2be471ec2aef1e04ac90377f0f.css.gz bootstrap-rtl.min-b644011950d9b9fa31bc53f9705e829e.css bootstrap-rtl.min-b644011950d9b9fa31bc53f9705e829e.css.gz bootstrap-timepicker.min-92be9db07f554142043df94d011f0e92.js bootstrap-timepicker.min-92be9db07f554142043df94d011f0e92.js.gz bootstrap-timepicker.min-e317eaa00793dd79a1f8ef9fc3e792a9.css bootstrap-timepicker.min-e317eaa00793dd79a1f8ef9fc3e792a9.css.gz bootstrap-wizard.min-5a2783eaf5831f429126f8396dcda73e.js bootstrap-wizard.min-5a2783eaf5831f429126f8396dcda73e.js.gz bootstrap-wysihtml5-2024d0b1f3587a8af79c9375d11cbd96.css bootstrap-wysihtml5-2024d0b1f3587a8af79c9375d11cbd96.css.gz bootstrap-wysihtml5-845f80e90c6fe0c9944d78f7853f84c4.js bootstrap-wysihtml5-845f80e90c6fe0c9944d78f7853f84c4.js.gz business cat1-010151a22ba0940c53db4db068fbbb15.jpg catjira_logo1-347a04943f1922fa83c1e04cb9aa8d74.jpg catjira_logo-8b34a4e3a18a5ce98b6caf040eec0325.png catplay-33ba713cd70738acbc11793b804789aa.jpg charts-8dcf96513924266cccab40b5c3abd928.js charts-8dcf96513924266cccab40b5c3abd928.js.gz chosen.jquery.min-20f9114437b36992aa9d5a3236f3b2ee.js chosen.jquery.min-20f9114437b36992aa9d5a3236f3b2ee.js.gz city2-51820272cfac0a176203d69b5673f92c.jpg codemirror coffee-script-01f57d14cfd792fc3e4e41634619b898.js coffee-script-01f57d14cfd792fc3e4e41634619b898.js.gz colorpicker-274db192cab38eda2fe54fbe602aee81.js colorpicker-274db192cab38eda2fe54fbe602aee81.js.gz colorpicker-e8da384e85b77e601f62ec93d6517dc3.css colorpicker-e8da384e85b77e601f62ec93d6517dc3.css.gz creatives-398bec8370d485f61d0efbff7a47960c.jpg custom-9bac754fb2b328db1aa727679a5333e0.js custom-9bac754fb2b328db1aa727679a5333e0.js.gz dashboard-387a6961818e57e508986d4fffaab4f6.js dashboard-387a6961818e57e508986d4fffaab4f6.js.gz dropzone-9e3f4db91b70bf7422487de2a3695678.css dropzone-9e3f4db91b70bf7422487de2a3695678.css.gz dropzone.min-64643fa97a6d52f7a63b1c17296ca35e.js dropzone.min-64643fa97a6d52f7a63b1c17296ca35e.js.gz errors-64e62ddc273c2f5847f30d698ca14b67.css errors-64e62ddc273c2f5847f30d698ca14b67.css.gz errors-fcec5b5a277ac7c20cc9f45a209a3bcd.js errors-fcec5b5a277ac7c20cc9f45a209a3bcd.js.gz facebook-icon-0d4efe4f92f6e68c8e0304ee83013016.png favicon-f94a92edfd00b1cc38b6658933ba54fd.ico font-awesome-7235b656c02e8e1a0af4839e29862cb0.css font-awesome-7235b656c02e8e1a0af4839e29862cb0.css.gz font-awesome.min-f44605a25d83e9849f7a91abbc1fa013.css font-awesome.min-f44605a25d83e9849f7a91abbc1fa013.css.gz font.helvetica-neue-3bee85020746eede72c4dcd3bf80bf91.css font.helvetica-neue-3bee85020746eede72c4dcd3bf80bf91.css.gz font.roboto-27de563886805db8510b1488e25a43ca.css font.roboto-27de563886805db8510b1488e25a43ca.css.gz fullcalendar-8c8f481e6c52d01d9089fb9276e301ed.css fullcalendar-8c8f481e6c52d01d9089fb9276e301ed.css.gz fullcalendar.min-e0e065736f355ad455f035972ee4f0f1.js fullcalendar.min-e0e065736f355ad455f035972ee4f0f1.js.gz gmaps-4e0a34409a72c75b23ead4560c2067ad.js gmaps-4e0a34409a72c75b23ead4560c2067ad.js.gz google_analytics-99bd28f02528c13b44624e84c5c90c83.js google_analytics-99bd28f02528c13b44624e84c5c90c83.js.gz holder-80b1ec50bf56cecf1ad3aa13205b728b.js holder-80b1ec50bf56cecf1ad3aa13205b728b.js.gz html5shiv-b943c98fa95fcffd9369e767949c2e8a.js html5shiv-b943c98fa95fcffd9369e767949c2e8a.js.gz instagram-icon-16abed513241b2885051980c313b9d47.png jquery-1.11.1.min-89fdfdd2b961da1c1dac57e8beeff312.js jquery-1.11.1.min-89fdfdd2b961da1c1dac57e8beeff312.js.gz jquery2-f6430688c576903899df06242228577b.js jquery2-f6430688c576903899df06242228577b.js.gz jquery2.min-081439c47c59b5a03e286d1fbbd00553.js jquery2.min-081439c47c59b5a03e286d1fbbd00553.js.gz jquery-87424c3c19e96d4fb033c10ebe21ec40.js jquery-87424c3c19e96d4fb033c10ebe21ec40.js.gz jquery.autogrow-textarea-1db755051eeda2b4be077aba1883904c.js jquery.autogrow-textarea-1db755051eeda2b4be077aba1883904c.js.gz jquery.cookies-238dfd7d92c77c8d827e6e7df271e41d.js jquery.cookies-238dfd7d92c77c8d827e6e7df271e41d.js.gz jquery.datatables-2b6b927f456a60d7541726d69bd85eca.css jquery.datatables-2b6b927f456a60d7541726d69bd85eca.css.gz jquery.datatables.min-1f0cd1992a3aece4031123fd7fa1cb47.js jquery.datatables.min-1f0cd1992a3aece4031123fd7fa1cb47.js.gz jquery.gritter-d330d1b29b5213c7b69a1f4f1830419d.css jquery.gritter-d330d1b29b5213c7b69a1f4f1830419d.css.gz jquery.gritter.min-89110826c434b3cf1d6f58c5e7ddcb26.js jquery.gritter.min-89110826c434b3cf1d6f58c5e7ddcb26.js.gz jquery-jvectormap-1.2.2-b627cb9f9622cd8b2f0694578f32ea50.css jquery-jvectormap-1.2.2-b627cb9f9622cd8b2f0694578f32ea50.css.gz jquery-jvectormap-1.2.2.min-dd65e7b55b1b9df68da7896b0a1c77e1.js jquery-jvectormap-1.2.2.min-dd65e7b55b1b9df68da7896b0a1c77e1.js.gz jquery-jvectormap-us-aea-en-2118d2319e11000b32c7942e7d4b1b3e.js jquery-jvectormap-us-aea-en-2118d2319e11000b32c7942e7d4b1b3e.js.gz jquery-jvectormap-world-mill-en-7520a1f25b1fefbd129b81520fa33fc4.js jquery-jvectormap-world-mill-en-7520a1f25b1fefbd129b81520fa33fc4.js.gz jquery.maskedinput.min-f586a7257f244041eab790c5d211f37b.js jquery.maskedinput.min-f586a7257f244041eab790c5d211f37b.js.gz jquery-migrate-1.2.1.min-16a67272140ccc9c6aa87df04c15c468.js jquery-migrate-1.2.1.min-16a67272140ccc9c6aa87df04c15c468.js.gz jquery.min-eb8e576f52996bce7c557babc6e8a79e.js jquery.min-eb8e576f52996bce7c557babc6e8a79e.js.gz jquery.mousewheel-a78b3418946de2bdd2899b0fd7d8e009.js jquery.mousewheel-a78b3418946de2bdd2899b0fd7d8e009.js.gz jquery.prettyphoto-f78f329a32e47bf51932d09c30564afa.js jquery.prettyphoto-f78f329a32e47bf51932d09c30564afa.js.gz jquery.sparkline.min-639608ad39e4b3f2136934fed4dba81b.js jquery.sparkline.min-639608ad39e4b3f2136934fed4dba81b.js.gz jquery.tagsinput-da8da10523fb6f8ff3faf6903beb93e4.css jquery.tagsinput-da8da10523fb6f8ff3faf6903beb93e4.css.gz jquery.tagsinput.min-4d118b62ab063be6a215b5b26880c4fa.js jquery.tagsinput.min-4d118b62ab063be6a215b5b26880c4fa.js.gz jquery-ui-1.10.3-eeb57f0a91c90ebccc313b755d972670.css jquery-ui-1.10.3-eeb57f0a91c90ebccc313b755d972670.css.gz jquery-ui-1.10.3.min-8ff0c79f1466addcf6bf4aaf666799c8.js jquery-ui-1.10.3.min-8ff0c79f1466addcf6bf4aaf666799c8.js.gz jquery.ui.touch-punch.min-0062e10ac0b77dac44049f0b244a1343.js jquery.ui.touch-punch.min-0062e10ac0b77dac44049f0b244a1343.js.gz jquery_ujs-e27bd20a10d28155845a22d71ef94f2f.js jquery_ujs-e27bd20a10d28155845a22d71ef94f2f.js.gz jquery.validate.min-cc10e387641dc3a427c0b2a1d6a5cc08.js jquery.validate.min-cc10e387641dc3a427c0b2a1d6a5cc08.js.gz lato-9eab93d341daca0b64eb83e500c36c7d.css lato-9eab93d341daca0b64eb83e500c36c7d.css.gz lookupkitten1-inverted-468ad96030a9c7c555a9e598eec25705.jpg manifest-75f18e2d98f206cfb74b04585af62025.json masonry.pkgd.min-39a9db9644583f39a4afc5245d1a7b48.js masonry.pkgd.min-39a9db9644583f39a4afc5245d1a7b48.js.gz modernizr.min-e85e2cf3694aba170e11bb364d4f38c8.js modernizr.min-e85e2cf3694aba170e11bb364d4f38c8.js.gz moment-1e5ae5b0dd501d933da017e415e6658d.js moment-1e5ae5b0dd501d933da017e415e6658d.js.gz morris-b2de433af8eec1719536e9b00c3d78cd.css morris-b2de433af8eec1719536e9b00c3d78cd.css.gz morris.min-544a2438115ee60523b71a1a99f94e34.js morris.min-544a2438115ee60523b71a1a99f94e34.js.gz pinterest-icon-0738f59cb68a09fbe0387c25b94cfe91.png prettyphoto-b0211d39e61dd455b051e9df2100c166.css prettyphoto-b0211d39e61dd455b051e9df2100c166.css.gz publishing2-88893fd664cca1fb36e83ef0b1f05707.jpg rails_bootstrap_forms-85a44da0cf14906976bde10ea0a42bbc.css rails_bootstrap_forms-85a44da0cf14906976bde10ea0a42bbc.css.gz raphael-2.1.0.min-7f08beb5a8d60af0dff9d34187bae9a9.js raphael-2.1.0.min-7f08beb5a8d60af0dff9d34187bae9a9.js.gz respond.min-943d23379ec213cd5fac370c1407a384.js respond.min-943d23379ec213cd5fac370c1407a384.js.gz retina.min-0a2f559b265ead424c27ab96d85d0b27.js retina.min-0a2f559b265ead424c27ab96d85d0b27.js.gz roboto roboto-c2c7202e06866f7695a402846d6fc487.css roboto-c2c7202e06866f7695a402846d6fc487.css.gz select2-b4679ffd84b4af1e00b5e2f63c909de1.css select2-b4679ffd84b4af1e00b5e2f63c909de1.css.gz select2.min-dc009a4312724dfd32e04dc84c7cc822.js select2.min-dc009a4312724dfd32e04dc84c7cc822.js.gz style.bluenav-eef27f15d23db5d20d1fa45aacfb6c4a.css style.bluenav-eef27f15d23db5d20d1fa45aacfb6c4a.css.gz style.darkknight-41adb57795102ac40409822f26a389a8.css style.darkknight-41adb57795102ac40409822f26a389a8.css.gz style.default-84d0516848a763e0b8b8b7005f7ae816.css style.default-84d0516848a763e0b8b8b7005f7ae816.css.gz style.default-rtl-fe345a8404e132c62dba693b02debd84.css style.default-rtl-fe345a8404e132c62dba693b02debd84.css.gz style.dodgerblue-c3b44311e0db6c2ab5ea0c6bebd550da.css style.dodgerblue-c3b44311e0db6c2ab5ea0c6bebd550da.css.gz style.greyjoy-25f81d84ba89347d264f4aa2b84dbdbd.css style.greyjoy-25f81d84ba89347d264f4aa2b84dbdbd.css.gz style.inverse-ec1a47cdc185e55472a8115af3d99a8d.css style.inverse-ec1a47cdc185e55472a8115af3d99a8d.css.gz style.katniss-ccdda17b7614d5093fcf61465ae8aa9d.css style.katniss-ccdda17b7614d5093fcf61465ae8aa9d.css.gz toggles-428ccce58542ffa3ba9c1d3cfe253d36.css toggles-428ccce58542ffa3ba9c1d3cfe253d36.css.gz toggles.min-fea21bf806ff8388d5a8ad6ecd67fb47.js toggles.min-fea21bf806ff8388d5a8ad6ecd67fb47.js.gz tumblr-icon-6c8ddc711d5f3f9dc2e163268fc282c4.png turbolinks-f87b3583ca50adb0488b031297f5580d.js turbolinks-f87b3583ca50adb0488b031297f5580d.js.gz twitter-icon-e96caf41d7a48f88f48a2e25e74e07d8.png visitors-f2c7b5fd67318e31b093b301ddb1b606.js visitors-f2c7b5fd67318e31b093b301ddb1b606.js.gz weather-icons.min-463072e65eba39f9c8908b334705937e.css weather-icons.min-463072e65eba39f9c8908b334705937e.css.gz wordpress-icon-707488a657e1f5e8c018b0b2335d37ca.png wysihtml5-0.3.0.min-d70870a054c85cf85d1d8ec0adc94935.js wysihtml5-0.3.0.min-d70870a054c85cf85d1d8ec0adc94935.js.gz wysiwyg-color-db6d982825da1878a5b105a812ba227e.css wysiwyg-color-db6d982825da1878a5b105a812ba227e.css.gz youtube-icon-e0a4bd918821ef87fc2f9410c9d1054a.png
i not sure if saw this page, had similar issue , helped me out.
i check make sure have config.serve_static_assets = true
in config/application.rb
if skip down the debugging section
Comments
Post a Comment