Twitter-bootstrap-rails does not work on geroku

I am working on a ROR application, the application works fine on the local host, but when heroku " http://niveshi.herokuapp.com/portfolio/create " bootstrap does not work and even javascript code does not work. 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 I'm wrong about.

+4
source share
4 answers

Done, it really should be out of assets

 gem 'sass-rails', '~> 3.1.3' gem 'coffee-rails', '~> 3.2.1' gem 'less-rails' 
+1
source

Use it on production.rb

 config.assets.compile = true 

If this does not work, then follow these steps. rake assets:precompile it will generate a file with files in your shared folder, transfer all these files, and then output the code to the heroku server.

+17
source

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

+4
source

I have the same problem fixed with the addition of a. gem 'rails_12factor' b. bundle exec rake assets:precompile

+1
source

Source: https://habr.com/ru/post/1501911/


All Articles