deploying Rails 3.1 namespaced assets to Heroku - heroku

I have a Rails 3.1 application running on Heroku Cedar and it has a custom built Admin panel.
Admin is just a namespaced controller/view combination which live in controllers/admin and in views/admin.
I also 'namespaced' the assets: called them assets/javascripts/admin.js.coffe and assets/stylesheets/admin.css.scss and include both from layouts/admin/application.html.haml
Heroku perfectly compiles application.(css.scss|js.coffee) to a javascript/stylesheet files. When I visit frontend application it just works.
But when I visit '/admin' I get the following error:
When I visit website in production I get the following error:
2011-09-19T15:47:18+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/execjs-1.2.5/lib/execjs/runtimes.rb:46:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
2011-09-19T15:47:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/execjs-1.2.5/lib/execjs.rb:5:in `<module:ExecJS>'
2011-09-19T15:47:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/execjs-1.2.5/lib/execjs.rb:4:in `<top (required)>'
2011-09-19T15:47:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
2011-09-19T15:47:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
2011-09-19T15:47:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
2011-09-19T15:47:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
2011-09-19T15:47:18+00:00 heroku[web.1]: Process exited
2011-09-19T15:47:20+00:00 heroku[web.1]: State changed from starting to crashed
According to Heroku's documentation I don't need to add gems like therubyracer-heroku to my gemfile. My admin asset files are manifest files and are similar to application asset manifests:
# application.js.coffee
#= require jquery
#= require jquery_ujs
# admin.js.coffee
#= require jquery
#= require jquery_ujs
Any thoughts?
Update 19 sept: As it turns out, admin assets are never compiled into public/assets and neither are present in public/assets/manifest.yml

Did you update your application's PATH, as also mentioned in the Heroku documentation you linked?
I had this same problem, adding 'bin' to the PATH solved it.

Related

Config.cache_classes unitialized constant controller on heroku

