4

I am working on ROR app, the app is working fine on local host but when on heroku "http://niveshi.herokuapp.com/portfolio/create" bootstrap is not working and even javascript code is not working. This is my gem file :

source 'https://rubygems.org'

gem 'rails', '3.2.12'

gem "mongoid", "~> 3.1.0"

  # Gems used only for assets and not required
  # in production environments by default.
  group :assets do
gem 'sass-rails',   '~> 3.1.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'


 # See https://github.com/sstephenson/execjs#readme for more supported runtimes
 gem 'therubyracer', :platforms => :ruby

 gem 'uglifier', '>= 1.0.3'
 end

 gem 'jquery-rails'
 gem 'delayed_job_mongoid'
 gem 'rb-readline', '~> 0.4.2'

  gem 'mechanize'
  gem 'debugger'
  gem 'twitter-bootstrap-rails'

Any guesses where I am wrong.

Deepender Singla
  • 999
  • 9
  • 28
  • The answer http://stackoverflow.com/a/20708011/2949565 worked for me, while i tried to push the sample app from railstutorial.org to heroku and the bootstrap was missing. I think that heroku want's the assets to be precompiled and this is one way to do this. – abuzze Jul 30 '14 at 21:46

4 Answers4

17

Use this on production.rb

config.assets.compile = true

If it is not work Then do the following things. rake assets:precompile it will generate assets file in your public folder, commit all those file then push the code into heroku server.

Sandip Mondal
  • 921
  • 7
  • 12
4

Try rake assets:precompile and then upload again to Heroku.

Tom Hert
  • 947
  • 2
  • 10
  • 32
  • did you check this part of the documentation? https://github.com/seyhunak/twitter-bootstrap-rails#using-stylesheets-with-less – Tom Hert Sep 12 '13 at 17:39
1

Done , actually this should be out of assets

gem 'sass-rails',   '~> 3.1.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'
Deepender Singla
  • 999
  • 9
  • 28
1

I got the same problem fixed with adding a. gem 'rails_12factor' b. bundle exec rake assets:precompile

praaveen V R
  • 1,259
  • 1
  • 11
  • 20