Bootstrap date-picker image assets not displaying when deployed (on Heroku) - ruby-on-rails

I am using gem 'bootstrap3-datetimepicker-rails', '~> 3.1.3' to include a date/time-picker in my web app, and it works in development, but when I deploy to Heroku the assets (icons) that the gem uses for up/down arrows and other icons are displaying as empty squares, as seen in this screenshot:
Any idea why these are displaying properly?
This is how it should look:
I am using Rails 4, Ruby 2, and I am deployed on Heroku, thanks!
UPDATE: After looking at the Heroku logs, I see this error:
ActionController::RoutingError (No route matches [GET] "/assets/bootstrap/glyphicons-halflings-regular.tttf")
In my app, I have "/assets/bootstrap/glyphicons-halflings-regular-0469longseriesoflettersandnumbers.tttf"), which is why it's not finding it. What do these letters/numbers mean? Can I safely remove them from the names of the files in Sublime Text? Thanks again

Found the answer here Glyphicon works locally but not on Heroku and here https://holarails.wordpress.com/2014/04/03/problem-twitter-bootstrap-glyphicons-not-show-in-heroku/.
If anyone has a better solution (as it looks like using this can affect performance), I'd appreciate it!

Related

RoR SASS loading not working in production?

What would cause this to be the case? I cannot find any relevant information in pretty extensive searching. It works fine in development, but in production it's totally ignored. My personal custom CSS files are working but gem based ones like bootstrap-sass that I load with application.css.scss through import's does NOT work in production mode. I do not see any errors either.

Ajax_pagination gem loading image missing in Rails 4 production

I was using this gem successfully in production until moving to Rails 4. Now the loading image is not working properly. I have reached out to the developer, without assistance, so I would like to ask your help on this one.
Here is the file which I believe is involved:
https://github.com/ronalchn/ajax_pagination/blob/1297da84ead61f206e30f3d6bae2da6a551fed14/lib/generators/ajax_pagination/assets_generator.rb
Can this repo be modified to correctly show the image in Rails 4?
At the moment, I'm just seeing a broken image link.
The fix was simple in the end I just downloaded the original image:
https://github.com/ronalchn/ajax_pagination/blob/master/lib/assets/images/ajax-loader.gif
and put it into my existing assets/images directory! Bingo!

Heroku and Rich Editor - Clearing uploaded images

I'm using Rich Editor for my Ruby on Rails app. And I'm have a problem when I'm deploying my code to Heroku. When I'm deploy new code to Heroku, all old assets removes. Also, all uploaded images by Rich Editor too removes. Maybe, I'm forgot to set some settings?
Thanks!
There are multiple reasons for this kind of issue. Typically it is either has to do with the way Heroku precompiles the assets or that the CSS is not pointing to the proper file if the asset is stored on S3.
One such being this:
http://natashatherobot.com/rails-4-heroku-assets-not-found-css-image/
Another being this:
Can't get CSS working on Heroku using Rails 4 with bootstrap-sass gem
Edit
Okay. It looks like you need to change the way you are managing your assets.
One solution is to use S3. A good explanation on how to do that: https://devcenter.heroku.com/articles/s3
I haven't used this gem but it looks promising:
https://github.com/rumblelabs/asset_sync
Another solution is to keep your local asset file in synch with production. You could do this by pulling down a copy of your asset directory from heroku each time you do development.

Rails bootstrap gem created css problems

Okay I am running into a bit of an issue. When I am using the gem the page renders as below. However when I include the link to the actual bootstrap css stylesheet, the navbar shows up correctly. Any idea what could be causing this problem? I have overridden nothing and don't intend on doing so.
This was my own fault. Assets weren't being loaded since I hadn't restarted my rails server after making some changes to the gem file..

Rails 3.2 Deploy to Subdirectory Kind of Working

I am trying to deploy my Rails 3.2 app to a subdirectory, /support, on an Apache server. Consulting the various posts, the only solutions that seem to have helped involve setting up a symbolic link on the server and changing css image references slightly (two dots '..' required before /assets in the css url references--I can't seem to find the post on that one now). I am getting success in deployment to production with Capistrano, but then strangely after awhile something changes, the /support reference breaks and the stylesheets don't load. Any suggestions?
oh no, please don't deploy rails as sub-uri in that way, you are making yourself in trouble.
So far as I see, ( according to this post: http://kb.site5.com/ruby-on-rails/how-to-deploy-a-rails-3-application-to-a-sub-directory/ ) you created soft links, modified your routes.rb, and changed RAILS.root in environment.rb, and also changed your assets files... all of these make your rails app messed up.
I suggest you use 'passenger' as rails server and checkout this post: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_rack_to_sub_uri, it's quite easier and simplier

Resources