Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdam Sackfield
Courses Plus Student 19,663 PointsDeployed to Heroku
I have deployed my app here from following Treebook videos. link on my local machine it was working fine, now its deployed however you can see it hasnt found the stylesheets. Any help would be great thanks
4 Answers
rayorke
27,709 PointsTry running the following to compile your CSS before deploying to Heroku:
rake assets:precompile
Let me know if that works!
rayorke
27,709 PointsCan you try:
bundle exec rake assets:precompile --trace
The output from trace may determine where the issue is.
Adam Sackfield
Courses Plus Student 19,663 PointsC:\Sites\Gymbook>bundle exec rake assets:precompile --trace ** Invoke assets:precompile (first_time) ** Execute assets:precompile C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C:/RailsInstaller/Ruby1.9.3/bin/rake as sets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace ** Invoke assets:precompile:all (first_time) ** Execute assets:precompile:all ** Invoke assets:precompile:primary (first_time) ** Invoke assets:environment (first_time) ** Execute assets:environment ** Invoke tmp:cache:clear (first_time) ** Execute tmp:cache:clear ** Execute assets:precompile:primary rake aborted!
(in C:/Sites/Gymbook/app/assets/javascripts/application.js)
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/ext
ernal_runtime.rb:142:in exec_runtime'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/ext
ernal_runtime.rb:28:in
block in exec'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/ext
ernal_runtime.rb:41:in compile_to_tempfile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/ext
ernal_runtime.rb:27:in
exec'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/uglifier-2.3.1/lib/uglifier
.rb:177:in really_compile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/uglifier-2.3.1/lib/uglifier
.rb:101:in
compile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/compressors.rb:74:in compress'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/processing.rb:265:in
block in js_compressor='
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/processor.rb:29:in call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/processor.rb:29:in
evaluate'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/templat
e.rb:103:in render'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/context.rb:177:in
block in evaluate'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/context.rb:174:in each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/context.rb:174:in
evaluate'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/bundled_asset.rb:26:in initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:244:in
new'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:244:in build_asset'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/index.rb:89:in
block in build_asset'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/caching.rb:19:in cache_asset'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/index.rb:88:in
build_asset'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:163:in find_asset'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/index.rb:56:in
find_asset'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/static_compiler.rb:23:in block in compile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:212:in
block in each_logical_path'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:200:in block (2 levels) in each_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:190:in
each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:190:in each_entry'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:198:in
block in each_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:197:in each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:197:in
each_file'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sprockets-2.1.3/lib/sprocke
ts/base.rb:210:in each_logical_path'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/static_compiler.rb:18:in
compile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/assets.rake:56:in internal_precompile'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/assets.rake:70:in
block (3 levels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in
block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in
execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:175:in block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:168:in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:161:in
invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/assets.rake:60:in block (3 levels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in
call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in
each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:175:in
block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:168:in
invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:161:in invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:149:in
invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in
each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:115:in
run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rbin top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:78:in
block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:165:in standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:75:in
run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in
<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in
load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in <main>'
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C...]
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_u
tils.rb:55:in
block in create_shell_runner'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_u
tils.rb:45:in call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_u
tils.rb:45:in
sh'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_u
tils_ext.rb:37:in sh'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_u
tils.rb:82:in
ruby'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_u
tils_ext.rb:37:in ruby'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/assets.rake:12:in
ruby_rake_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/assets.rake:21:in invoke_or_reboot_rake_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/sprock
ets/assets.rake:29:in
block (2 levels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:236:in
block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:231:in
execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:175:in block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:168:in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task.r
b:161:in
invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:149:in invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in
block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:106:in
block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:115:in run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:100:in
top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:78:in block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:165:in
standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/applic
ation.rb:75:in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in
<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in
<main>'
Tasks: TOP => assets:precompile
Rhys Yorke as requested. Thanks for your help
rayorke
27,709 PointsOkay, I'll work under the assumption that you used Rails Installer, and have Ruby 1.9.3 and Rails 3.2.x
application.js should look something like:
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require_tree .
application.css:
*= require_self
*= require_tree .
Since I built my treebook application using Rails 4, Ruby 2 and rbenv as the Ruby version manager, it is bound to be different.
What you may want to do, is compare the above files with Jason Seifer's github treebook application here: https://github.com/jasonseifer/treebook
Do you have your code hosted up on github by any chance?
Adam Sackfield
Courses Plus Student 19,663 PointsThanks for response yeah it is hosted on github here. I used Cloud9 to set it up it is 1.9.3 and 3.2 versions. Thanks for response
rayorke
27,709 PointsYeah, I believe Jason's version still uses Rails 3.2 and Ruby 1.9. I think he's currently working on updating the tutorials for Rails 4.
Let me know how the code comparison goes, if that gives any insight to the issue.
Adam Sackfield
Courses Plus Student 19,663 PointsWill it really be in the code as it works fine locally is it not a heroku isssue?
minzawmra
Courses Plus Student 15,682 PointsFound this solution on Heroku https://devcenter.heroku.com/articles/getting-started-with-rails4#heroku-gems.
Add the following line in Gemfile:
gem 'rails_12factor', group: :production
Then run:
bundle install
Finally, push it to Heroku.
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 Pointsdid as you advised and it responded with rake aborted! C:/Sites/Gymbook/app/assets/javascripts/application.js