5

我使用 Rails Composer 为此处描述的 rails-devise-roles 项目创建了一个框架应用程序:

https://github.com/RailsApps/rails-devise-roles

我收到由以下内容生成的 500 错误:

Sass::SyntaxError - ".authform form" failed to @extend ".bg-faded".
The selector ".bg-faded" was not found.
Use "@extend .bg-faded !optional" if the extend should be able to fail.

添加“!可选”标志允许它呈现,但不会显示任何导航链接。

我的 Gemfile 的内容如下所示:

source 'https://rubygems.org'
git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end
ruby '2.2.5'
gem 'rails', '~> 5.1.3'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end
group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'bootstrap', '~> 4.0.0.alpha6'
gem 'devise'
gem 'high_voltage'
gem 'jquery-rails'
gem 'unicorn'
gem 'unicorn-rails'
group :development do
  gem 'better_errors'
  gem 'rails_layout'
  gem 'spring-commands-rspec'
end
group :development, :test do
  gem 'factory_girl_rails'
  gem 'faker'
  gem 'rspec-rails'
end
group :test do
  gem 'database_cleaner'
  gem 'launchy'
end

想法?

4

3 回答 3

8

更改@extend .bg-faded@extend .bg-light将修复您的错误

于 2017-09-10T19:03:52.977 回答
2

这很可能是因为您尚未导入框架 CSS。将这些添加到您的 application.scss 文件中

// import the CSS framework
@import "bootstrap"; 
于 2017-08-22T16:15:57.173 回答
0

将 gemfile 中的引导行更改为gem 'bootstrap', '= 4.0.0.alpha6'

于 2017-09-08T16:50:40.997 回答