mar*_*ion 16 css ruby-on-rails sass twitter-bootstrap ruby-on-rails-4
这是我的 application.css.scss
/*
*= require_self
*= require_tree .
*= require social-share-button
*/
Run Code Online (Sandbox Code Playgroud)
我正在使用这个宝石 - https://github.com/twbs/bootstrap-sass
根据说明,这是:assets我的Gemfile中的组:
group :assets do
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem "font-awesome-rails"
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
end
Run Code Online (Sandbox Code Playgroud)
我创建了一个名为的文件bootstrap_and_overrides.css.scss,其中包含:
@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap-responsive";
@import "font-awesome";
Run Code Online (Sandbox Code Playgroud)
这是错误:
Sass::SyntaxError at /
File to import not found or unreadable: bootstrap-sprockets.
/app/assets/stylesheets/bootstrap_and_overrides.css.scss:1)
Run Code Online (Sandbox Code Playgroud)
这是我的application.js:
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require bootstrap-sprockets
//= require social-share-button
//= require_tree .
Run Code Online (Sandbox Code Playgroud)
我已多次重启我的服务器,并从隐身窗口查看我的应用程序.
我使用的是Rails 4.1.1和Ruby 2.1.1.
有什么建议?
更新1:
对于它的价值,这就是我的app/assets/stylesheets/样子:
$ ls
application.css.scss bootstrap.css font-awesome.min.css
bootstrap-social.css bootstrap.min.css locations.css.scss
bootstrap-theme.css bootstrap_and_overrides.css.scss main.css
bootstrap-theme.min.css font-awesome.css posts.css.scss
Run Code Online (Sandbox Code Playgroud)
mar*_*ion 35
我在这里想出了问题.
问题是我正在使用一个:assets小组.这在Rails 4中被删除了.
**4.2 Gemfile**
Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading.
Run Code Online (Sandbox Code Playgroud)
一旦我把它们从资产组中拉出来,删除我的Gemfile.lock并且跑了bundle install......一切都很完美.
希望这有助于其他一些可怜的灵魂
我刚刚遇到了同样的问题
File to import not found or unreadable: bootstrap-sprockets
Run Code Online (Sandbox Code Playgroud)
我尝试重新启动开发服务器并再次运行"rails s",它工作正常!
| 归档时间: |
|
| 查看次数: |
19015 次 |
| 最近记录: |