I get this error when i try to deploy my app to Heroku. My first deployment works fine before I'm doing heroku run rake db:reset.
After this, I have errors below: "We're sorry, but something went wrong." and "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved."
My heroku logs says:
2012-12-08T11:40:54+00:00 app[web.1]: ActionView::Template::Error (bootstrap.css isn't precompiled):
2012-12-08T11:40:54+00:00 app[web.1]: 9: <%= csrf_meta_tags %>
2012-12-08T11:40:54+00:00 app[web.1]:
2012-12-08T11:40:54+00:00 app[web.1]: 8: <%= javascript_include_tag "bootstrap", media: "all"%>
Some one, Can you help me ?
Looks like Heroku is complaining that your assets are not precompiled. I'd read through this tutorial about rails on heroku, there is a section dedicated to resource pre-compilation.
You can tell your application to precompile assets in production
#config/environments/production.rb
config.assets.compile = true
# Heroku also requires this to be false
config.assets.initialize_on_precompile=false
Or you can precompile your assets using the rake task
#before pushing to Heroku and then you can push
rake assets:precompile
#or after you've pushed to heroku
heroku run rake assets:precompile
Related
i'm running on Ruby 2.3.3 &
rails 5.1
i'm getting this from heroku logs =>
ActionView::Template::Error (The asset "favicon/favicon.ico" is not present in the asset pipeline.):
folder path (assets/images/favicon/favicon.ico)
code in my application header:
<%= favicon_link_tag 'favicon/favicon.ico' %>
It was working locally, but I got a 500 internal server error when I pushed it to heroku. i have run
rake assets:precompile
and it's still not working.
I have an application on Heroku, and after I update to Rails 4.1.0 I'm seeing these RoutingErrors exception:
Started GET "/assets/Elusive-Icons-5997c1a6679785a96defc4f57a3f2ff5.svg" for 177.16.216.169 at 2014-04-12 21:56:41 +0000
2014-04-12T21:56:41.397071+00:00 app[web.1]:
2014-04-12T21:56:41.397071+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/assets/Elusive-Icons-5997c1a6679785a96defc4f57a3f2ff5.svg"):
I installed rails_12factor and tried to put config.serve_static_assets = true on applicationl.rb but no effect. What am I missing?
As mentioned in the comments, you should input this into your cmd: rake assets:precompile RAILS_ENV=production -- this, coupled with deploying to Heroku, should solve the issue
I updated my Spree Commerce app to include the spree_fancy theme (which works locally) and after pushing the changes to git and running cap deploy the page now displays the error message "we're sorry but something went wrong".
I looked in the production.log file but all I see are lists and lists of rendered stuff and no errors. Only 200 OK and 301 moved permanently messages.
I rebooted the server and did rake db:migrate. Both did not help.
How do I go about finding what went wrong?
//UPDATE
I've added I've added config.consider_all_requests_local = true to production.rb, did a rollback and a deploy and now I see an error message in the browser (this is not in the production.log...):
Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in
Spree/home#index
store/print.css isn't precompiled
I searched the internet and added the following to production.rb:
config.assets.precompile += %w( store/shared/_print.css )
but this did not help. I also added the print.css file to /public/assets/stylesheets/store/ and precompiled with RAILS_ENV=production bundle exec rake assets:precompile but that did not work either.
Does anyone have another idea what to do?
Using RAILS_ENV=production bundle exec rake assets:precompile. Thanks!
I'm using Rails on Heroku Cedar stack and it's not throwing any issues while compiling the assets but then I get a 500 internal server error:
2012-06-25T23:22:59+00:00 app[web.1]: ActionView::Template::Error (bootstrap-datepicker.js isn't precompiled):
Any idea what might be causing this? This is the javascript file I'm including (except I downloaded it locally) https://github.com/eternicode/bootstrap-datepicker/blob/master/js/bootstrap-datepicker.js
I'm including it in my application.html.erb like so:
<%= javascript_include_tag "bootstrap-datepicker" %>
Is it because its not a coffeescript file? Any help is appreciated!
I figured it out. I had to add it to production.rb in config.assets.precompile
In production.rb I added it to my config.assets.precompile:
config.assets.precompile += %w( jquery.dataTables.min.js jquery-ui-1.8.21.custom.min.js jquery-ui-1.8.21.custom.css bootstrap-datepicker.js fullcalendar.js)
I've just migrated to rails 3.1 and I'm having trouble getting started with the asset pipeline.
I ran: bundle exec rake assets:precompile RAILS_ENV=production after adding additional css files into config.assets.precompile += ['scaffold.css', 'other.css', 'other.js'] all of my files are located in the /app/asset images, javascripts, or stylesheets path.
Following the rake task, I can see the manifest.yml file but it is missing the additional css and js files I added to the config.assets.precompile
Here is my manifest.yml file that lives on prod:
connect.gif: connect-b85d46914c10cb653f3444c3529b83eb.gif connect.png:
connect-bce549a396f27cc5f7b315190ee3385a.png d.jpeg:
d-c5f2ca3025794efdc341159538f4a0bf.jpeg data.png:
data-d225a9937a1aa78805e704ada167b2d0.png fb.png:
fb-2e743f3607323f9d21dd2e96b5c95d4b.png feed.png:
feed-fd4c0dc513639edd0ba2f39a063fdc90.png grid.png:
grid-b3db76abb46477b06c15055df8412c79.png i.png:
i-5ac52498083d9dfc5f898cdf666bc9c0.png infb.png:
infb-80208a4e1bd3d2a03f23097a7d19fe7e.png r.png:
r-ba27ded8b8873c851cd9aaf8697f8092.png rails.png:
rails-e4b51606cd77fda2615e7439907bfc92.png share.jpeg:
share-47877a532c58510f38eeb534122b4846.jpeg share.png:
share-b9939bdcdf8b082eeb27697592258b9a.png signup.jpeg:
signup-23dfea4e8af95dae93ab254162e01fc2.jpeg tc.png:
tc-abb1838a7396c3a0a54e68ecb80cd225.png tweet.png:
tweet-3865676af138fa7d80e0e416210f2fa0.png yellow.png:
yellow-b2257e0f9bb17cd4b44faaee30df8fa6.png jquery.flot.js:
jquery.flot-944582c3d888856c9d82964ea8cf0bcc.js jquery-ui.min.js:
jquery-ui.min-4258e47b40673a02bedfda178628bfba.js jquery.min.js:
jquery.min-17322428695737103f15e8b9db8b5909.js application.js:
application-f71535809bb0483163e3e4d857abe6d0.js
What is going on here? I've restarted both passenger with touch restart.txt and nginx. I've read all of the documentation on this issue.
nginx error.log:
cache: [GET /] miss
ActionView::Template::Error (scaffold.css isn't precompiled):
2: %html
3: %head
4: %title redmeetsblue
5:
6: = javascript_include_tag "application.js"
7: = csrf_meta_tag
8: %script{:src => "http://connect.facebook.net/en_US/all.js#appId=143150285757259&xfbml=1"}
app/views/layouts/application.html.haml:5:in `_app_views_layouts_application_html_haml__44133251_81438200'
app/controllers/homes_controller.rb:7:in `index'
Have you set the config.assets.precompile values in application.rb ? If you set them elsewhere they won't be picked up when you precompile.