css - 在新机器上克隆元素后,twitter bootstrap rails CSS 未加载

标签 css ruby-on-rails git twitter-bootstrap less-rails

我有两台机器,Machine1 工作正常。 Machine2 是我正在设置的新机器。 Machine1 运行 OSX 10.6 Snow Leopard,Machine2 运行 OSX 10.8 Mountain Lion。我已经将我的元素上传到 Github,所以我应该能够(在 Machine2 上)安装 Xcode、自制软件、git、rvm、ruby、rails。然后,克隆元素、捆绑安装、rake,瞧,对吧?

不,样式表未加载。没有 CSS 样式,所以我检查浏览器,application.css 显示:

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. 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 bootstrap_and_overrides
 *= require_tree  
 *= require jquery.ui.datepicker
 *= require jquery.facebox
*/

我是不是忘记了什么?我运行了 rails generate bootstrap:install less 但仍然没有成功。由于某种原因,application.css 文件未被解释。

我认为这可能是 Ruby 版本的问题,因为 Machine2 使用的是 Ruby 2.0,而 Machine1 使用的是 Ruby 1.9.2,所以我在 Machine2 上安装了 1.9.2,但仍然是 nada。

这一切都处于开发模式。此外,在尝试解决问题时,我在布局中包含了 bootstrap_and_overrides 样式表,然后我进行了一些样式设置!但这显然不是解决方案。

这里有一些配置:

gem 文件

source 'https://rubygems.org'

gem 'rails', '3.2.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql2'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'twitter-bootstrap-rails'
  gem 'less-rails'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platform => :ruby
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

development.rb

Experts::Application.configure do

  config.cache_classes = false

  config.whiny_nils = true

  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  config.action_mailer.raise_delivery_errors = false

  config.active_support.deprecation = :log

  config.action_dispatch.best_standards_support = :builtin

  config.active_record.mass_assignment_sanitizer = :strict

  config.active_record.auto_explain_threshold_in_seconds = 0.5

  config.assets.compress = false

  config.assets.debug = true
end

最佳答案

可能降级 less-rails 版本是一个选项,我在从 1.9.3 升级到 ruby​​ 2.0.0-p247 时遇到了问题,并且所有 gem 都更新了。我无法在生产环境中进行预编译,在我将 less-rails 降级到 2.3.3 后,一切正常

关于css - 在新机器上克隆元素后,twitter bootstrap rails CSS 未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17561062/

相关文章:

html - 如何处理滑动门和非事件按钮

ruby-on-rails - Rails Bootstrap .span 不工作

git - 尝试运行gradle build时无法读取文件/usr/local/git/etc/gitconfig

linux - Git 数据从临时文件夹备份到新磁盘(磁盘 3)

php - 如何隐藏/删除提交按钮上的文本?

css - 将 Bootstrap 类应用于特定屏幕尺寸的元素

css - 无法在我网站的特定区域滚动

ruby-on-rails - rails : Grape API - NameError: uninitialized constant API

ruby-on-rails - 如何使用 Ruby 创建电子邮件地址生成器?

ruby-on-rails - Gitorious Rots Ruby on Rails 错误