2

I've ran

rake assets:precompile
RAILS_ENV=production rake assets:precompile
git add -A
git commit -m "message"
git push heroku master

This is the live site - http://www.collegeinsideview.com/.

It seems that none of the assets are available. I can't figure out why.

  • Both of the precompile commands seem to have worked.
  • In development, my public/assets/ folder is filled with the assets (with the fingerprints at the end; ex. adelphi_social_atmosphere_7-c13258f14849b2f66e162688b9c9228f.png).
  • There weren't any errors with pushing to heroku.

production.rb

Collegeanswers::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # Add the fonts path
  config.assets.paths << Rails.root.join('app', 'assets', 'fonts')

  # Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = true

  config.assets.js_compressor  = :uglifier
  config.assets.css_compressor = :sass

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

  # Generate digests for assets URLs
  config.assets.digest = true

  # Defaults to nil and saved in location specified by config.assets.prefix
  # config.assets.manifest = YOUR_PATH

  # Specifies the header that your server uses for sending files
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # See everything in the log (default is :info)
  # config.log_level = :debug

  # Prepend all log lines with the following tags
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

  # Use a different cache store in production
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server
  # config.action_controller.asset_host = "http://assets.example.com"

   # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
  config.assets.precompile += %w( about_college.css college_pages.css colleges.css essay_list.css 
  essays.css home.css layout.css static_pages.css tldr.css college_pages.js essays.js home.js static_pages.js favicon.ico .svg .eot .woff .ttf)

  # Disable delivery errors, bad email addresses will be ignored
  # config.action_mailer.raise_delivery_errors = false

  # Enable threaded mode
  # config.threadsafe!

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found)
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners
  config.active_support.deprecation = :notify

  # config.action_controller.asset_host = "https://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"

  config.eager_load = true
end

home.html

<% content_for(:title, 'College Inside View') %>

