Twitter Bootstrap problem in Heroku

I encountered a problem while using twitter boot strap in Rails, that too hosting with Heroku. Especially while using twitter bootstrap rails gem , all would work fine on my local machine, but when I upload the app  to heroku, it would throw an error as the boot strap’s less file messes up with some thing and does not compile properly.  Well how to avoid this?

The simplest answer is to download the files from twitter site using this link http://twitter.github.com/bootstrap/download.html#download and put them in your public folder for your rails application to use it.

The second option is to precompile your assets and upload it to heroku. To know how to precompile assets visit this link https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar

Hopefully you will be able to resolve the issues you face in deployment.

About these ads
  1. #1 by Allerin - Ruby on Rails on May 2, 2012 - 12:53 pm

    If everything works fine at your end at localhost then you might have to check with Hosting Heroku Technical support.

    • #2 by Karthikeyan A K on May 3, 2012 - 11:38 am

      Well, I don’t think so. For example I am developing a website like stack overflow called Qua http://qua.heroku.com , we use devise for authentication which works fine on localhost, but fails on heroku. We tweeked some stuff and now works everywhere. Yes heroku could have been contacted, but if the response time is great, its better we tweek here and male application work.

      • #3 by Allerin - Ruby on Rails on May 3, 2012 - 12:49 pm

        May be you are missing out some tweak in Online and Offline module. Lot of time it happens we forgot to mention the online modules which are necessary for project to execute on live server. So finding your answers in the soft corner where we basically deal with server uploads and database.

  2. #4 by Additional Info on December 16, 2012 - 9:55 am

    You’ve made some good points there. I checked on the internet for additional information about the issue and found most individuals will go along with your views on this site.

  3. #5 by Alisa Rude on January 1, 2013 - 12:36 am

    Greetings! I’ve been reading your web site for some time now and finally got the courage to go ahead and give you a shout out from Kingwood Tx! Just wanted to say keep up the fantastic work!

  4. #6 by Caner on May 27, 2013 - 3:39 pm

    I could not view the site with bootstrap css on heroku so I did the following change on config/environments/production.rb

    config.assets.compile =false to
    config.assets.compile =true

    Bingo!!!

    • #7 by Adrian on August 26, 2013 - 2:37 pm

      Worked perfectly for me too. Thanks for this, I’d been trying precompiling assets and all sorts before seeing this and having success!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,823 other followers

%d bloggers like this: