Problem Twitter Bootstrap Glyphicons not show in Heroku

The rails pipeline with Heroku is something difficult to master…

Today I had a problem that has taken some hours to be fixed.

I precompile assets as usual, and I realised that Glyphicon files have a different extension than the usual .js and .css, so I first had to extend it:

config.assets.precompile += %w( *.js *.css *.eot *.woff *.ttf *.svg )

Then I saw that the files were being produced correctly,


(excerpt of the manifest.json file)

But they did not show in Heroku

GET 404 (Not Found)

Although I could see them:

$ heroku run bash
$ ls public/assets

After some crazy investigation, this video gave me the solution:

You have to put this line in production.rb

config.assets.compile = true

To learn more, check out this excellent resources:

staging.rb in a new rails project

Rails does not include a config/staging.rb file in it’s default blueprint for a new project.

This can provoke problems when you try to run the server for the staging environment and the file does not exist. It happened to me while trying out a vagrant machine and there was a unicorn script in init.d

Solution: make sure this file exists when you want to run this mode. I got crazy!

I suggest that the rails software created this file by default. The reason not to do it is to avoid cumbersome initial installation. But it is somehow widely extended in the community that there are four environments:

  • development
  • test
  • staging
  • production 

Textmate 2 alpha problem with .yml yaml file

I have experienced problems with .yml files used in localization files for Rails. The files are somehow corrupt, because Textmate 2 is saving the file with weird codes for spaces/tabs. i have not been able to identify exactly why, but I discovered that the problem was being caused by Textmate because I tried with TextWrangler and it got solved.

Bug info:

TextMate version 2.0-alpha.9443.


 ~/Desktop% irb
    2.0.0-p247 :001 > require ‘YAML’
     => true 
    2.0.0-p247 :002 > YAML.load_file(‘en.yml’)
    Psych::SyntaxError: (en.yml): found a tab character that violate intendation while scanning a plain scalar at line 134 column 13