<div id="home_css">
    <!--<%= link_to "Get Paid to Answer Questions", "/the-deal", id: "the_deal", class: "btn btn-link" %>-->
    <h1 id="heading">In-Depth Reviews of Colleges</h1>
    <div class="tabbable">
        <div class="tab-content">
            <div class="tab-pane fade active in" id="columbia">
                <div class="left_pane">
                    <%= image_tag "columbia1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "columbia2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "columbia3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Columbia &bull; &bull;".html_safe, "/columbia/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>How does the workload impact your social life?</strong></p>
                    <%= image_tag "columbia_social_atmosphere_7.png", class: 'answers' %>
                    <%= link_to '--read more--', '/columbia/social-life/social-atmosphere/7', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="princeton">
                <div class="left_pane">
                    <%= image_tag "princeton1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "princeton2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "princeton3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Princeton &bull; &bull;".html_safe, "/princeton/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>How would you make your classes better?</strong></p>
                    <%= image_tag "princeton_classes_6.png", class: 'answers' %>
                    <%= link_to '--read more--', '/princeton/academics/classes/6', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="brown">
                <div class="left_pane">
                    <%= image_tag "brown1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "brown2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "brown3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Brown &bull; &bull;".html_safe, "/brown/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Are people intellectual? Do they have thoughtful conversations with each other?</strong></p>
                    <%= image_tag "brown_social_atmosphere_5.png", class: 'answers' %>
                    <%= link_to '--read more--', '/brown/social-life/social-atmosphere/5', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="penn">
                <div class="left_pane"> 
                    <%= image_tag "university-of-pennsylvania1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "university-of-pennsylvania2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "university-of-pennsylvania3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Penn &bull; &bull;".html_safe, "/university-of-pennsylvania/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Are your classes too hard, or too easy? Why?</strong></p>
                    <%= image_tag "penn_dificulty_4.png", class: 'answers' %>
                    <%= link_to '--read more--', '/university-of-pennsylvania/academics/difficulty/4', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="yale">
                <div class="left_pane"> 
                    <%= image_tag "yale1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "yale2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "yale3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Yale &bull; &bull;".html_safe, "/yale/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Is it easy to make friends? How did you make friends?</strong></p>
                    <%= image_tag "yale_social_atmosphere_1.png", class: 'answers' %>
                    <%= link_to '--read more--', '/yale/social-life/social-atmosphere/1', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="cornell">
                <div class="left_pane"> 
                    <%= image_tag "cornell1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "cornell2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "cornell3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Cornell &bull; &bull;".html_safe, "/cornell/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Mary Donlon Hall</strong></p>
                    <%= image_tag "cornell_housing_mary_donlon_hall.png", class: 'answers' %>
                    <%= link_to '--read more--', '/cornell/living-environment/housing/mary-donlon-hall', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="harvard">
                <div class="left_pane"> 
                    <%= image_tag "harvard1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "harvard2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "harvard3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Harvard &bull; &bull;".html_safe, "/harvard/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Are there comfortable places to study?</strong></p>
                    <%= image_tag "harvard_campus_2.png", class: 'answers' %>
                    <%= link_to '--read more--', '/harvard/academics/classes/5', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="dartmouth">
                <div class="left_pane"> 
                    <%= image_tag "dartmouth1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "dartmouth2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "dartmouth3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Dartmouth &bull; &bull;".html_safe, "/dartmouth/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Do professors make things easy to understand?</strong></p>
                    <%= image_tag "dartmouth_professors_1.png", class: 'answers' %>
                    <%= link_to '--read more--', '/dartmouth/academics/professors/1', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="pitt">
                <div class="left_pane"> 
                    <%= image_tag "university-of-pittsburgh1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "university-of-pittsburgh2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "university-of-pittsburgh3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Pitt &bull; &bull;".html_safe, "/university-of-pittsburgh/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Neuroscience: What are people in the major like? How would you stereotype them?</strong></p>
                    <%= image_tag "pitt_neuroscience_8.png", class: 'answers' %>
                    <%= link_to '--read more--', '/university-of-pittsburgh/academics/majors/neuroscience/8', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="wisconsin">
                <div class="left_pane"> 
                    <%= image_tag "university-of-wisconsin1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "university-of-wisconsin2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "university-of-wisconsin3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Wisconsin &bull; &bull;".html_safe, "/university-of-wisconsin/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>How much will not partying limit your social life?</strong></p>
                    <%= image_tag "wisconsin_parties_3.png", class: 'answers' %>
                    <%= link_to '--read more--', '/university-of-wisconsin/social-life/parties/3', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="colgate">
                <div class="left_pane"> 
                    <%= image_tag "colgate1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "colgate2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "colgate3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Colgate &bull; &bull;".html_safe, "/colgate/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>Who wouldn't fit in?</strong></p>
                    <%= image_tag "colgate_social_atmosphere_2.png", class: 'answers' %>
                    <%= link_to '--read more--', '/colgate/social-life/social-atmosphere/2', class: 'read_more' %>
                </div>
            </div>
            <div class="tab-pane fade" id="adelphi">
                <div class="left_pane"> 
                    <%= image_tag "adelphi-university1.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "adelphi-university2.jpg", size: "297x187", class: 'picture' %>
                    <%= image_tag "adelphi-university3.jpg", size: "297x187", class: 'picture' %>
                    <%= link_to "&bull; &bull; Read more about Adelphi &bull; &bull;".html_safe, "/adelphi-university/academics/professors/1", class: 'school_link' %>
                </div>
                <div class="right">
                    <p class="question" class="well"><strong>How's the on-campus food (taste, price, health, convenience, hours, variety...)?</strong></p>
                    <%= image_tag "adelphi_food_1.png", class: 'answers' %>
                    <%= link_to '--read more--', '/adelphi-university/living-environment/food/1', class: 'read_more' %>
                </div>
            </div>
        </div>
        <ul id="left" class="nav nav-pills nav-stacked">
            <li id="columbia" class="active"><a href="#columbia">Columbia</a></li>
            <li id="princeton"><a href="#princeton">Princeton</a></li>
            <li id="brown"><a href="#brown">Brown</a></li>
            <li id="penn"><a href="#penn">Penn</a></li>

            <li id="yale"><a href="#yale">Yale</a></li>
            <li id="cornell"><a href="#cornell">Cornell</a></li>
            <li id="harvard"><a href="#harvard">Harvard</a></li>
            <li id="dartmouth"><a href="#dartmouth">Dartmouth</a></li>

            <li id="pitt"><a href="#pitt">Pitt</a></li>
            <li id="wisconsin"><a href="#wisconsin">Wisconsin</a></li>
            <li id="colgate"><a href="#colgate">Colgate</a></li>
            <li id="adelphi"><a href="#adelphi">Adelphi</a></li>
        </ul>
    </div>

    <div id="notify">
        <p>Right now I only have reviews for those 12 schools. Enter your email below to be notified when there's more!</p>
        <span id="notify_span">
            <%= simple_form_for :subscribe, url: 'subscribe' do |f| %>
                <%= f.input :email, placeholder: 'user@domain.com', label: false, required: true %> <br/>
                <%= f.button :submit, "1-Click Sign Up", class: "btn btn-primary", data: { :disable_with => "Submitting..." } %>
            <% end %>
        </span>     
    </div>

    <ul id="bottom_links">
        <li><%= link_to "I Graduated High School. Now What?", "/i-graduated-high-school-now-what" %></li>
        <li><%= link_to "How to Choose a College", "/how-to-choose-a-college" %></li>
        <li><%= link_to "How College Inside View Got Started", "https://medium.com/what-i-learned-building/322e8668ed6f" %></li>
    </ul>

    <!--<section id="section1">
        <h1 id="main_head">Answers to the questions<br />
        that go unasked.<br /><br />
        <em>Finally!</em></h1>
        <section id="example_questions">
            <ul>
                <li><span class="label label-info">Academics</span> What are the people in the economics major like? How would you stereotype them?</li>
                <li><span class="label label-info">Academics</span> Would you go to class if you didn't have to?</li>
                <li><span class="label label-info">Living Environment</span> Where can you go to get groceries?</li>
                <li><span class="label label-info">Living Environment</span> What is Panther Hall like (social, comfortable, location...)?</li>
                <li><span class="label label-info">Social Life</span> Are people intellectual? Do they have thoughtful conversations with each other?</li>
                <li><span class="label label-info">Social Life</span> Are there any good school sponsored events, or do they all suck?</li>
                <li><span class="label label-info">Social Life</span> How much will not partying limit your social life?</li>
                <li><span class="label label-info">About College</span> Who are the people involved in teaching a class? What is a TA? UTA? What background/training/qualifications do they have?</li>
                <li><span class="label label-info">About College</span> How does social life change as you become an upperclassman?</li>
            </ul>
        </section>
    </section>
    <section id="section2" class="bottom_sections">
        <br /><br /><br /><br />
        <ul>
            <li>The best way to choose a college is to read student reviews. <%= image_tag "reviews.jpg", size: "200x200", id: 'reviews' %></li>
            <hr />
            <li>But student reviews are only as good as the questions that they ask. <%= image_tag "question_mark.jpg", size: "200x200", id: 'question_mark' %></li>
            <hr />
            <li>Right now, student reviews only ask <%= link_to "a small fraction", "https://www.dropbox.com/s/p75pspbd5suzz19/Questions%20Comparison%20pdf.pdf" %> of the questions that you want answered. <br /><%= image_tag "partial_chart.jpg", size: "200x200", id: 'partial_chart' %></li>
            <hr />
            <li>College Inside View asks them all. <%= image_tag "full_chart.jpg", size: "200x200", id:'full_chart' %></li>
            <hr />
            <li class="wide">
                Right now I'm doing a pilot program at the Ivies, and have over 4,000 answers for them so far. Previously I did a pilot program at <%= link_to "Pitt", "/university-of-pittsburgh/academics/professors/1" %>, <%= link_to "Wisconsin", "/university-of-wisconsin/academics/professors/1" %>, <%= link_to "Colgate", "/colgate/academics/professors/1" %> and <%= link_to "Adelphi", "/adelphi-university/academics/professors/1" %>. If you'd like to be notified when more schools get reviews, enter your email below:
                <span id="notify">
                    <%= simple_form_for :subscribe, url: 'subscribe' do |f| %>
                        <%= f.input :email, label: false, required: true %> <br/>
                        <%= f.button :submit, "Notify me", class: "btn btn-primary", data: { :disable_with => "Submitting..." } %>
                    <% end %>
                </span> 
            </li>
            <hr />
            <li class="wide">
                <small><em>*Also, if you like what I'm doing and know someone in college, please ask them to answer some questions about their school on this site!*</em></small>
                <p id="sample_post">Sample post: "College reviews are too broad. Please help answer some more specific questions about your school!"</p>
                <p><%= social_share_button_tag('College reviews are too broad. Please help answer some more specific questions about your school!') %></p>
            </li>
        </ul>
    </section>
    <section id="section3" class="bottom_sections">
        <h1>Where to start</h1>
        <ul>
            <li>Check out some of the articles in the <%= link_to "Advice Section", "/advice" %>. I'd start with this sequence:
              <ul>
                <li><%= link_to "I Graduated High School, Now What?", "/i-graduated-high-school-now-what" %></li>
                <li><%= link_to "The Process of Exploring Your Interests", "/the-process-of-exploring-your-interests" %></li>
                <li><%= link_to "How to Choose a College", "/how-to-choose-a-college" %></li>
              </ul>
            </li>
            <li>If you're unclear as to what college is like, check out the <%= link_to "About College", "/about-college/college-life/1" %> section.</li>
            <li>If you're ready to look for a school, start off by narrowing it down with the <%= link_to "Advanced Search", tools_advanced_search_url %> and <%= link_to "College Comparison", tools_comparison_url %> tools. Then <%= link_to "read about", "/colleges" %> the schools that you're interested in.</li>
            <li>If you have any questions about anything whatsoever, please <%= mail_to "azerner3@gmail.com", "shoot me an email" %>. I want to help. I just graduated Pitt as a neuroscience major, and can help you with anything from high school troubles, to the choosing a school, to succeeding in college.</li>
        </ul>
    </section>
    <section id="section4" class="bottom_sections">
        <h1>More information</h1>
        <ul>
            <li>See <%= link_to "my pitch", "/pitch" %> for an explanation of what makes College Inside View great.</li>
            <li>See also <%= link_to "how College Inside View got started", "https://medium.com/what-i-learned-building/322e8668ed6f" %>.</li>
            <li>Angel List <%= link_to "profile", "https://angel.co/college-inside-view" %></li>
            <li>Stuff I've <%= link_to "wrote", "https://medium.com/@adamzerner/latest" %>.</li>
        </ul>
    </section> -->
