0

i'm following the Hartl tutorial about ROR 3.2, i build a simple app that works fine locally but when i try to deploy it to heroku wit $git push heroku master , the rake assets:precompile fails because "couldn't find file twitter/bootstrap". (error raised by application.js) I've already google the problem but none of these answers work for me: Heroku deploy fails after upgrading to bootstrap 2.0.1 via twitter-bootstrap-rails gem

Couldn't find file 'twitter/bootstrap' in Production

can anyone help me to figure out the problem? If i have to attach some files, or if you needother informations please tell me. Thank you

here the Gemfile

gem 'rails', '3.2.6'

group :development do
gem 'sqlite3'
gem 'annotate', '~> 2.4.1.beta'
end

group :production do
  gem 'pg'
end

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'twitter-bootstrap-rails', '~> 2.0.1.0'
  gem 'bootstrap-sass', '~> 2.0.3'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'bcrypt-ruby', '3.0.1'
Community
  • 1
  • 1
bugman
  • 315
  • 2
  • 5
  • 16

3 Answers3

1

I had a similar problem that got fixed by moving bootstrap related gems out of the assets group in gemfile. Paste it alongside the regular list of gems and it should work fine.

P Pramod Nair
  • 171
  • 2
  • 4
0

Have you added:

# Allow compilation of assests on Heroku
config.assets.initialize_on_precompile = false

to your config/application.rb file? This was the last step I did to fix my Heroku woes.

Also you should be fine leaving gem 'bootstrap-sass', '~> 2.0.3' in your group assets do block despite what I've read online.

Sounds like a problem in your gem file, here's an example one that's working fine on Heroku:

source 'https://rubygems.org'

group :development, :test do
  gem 'rspec-rails', '2.9.0'
  gem 'guard-rspec', '0.5.5'
end

group :test do
  gem 'capybara', '1.1.2'
end

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'

  gem 'bootstrap-sass', '~> 2.0.3'
end

gem 'rails', '3.2.2'
gem 'pg', '0.13.2'
gem 'jquery-rails', '2.0.2'
gem 'simple_form', '2.0.1'
Matthew Sumner
  • 346
  • 3
  • 16
  • It don't work unfortunately, i'v tried it directly on heroku (because locally now i have another issue running bundle install due to therubyracer) and now rake was aborted because "application.css has already been required". My application.css has only ' *= require_self *= require_tree . ' – bugman Jun 29 '12 at 21:59
  • ok now i don't have anymore the issue about therubyracer but the problem it's still the same, anyone? – bugman Jun 30 '12 at 10:57
-1

I solved this issue by using following steps:

  1. Move twitter-bootstrap-rails gem from outside of :assets in gemfile
  2. Update twitter-bootstrap-rails gem version 2.2.6 or just paste below line in your gemfile. gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

if twitter-bootstrap-rails 2.2.6 is not working then Use twitter-bootstrap-rails gem latest version.

suresh gopal
  • 3,138
  • 6
  • 27
  • 58