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 trial

Ruby

Deployed 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

Try running the following to compile your CSS before deploying to Heroku:

rake assets:precompile

Let me know if that works!

did as you advised and it responded with rake aborted! C:/Sites/Gymbook/app/assets/javascripts/application.js

Can you try:

bundle exec rake assets:precompile --trace

The output from trace may determine where the issue is.

C:\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:inblock 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:inexec' 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:incompile' 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:inblock 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:inevaluate' 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:inblock 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:inevaluate' 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:innew' 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:inblock 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:inbuild_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:infind_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:inblock 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:ineach' 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:inblock 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:ineach_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:incompile' 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:inblock (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:inblock 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:inexecute' 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:inmon_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:ininvoke' 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:incall' 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:ineach' 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:inblock 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:ininvoke_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:ininvoke_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:ineach' 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:inrun_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:inblock 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:inrun' 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:inload' 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:inblock 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:insh' 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:inruby' 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:inruby_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:inblock (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:inblock 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:inexecute' 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:inmon_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:ininvoke' 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:inblock (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:inblock 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:intop_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:instandard_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

Okay, 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?

Thanks 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

Yeah, 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.

Will it really be in the code as it works fine locally is it not a heroku isssue?

Found 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.