</div>

Gemfile

source 'https://rubygems.org'

ruby '2.0.0'
gem 'rails', '~>4.0.0'
gem 'bootstrap-sass', '2.3.2.0'
gem "actionmailer", "~> 4.0.3" #
gem "jquery-tablesorter", "~> 1.5.0"
gem 'jquery-rails'
gem 'meta-tags', :require => 'meta_tags'
gem "simple_form", "~> 3.0.1"
gem 'rails4_upgrade'
gem 'sass-rails', '~>4.0.0'
gem 'coffee-rails', '~>4.0.0'
gem 'uglifier', '>=1.3.0'
# gem 'asset_sync'
gem 'gibbon', '~> 1.1.2'
gem 'activerecord-tableless'
gem 'social-share-button'

# Rails 4 gems
gem 'actionpack-action_caching', '~>1.0.0'
gem 'actionpack-page_caching', '~>1.0.0'
gem 'actionpack-xml_parser', '~>1.0.0'
gem 'actionview-encoded_mail_to', '~>1.0.4'
gem "activerecord-session_store", "~> 0.1.0"
gem "activeresource", "~> 4.0.0" #
gem "actionpack", "~> 4.0.3" #
gem 'protected_attributes' #
gem "activemodel", "~> 4.0.3" #
gem 'rails-observers', '~>0.1.1'
gem 'dalli', '~> 2.6.2' #
# gem 'turbolinks'
# gem 'jquery-turbolinks'

