我添加到我的新RoR应用程序 - gem twitter bootstrap。我使用CSS样式表
gem "twitter-bootstrap-rails"
rails generate bootstrap:install static
我改变了我的GEMFILE
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem "twitter-bootstrap-rails"
end
当我在Heroku上部署我的应用程序时,我收到了这个日志
Delta compression using up to 4 threads.
Compressing objects: 100% (59/59), done.
Writing objects: 100% (70/70), 26.75 KiB, done.
Total 70 (delta 4), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.3)
Installing i18n (0.6.1)
Installing multi_json (1.5.0)
Installing activesupport (3.2.9.rc2)
Installing builder (3.0.4)
Installing activemodel (3.2.9.rc2)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.3)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.1)
Installing tilt (1.3.3)
Installing sprockets (2.8.2)
Installing actionpack (3.2.9.rc2)
Installing mime-types (1.19)
Installing polyglot (0.3.3)
Installing treetop (1.4.12)
Installing mail (2.4.4)
Installing actionmailer (3.2.9.rc2)
Installing arel (3.0.2)
Installing tzinfo (0.3.35)
Installing activerecord (3.2.9.rc2)
Installing activeresource (3.2.9.rc2)
Installing coffee-script-source (1.4.0)
Installing execjs (1.4.0)
Installing coffee-script (2.2.0)
Installing rack-ssl (1.3.2)
Installing json (1.7.6)
Installing rdoc (3.12)
Installing thor (0.16.0)
Installing railties (3.2.9.rc2)
Installing coffee-rails (3.2.2)
Installing commonjs (0.2.6)
Installing jquery-rails (2.1.4)
Installing less (2.2.2)
Installing less-rails (2.2.6)
Installing libv8 (3.11.8.13)
Using bundler (1.3.0.pre.5)
Installing rails (3.2.9.rc2)
Installing ref (1.0.2)
Installing sass (3.2.5)
Installing sass-rails (3.2.5)
Installing therubyracer (0.11.2)
Installing twitter-bootstrap-rails (2.2.0)
Installing uglifier (1.3.0)
Your bundle is complete! It was installed into ./vendor/bundle
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Post-install message from twitter-bootstrap-rails:
Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS.
**********************************************
ExecJS supports these runtimes:
therubyracer - Google V8 embedded within Ruby
therubyrhino - Mozilla Rhino embedded within JRuby
Node.js
Apple JavaScriptCore - Included with Mac OS X
Microsoft Windows Script Host (JScript)
**********************************************
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Asset precompilation completed (25.98s)
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 15.9MB
-----> Launching... done, v6
http://rocky-badlands-2634.herokuapp.com deployed to Heroku
当我启动我的应用程序时,我收到消息 - “我们很抱歉,但出了点问题。” 我想也许它在日志
中与此消息相关联Post-install message from twitter-bootstrap-rails:
Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS.
如果我使用Less样式表,我也会收到此消息
答案 0 :(得分:14)
Rails使用SASS而不是LESS。您必须安装less-rails
gem以获得LESS支持。
在twitter-bootstrap-rails
instructions之后,您最终会得到:
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
安装在资产组之外。这可能会解决您的问题。
答案 1 :(得分:0)
只需将其添加到Gemfile
即可 gem 'twitter-bootstrap-rails', '2.1.3'
然后再做
bundle install
然后推送到heroku