【问题标题】:'twitter/bootstrap/responsive.less' wasn't found'twitter/bootstrap/responsive.less' 没有找到
【发布时间】:2014-08-26 19:33:47
【问题描述】:

我正在尝试将我的应用程序移动到另一台服务器,但目前出现以下错误。

'twitter/bootstrap/responsive.less' wasn't found (in /home/rails/**/app/assets/stylesheets/bootstrap_and_overrides.css.less)

我的 gemfile 中没有 :assets 块——所以之前针对此问题的解决方案不适用于我的情况。

这是我的 Gemfile

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
#gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'

#For User Management
gem 'devise'
gem 'cancan'
gem 'rolify'

#For adding attachments
gem 'paperclip', github: 'thoughtbot/paperclip'

#For Bootstrap
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'bootstrap_form'

gem 'debugger'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails'

# Use debugger
#gem 'debugger'

感谢任何帮助!我对这个错误或多或少一无所知。

附加说明:我的应用程序在我当前的服务器上正常运行,但我什至无法让它在我的新服务器上运行一次,我尝试以相同的方式安装它。

【问题讨论】:

    标签: ruby-on-rails ruby twitter-bootstrap less


    【解决方案1】:

    当我没有在我的 gemfile 中指定特定版本时,我无意中将twitter-bootstrap-rails 更新为 3.2.0。以前的版本是 2.2.8,我回滚到现在一切正常。新版本缺少 responsive.less 文件。

    【讨论】:

    • Bootstrap v3 完全集成了响应能力,因此 v3 中不再有单独的responsive.less
    • 当他说“回滚”时,他在 Gemfile 中的意思是:gem 'twitter-bootstrap-rails', '2.2.8'
    • 不幸的是,bundle audit 在 v2.2.8 中报告了 vulnerabilities,并说使用 >= 3.2.0。
    【解决方案2】:

    twitter-bootstrap-rails 3.2.0 版的设置与 2.2.8 版不同。 如果要使用 3.2.0 版,还必须更新设置。为此,请运行以下命令:

    rails generate bootstrap:install less
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-10
      • 1970-01-01
      • 2012-07-14
      • 2013-07-27
      • 1970-01-01
      • 2012-12-21
      • 1970-01-01
      相关资源
      最近更新 更多