group :production do
    gem 'pg'
    gem 'rails_12factor'
end

group :development do
    gem 'sqlite3'
    gem 'annotate', '2.5.0'
end




# Don't think I'm using these
gem 'jquery-ui-rails'
gem 'jquery-ui-themes'

some heroku logs

2014-12-28T20:26:25.937063+00:00 app[web.1]:
2014-12-28T20:26:25.937075+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-12-28T20:26:25.937071+00:00 app[web.1]:
2014-12-28T20:26:25.937042+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-12-28T20:26:25.927220+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-12-28T20:26:25.937040+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `call'
2014-12-28T20:26:25.937072+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/adelphi_food_1-30d1a701653e3ce27c72d338a617333a.png"):
2014-12-28T20:26:25.937093+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-12-28T20:26:25.937100+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-12-28T20:26:25.937095+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/application.rb:97:in `call'
2014-12-28T20:26:25.937084+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `call'
2014-12-28T20:26:25.937085+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-12-28T20:26:25.937087+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-12-28T20:26:25.937088+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-12-28T20:26:25.937061+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-12-28T20:26:25.937062+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-12-28T20:26:25.937051+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/engine.rb:511:in `call'
2014-12-28T20:26:25.937098+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-12-28T20:26:25.937101+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-12-28T20:26:25.937113+00:00 app[web.1]:
2014-12-28T20:26:25.937114+00:00 app[web.1]:
2014-12-28T20:26:25.937091+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.3/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-12-28T20:26:25.937078+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `block in call'
2014-12-28T20:26:25.937090+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-12-28T20:26:25.937097+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-12-28T20:26:25.937103+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-12-28T20:26:25.937111+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Adam Zerner
  • 17,797
  • 15
  • 90
  • 156
  • Are the errors in the console "get" errors for the assets path? Can you post your view code for that page you linked to? – Rockwell Rice Dec 25 '14 at 18:55
  • Yes, they're all of the form `Failed to load resource: the server responded with a status of 404 (Not Found)` – Adam Zerner Dec 25 '14 at 19:53
  • You may have posted your gmail credentials. – Frederick Cheung Dec 25 '14 at 19:59
  • Don't forget to change them - the old versions of your post are still available – Frederick Cheung Dec 25 '14 at 20:03
  • One thing to remember, you dont need to precompile your assets if you have normal settings for production.rb When you deploy to heroku, the heroku itself precompiles the assets. It may create problems if you precompile your assets in the development and push to production rather – Shiva Jan 03 '15 at 13:20
  • Do you really need to precompile your assets? Have you read this post : http://stackoverflow.com/questions/18324063/rails-4-images-not-loading-on-heroku ? – romainsalles Jan 03 '15 at 13:26
  • @romainsalles I don't know if I need to precompile. I really just want to get the assets up any way possible. I read https://devcenter.heroku.com/articles/rails-asset-pipeline. It seems that I did what it said and I don't know what's wrong. – Adam Zerner Jan 03 '15 at 17:43
  • Could you reduce your code to the minimal needed to reproduce your error and share it with all the steps you have followed. This way we'll be able to test on our own AND isolate your problem (with some luck, you'll even solve it alone). – romainsalles Jan 03 '15 at 17:48
  • I don't know what the minimum code needed to reproduce my error is, and I'm afraid that in trying to reduce the code that I'll omit something important. As far as what I've done, basically I've ran a bunch of variations of the precompile command and pushed to heroku seemingly successfully. And I've played around with some settings in `production.rb`. This all was in following eabraham's advice. See http://chat.stackoverflow.com/rooms/67809/discussion-between-adam-zerner-and-eabraham. – Adam Zerner Jan 03 '15 at 18:10

1 Answers1

2

In order to deploy and serve Rails 4 static assets on Heroku you must include the rails12_factor Gem in the prod group of your Gemfile.

gem 'rails_12factor', group: :production

In addition you must confirm that config/application.rb serve_static_assets is set to true.

config.serve_static_assets = true

Check out Heroku documentation for more information.

eabraham
  • 4,094
  • 1
  • 23
  • 29
  • I've done both of those already (except `config.serve_static_assets = true` is in `production.rb`, not `application.rb`). – Adam Zerner Dec 28 '14 at 19:41
  • Can you include your Gemfile and the contents of your Heorku logs? – eabraham Dec 28 '14 at 20:17
  • 1
    Try running a heroku run bundle exec rake assets:precompile – eabraham Dec 28 '14 at 20:34
  • Edit: woops, I forgot the `bundle exec part`. Ok. That put a bunch of jquery ui stuff in `public/assets`. Like this: `I, [2014-12-28T20:35:37.437781 #2] INFO -- : Writing /app/public/assets/jquery-ui/animated-overlay-1ea36e0a81ec37df2a859f044bee843f.gif`. – Adam Zerner Dec 28 '14 at 20:38
  • I ran `heroku run bundle exec rake assets:precompile` and it seemed to do the same thing (put a bunch of jquery ui stuff in `public/assets`) – Adam Zerner Dec 28 '14 at 20:40
  • When you run RAILS_ENV=production rake assets:precompile do you get warnings or errors? – eabraham Dec 28 '14 at 20:42
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67809/discussion-between-adam-zerner-and-eabraham). – Adam Zerner Dec 28 '14 at 20:43