简体   繁体   English

twitter-bootstrap-rails无法在heroku上运行

[英]twitter-bootstrap-rails not working on heroku

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. 我正在研究ROR应用程序,该应用程序在本地主机上工作正常,但在heroku“ http://niveshi.herokuapp.com/portfolio/create ”引导程序无效,甚至javascript代码无法正常工作。 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. 任何我猜对错的猜测。

Use this on production.rb 在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. rake assets:precompile它会在你的公共文件夹中生成资产文件,提交所有这些文件然后将代码推送到heroku服务器。

尝试rake assets:precompile ,然后再次上传到Heroku。

Done , actually this should be out of assets 完成,实际上这应该是资产

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

I got the same problem fixed with adding a. 我通过添加一个修复了同样的问题。 gem 'rails_12factor' b. gem 'rails_12factor' bundle exec rake assets:precompile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM