ruby on rails - Heroku not serving files from assets -
i'm trying out heroku host our current rails 4.0.0 project. although seems regular issue heroku users, none of solutions have found have made difference me.
the server not serving of our images, css, or js our assets.
i've tried adding gems:
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout' gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets' gem 'rails_12factor'
and setting config options in production.rb
to:
config.action_dispatch.x_sendfile_header = "x-accel-redirect" config.serve_static_assets = true config.assets.initialize_on_precompile = false
in various combinations server still not load of assets.
to clear, , in case i've missed simple, i'm making these changes, committing code github, executing git push staging master
. development machine windows 8 machine.
edit here output executing git push staging master
:
counting objects: 11, done. delta compression using 8 threads. compressing objects: 100% (6/6), done. writing objects: 100% (6/6), 569 bytes, done. total 6 (delta 4), reused 0 (delta 0) -----> ruby/rails app detected -----> using ruby version: ruby-2.0.0 -----> installing dependencies using bundler version 1.3.2 running: bundle install --without development:test --path vendor/bundle - -binstubs vendor/bundle/bin updating git://github.com/milgner/compass-rails.git fetching gem metadata https://rubygems.org/.......... fetching gem metadata https://rubygems.org/.. resolving dependencies... using rake (10.1.0) using i18n (0.6.4) using minitest (4.7.5) using multi_json (1.7.7) using atomic (1.1.10) using thread_safe (0.1.0) using tzinfo (0.3.37) using activesupport (4.0.0) using builder (3.1.4) using erubis (2.7.0) using rack (1.5.2) using rack-test (0.6.2) using actionpack (4.0.0) using mime-types (1.23) using polyglot (0.3.3) using treetop (1.4.14) using mail (2.5.4) using actionmailer (4.0.0) using activemodel (4.0.0) using activerecord-deprecated_finders (1.0.3) using arel (4.0.0) using activerecord (4.0.0) using bundler (1.3.2) using chunky_png (1.2.8) using coffee-script-source (1.6.3) using execjs (1.4.0) using coffee-script (2.2.0) using thor (0.18.1) using railties (4.0.0) using coffee-rails (4.0.0) using fssm (0.2.10) using sass (3.2.9) using compass (0.12.2) using compass-rails (1.0.3) git://github.com/milgner/compass-rails.g (at 1749c06) using hike (1.2.3) using jbuilder (1.4.2) using jquery-rails (3.0.4) using json (1.8.0) using modernizr-rails (2.6.2.3) using pg (0.15.1) using tilt (1.4.1) using sprockets (2.10.0) using sprockets-rails (2.0.0) using rails (4.0.0) using rails_serve_static_assets (0.0.1) using rails_stdout_logging (0.0.1) using rails_12factor (0.0.2) using rdoc (3.12.2) using sass-rails (4.0.0) using sdoc (0.3.20) using turbolinks (1.3.0) using uglifier (2.1.2) using zurb-foundation (4.0.9) bundle complete! installed ./vendor/bundle cleaning bundler cache. removing rails_log_stdout (01b5bcc572e3) removing rails3_serve_static_assets (84910ceb4ca2) -----> writing config/database.yml read database_url -----> preparing app rails asset pipeline running: rake assets:precompile asset precompilation completed (13.42s) cleaning assets -----> warnings: removing `gemfile.lock` because generated on windows. bundler full resolve native gems handled properly. may result in unexpected gem versions being used in app. -----> discovering process types procfile declares types -> (none) default types ruby/rails -> console, rake, web, worker -----> compiled slug size: 37.0mb -----> launching... done, v16 http://myproject.herokuapp.com deployed heroku git@heroku.com:myproject.git 82f4d58..e930ff1 master -> master
in production config file, have tried setting:
config.assets.compile = true config.assets.digest = true
the config.assets.initialize_on_precompile
line has been removed , not needed in rails 4.
also, rails_12factor gem set include 2 other gems need heroku, don't have include them in gemfile. can more info on github page.
for whatever reason, though, had make sure use rails image_tag images display in production. not sure if doing that, made big difference on app.
hope helps!
Comments
Post a Comment