さて、これはかなり奇妙な問題です。私は、ブートストラップ グリッドを使用し、他のブートストラップ css ファイルを使用しない Rails アプリを持っています。ローカルではすべて正常にレンダリングされますが、プロダクション モード (私は Heroku を使用しています) では、ブートストラップ css スタイルシートが追加されているように見えます。以前はこれを行っていませんでしたが、ブートストラップ CSS スタイルを自動的に含めるものを何も追加していないと確信しています。ここで明らかな何かが欠けていることを願っていますが、問題を特定することはできず、これまでに発生したことはありません。うまくいけば、私が間違っていることを教えてください。それと関係があるに違いないと思うので、gemファイルを投稿します。
source 'https://rubygems.org'
gem 'rails', '3.2.12'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'jquery-rails', '2.0.2'
gem 'activeadmin'
gem 'rename'
gem 'obscenity'
gem 'omniauth'
gem 'omniauth-facebook'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
gem 'guard-rspec', '1.2.1'
gem 'guard-spork', '1.2.0'
gem 'spork', '0.9.2'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '4.1.0'
gem 'cucumber-rails', '1.2.1', :require => false
gem 'database_cleaner', '0.7.0'
# gem 'launchy', '2.1.0'
# gem 'rb-fsevent', '0.9.1', :require => false
# gem 'growl', '1.0.3'
end
group :production do
gem 'pg', '0.12.2'
end
ここに私のapplication.cssファイルがあります:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
そして、ここに私のapplication.htmlファイルがあります:
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= full_title(yield(:title)) %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700,600' rel='stylesheet' type='text/css'>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<!-- Application alerts -->
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>">
<div class="container">
<%= value if value.length > 0 %>
</div>
</div>
<% end %>
<%= render "layouts/nav" %>
<%= yield %>
<%= render "layouts/footer" %>
</body>
</html>