5

このエラーのためにアプリケーションを開くことができません。追加しようとしまし// *= require "bootstrap-responsive"たが、これは機能しませんでした。また、カスタムからコードを削除してアプリケーションに追加し、アプリケーションの名前を に変更しようとしましたがapplication.css.scss、カスタムの名前をcustom.scssonlyに変更しようとしましたが、機能するソリューションが見つかりません。私は何ができますか ?

Sass::SyntaxError at /
File to import not found or unreadable: bootstrap-responsive.
Load paths:
  Sass::Rails::Importer(/home/dexter/Desktop/Sherif/Triton/app/assets/stylesheets/custom.css.scss)
  /home/dexter/.rvm/gems/ruby-1.9.3-p194/gems/bootstrap-sass-3.0.2.1/vendor/assets/stylesheets
  (in /home/dexter/Desktop/Sherif/Triton/app/assets/stylesheets/custom.css.scss)

カスタム.css.scss

// Example using 'Spruce' bootswatch
//
// First import variables
@import "bootswatch/cerulean/variables";

// Then bootstrap itself
@import "bootstrap";

// Bootstrap body padding for fixed navbar
body { padding-top: 60px; }

// Responsive styles go here in case you want them
@import "bootstrap-responsive";

// And finally bootswatch style itself
@import "bootswatch/cerulean/bootswatch";

....

アプリケーション.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 jquery.ui.all
 *= require bootstrap-datepicker
 *= require bootstrap-timepicker
 *= require bootstrap_form
 *= require style-metro
 *= require login
 *= require font
 *= require_tree .
 */

Gemfile (アセット グループからブートストラップを移動しようとしましたが、エラーも解決しませんでした)

group :assets do
  gem 'sass-rails', '3.2.4'
  gem 'bootstrap-sass', '~> 3.0.2.0'
...


end

プロジェクトを github にプッシュし、再度クローンを作成して使用した後にエラーが発生しました

4

1 に答える 1

18

Bootstrap-responsive は Bootstrap 3.0 から削除されました。

3.0 はモバイル ファーストの設計で、応答性は現在ネイティブです。

そのrequireステートメントを削除してください。今は必要ありません。

添加

Dexter(OP) は最終的に 2.3 に戻すことで問題を解決しました。まれなケースですが、次の 2 つの教訓を学ぶことができると思います。

  1. 重要な gem には必ずバージョンを追加してください。

  2. 常にbundle installorを使用bundleします (デフォルトでインストール)。bundle update本当に必要で、準備が整っている場合にのみ使用してください。

于 2013-11-13T08:28:14.327 に答える