I just upgraded my rails project from rails 4.2 to rails 5.1.4. And after the upgrade my maincontroller started crashing. When i call it, it throws an error on the routes file, which states “uninitialized main controller”
After searching for a long time i set on my heroku server the config.cache_classes to false and everything worked all of a sudden. Though i’m unable to reproduce the logic on my local environment.
Anyone that has any idea where to search for a fix or how to fix this? I have been searching for days but without a single hit on what it might be!
Happy to provide any detail that anybody finds it usefully to help out! Just ask!
Ruby version 2.4.2
** EDIT - Added information as requested **
Full error is:
ActionController::RoutingError (uninitialized constant HomeController):
2017-11-26T15:16:55.051341+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/inflector/methods.rb:269:in `const_get'
2017-11-26T15:16:55.051342+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/inflector/methods.rb:269:in `block in constantize'
2017-11-26T15:16:55.051343+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/inflector/methods.rb:267:in `each'
2017-11-26T15:16:55.051343+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/inflector/methods.rb:267:in `inject'
2017-11-26T15:16:55.051344+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/inflector/methods.rb:267:in `constantize'
2017-11-26T15:16:55.051345+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:582:in `get'
2017-11-26T15:16:55.051346+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:613:in `constantize'
2017-11-26T15:16:55.051346+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/http/request.rb:85:in `controller_class_for'
2017-11-26T15:16:55.051347+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/http/request.rb:78:in `controller_class'
2017-11-26T15:16:55.051348+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:43:in `controller'
2017-11-26T15:16:55.051348+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:29:in `serve'
2017-11-26T15:16:55.051349+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:50:in `block in serve'
2017-11-26T15:16:55.051350+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in `each'
2017-11-26T15:16:55.051350+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in `serve'
2017-11-26T15:16:55.051351+00:00 app[web.1]: vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:834:in `call'
The controller is based in /myapp/app/HomeController.rb
class HomeController < ActionController::API
def click
# Execution of method, removed to keep post small
end
end
The routes file in the /myapp/config folder looks like:
Rails.application.routes.draw do
# root is set to a explainer json
root to: "home#not_found"
# New Routes
get '/clk', to: 'home#click'
# wildcard for any route not matched
get "*unmatched_route", to: "tracking#not_found"
end
Found the issue, It's related to a change in rails 5 for autoload paths.
now eager_load_paths should be used in the application.rb instead of autoload_paths
References:
https://github.com/rails/rails/commit/212ef5278b673aee304519d886d5db86a87b1437
https://blog.bigbinary.com/2016/08/29/rails-5-disables-autoloading-after-booting-the-app-in-production.html

Cannot run test execution using watir/taza/rspec

I'm using Unix system and trying to run Watir/Taza/RSpec test execution.
I just perform commands for creating taza structure, site, homepage and flow:
> taza create structure
> taza site google
> taza page home google
> taza flow search google
Then I run test using next command:
rake spec:isolation:google
but I get an error:
rake aborted! LoadError: cannot load such file -- taza/tasks
/Users/ismotrov/works/test/Rakefile:3:in require' /Users/ismotrov/works/test/Rakefile:3:in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in
load' /Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb:28:in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:689:in
raw_load_rakefile' /Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:94:in block in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in
standard_exception_handling' /Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:93:in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:77:in
block in run' /Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in
run' /Library/Ruby/Gems/2.0.0/gems/rake-10.4.2/bin/rake:33:in <top
(required)>' /usr/bin/rake:23:in load' /usr/bin/rake:23:in '
Who knows what to do?
And another moment I would like to dicuss - in file config/config.yml I have the following:
---
browser: firefox
driver: watir_webdriver
But on my Mac I don't have Firefox installed. How can I use this with, for example, Chrome and can it cause my problem?
1) Try this command:
rake spec:isolation
This worked for me.
2) Watir supports Chrome browser too. So just replace 'firefox' with 'chrome' and try to run your tests.

Using `require 'classname'` causes "No such file to load -- Classname" error on Heroku

TLDR: Using require 'classname' in another model file (so I can deserialize a column) works locally but results in the No such file to load -- Classname error when deploying to Heroku.
I've made the admittedly poor design decision to serialize a model attribute which contains an array of another model's objects (UserCategoryQueue has a serialized queue of Card objects). In order to actually de-serialize these objects, I've followed the advice in YAML::load raises undefined class/module error to use require 'Card' in the files where I need to deserialize that column. That avoids the issue where YAML doesn't know what it's looking at when it gets to the Card object.
This works fine on the localhost server but has resulted in a lot of issues when deploying to Heroku, all of the form No such file to load -- Card". Initially, this occurred during the asset precompilation phase, then I precompiled the assets myself and the same error has moved to when I try to run $ heroku run rake db:migrate to get everything set up for the first time.
Sample Files:
# app/models/user_category_queue.rb
class UserCategoryQueue < ActiveRecord::Base
...
# Our queue of Cards
serialize :queue, Array
end
# app/models/quiz.rb
class Quiz < ActiveRecord::Base
...
require 'Card'
...
# grab a random card from the user's queues
# produces YAML error without the above require statement
def sample_card
self.user.user_category_queues.sample.queue.sample
end
end
This ultimately resulted in the following errors on pushing to Heroku (prior to any asset precompilation attempts on my part):
Running: rake assets:precompile
rake aborted!
No such file to load -- Card
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/app/models/quiz.rb:18:in `<class:Quiz>'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/app/models/quiz.rb:1:in `<top (required)>'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:329:in `require_or_load'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:288:in `depend_on'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:206:in `require_dependency'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `each'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:464:in `block in eager_load!'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `each'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:462:in `eager_load!'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:347:in `eager_load!'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `each'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/config/environment.rb:5:in `<top (required)>'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/tmp/build_d0e6e2b8-a3fd-4a90-ae44-e703b0093401/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
As I said, even when precompiling assets, though the push went fine, the ensuing database migration had the same error pop up.
Heroku runs a case-sensitive filesystem, whereas your OS may not be case-sensitive. Try changing that require to this instead:
require 'card'
As a general rule of thumb, most files within Ruby are required using lowercase letters with underscores serving as a word separator, like this:
require 'card_shuffler'

Rails server won't start because of new relic error

When I try to start my Rails server, I am getting the following error:
I am using ruby 1.9.2
=> Booting WEBrick
=> Rails 3.1.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
/Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/agent.rb:318:in `log_app_names': undefined method `join' for nil:NilClass (NoMethodError)
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/agent/agent.rb:439:in `start'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/control/instance_methods.rb:95:in `start_agent'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/new_relic/control/instance_methods.rb:83:in `init_plugin'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/newrelic_rpm-3.4.2/lib/newrelic_rpm.rb:36:in `block in <class:Railtie>'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:30:in `run'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:54:in `each'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/application.rb:96:in `initialize!'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/toptier/Desktop/Proyectos/CursoIngles/config/environment.rb:5:in `<top (required)>'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `require'
from /Users/toptier/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.8/lib/active_support/dependencies.rb:240:in `block in require'
It is using the following gem: newrelic_rpm (3.4.2).
If I comment newrelic line in gemfile it works well,
Any idea?
I work at New Relic and we've tracked down the problem.
This happens when nil is explicitly set as the app name, which typically happens for local development of heroku apps that pull their app name from ENV["NEW_RELIC_APP_NAME"]. Since this environment variable is not typically set on your local dev box it comes into the agent's config as nil and crashes the local server. It doesn't effect deployed versions of the app where this variable is set.
Obviously the agent should handle this case gracefully, and we'll have a patch out in the next day or two. We just completed a major refactoring of the agent's configuration, and this edge case was missed in our internal testing.
etoleb gives a good workaround in the comment. We're very sorry for causing you this headache.
If you have any questions or concerns feel free to email me directly at sam#newrelic.com.
Thanks!
The issue seems to be related to the app_name setting being blank in your newrelic config. Personally I went through the Heroku installation (so your config may look different) but this is what I did:
Within config/newrelic.yml (copied from https://gist.github.com/2253296) I removed the line
app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
from the common config (line 35 for me) into the production config (after line 247 for me), which winds up looking like
production:
<<: *default_settings
monitor_mode: true
app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
Great to see a reply from someone who can take responsibility! Nice work, New Relic. Thanks, #samg.
Since the issue is just a nil env value, rather than downgrading the gem or diddling with config files, I just added the environment variable.
It's easy to see what the setting is on heroku:
$ heroku config
...
NEW_RELIC_APP_NAME: my_app_name
NEW_RELIC_ID: 123456
NEW_RELIC_LICENSE_KEY: 982987ae987987af98798something7e897987987c7b9d7
NEW_RELIC_LOG: stdout
...
I then opted to set a local env var via my project's .rvmrc file, where I so some other similar things:
rvm use ruby-1.9.2-p290#ConTracker --create
export PATH=bin:$PATH
export NEW_RELIC_APP_NAME=my_app_name
Then it just took a cd .. and a cd back in to my project, and it was working with the gem on version 3.4.2.
Party on!
Thanks for the comment. The answer is to downgrade to 3.4.1.

Heroku / Ruby-on-Rails error: image not precompiling

I know that Heroku is running the rake assets:precompile task:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size is 17.7MB
-----> Launching... done
And I told it to precompile images in production.rb
# from: http://stackoverflow.com/questions/8052865/rails-3-1-asset-pipeline-why-my-images-do-not-precompile-for-production
config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif]
So why do I still get this 500 error?
2012-05-29T02:57:15+00:00 app[web.1]: Started GET "/signin" for 46.114.68.16 at 2012-05-29 02:57:15 +0000
2012-05-29T02:57:15+00:00 app[web.1]: Processing by SessionsController#new as HTML
2012-05-29T02:57:15+00:00 app[web.1]: Rendered sessions/new.html.erb within layouts/application (25.4ms)
2012-05-29T02:57:15+00:00 app[web.1]: Completed 500 Internal Server Error in 27ms
2012-05-29T02:57:15+00:00 app[web.1]:
2012-05-29T02:57:15+00:00 app[web.1]: ActionView::Template::Error (twitter_64.png isn't precompiled):
2012-05-29T02:57:15+00:00 app[web.1]: 25: <div id="auths">
2012-05-29T02:57:15+00:00 app[web.1]: 27: <a href="/auth/twitter" class="provider">
2012-05-29T02:57:15+00:00 app[web.1]: 26: <h2>Or sign in through one of these:</h2>
2012-05-29T02:57:15+00:00 app[web.1]: 28: <%= image_tag "twitter_64.png", :size => "64x64", :alt => "Twitter" %>Twitter</a>
Interestingly, I have images on other pages that show just fine. Don't know why some images wouldn't work, but some would...
First, be sure you have this set as well:
config.assets.initialize_on_precompile = false
If that doesn't work, it's worth trying to manually run the precompile task before building the slug; I think there are subtle differences when done this way:
RAILS_ENV=production bundle exec rake assets:precompile
Last, it's not a solution, but if all else fails, a temporary workaround would be to set
config.assets.compile = true
Make sure you are putting your images in
app/assets/images
and not in
public/assets
directly.
Then run rake assets:precompile and see if it improves. It can get a bit confusing.

Resources