@import 'bootstrap' 错误在 win7 上,显示 500 错误 [英] @import 'bootstrap' error on win7 , showing 500 error
问题描述
我正在构建一个简单的 rails 应用程序,当我加载主页时:
<前>在 59 毫秒内完成 500 个内部服务器错误ActionView::Template::Error(不同的前缀:c:/"和D:/workspaceRor/jrpappthree/ssets/stylesheets"(在 D:/workspaceRor/jrpappthree/app/assets/stylesheets/custom.css.scss 中):2: 3:<头>4:<title><%=full_title(yield(:title))%></title>5: <%= stylesheet_link_tag "application", media: "all" %>6:<%=javascript_include_tag应用程序"%>7:<%= csrf_meta_tags %>8:<%=渲染'布局/垫片'%>
我的宝石文件
gem 'rails'gem 'bootstrap-sass'宝石'bcrypt-ruby'宝石伪造者"宝石'will_paginate'gem 'bootstrap-will_paginate'宝石'pg'组:开发,:测试做宝石'mysql2'宝石注释"结尾# Gems 仅用于资产,不是必需的# 默认在生产环境中.组:资产做gem 'sass-rails'宝石咖啡轨"宝石 'uglifier'宝石轨道"结尾宝石'jquery-rails'组:测试做结尾组:生产做#宝石'pg'结尾
在 D:/workspaceRor/jrpappthree/app/assets/stylesheets/custom.css.scss
@import "bootstrap";身体 {填充顶部:60px;}...
在开发环境中,它显示了上述错误,但在生产环境中它工作正常.我什至试过
# config/environments/production.rb...config.assets.compile = true...
但它没有解决我的问题.那么在开发环境中运行应用程序的解决方案是什么.成功地?
看起来是 windows 上 bootstrap.sass gem 中的一个错误.
我看到有人将项目移动到 C 盘,然后它开始工作.
I am building a simple rails app and when I load the home page I get:
Completed 500 Internal Server Error in 59ms ActionView::Template::Error (different prefix: "c:/" and "D:/workspaceRor/jrpappthree/ ssets/stylesheets" (in D:/workspaceRor/jrpappthree/app/assets/stylesheets/custom.css.scss)):
2: <html>
3: <head>
4: <title><%= full_title(yield(:title)) %></title>
5: <%= stylesheet_link_tag "application", media: "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: <%= render 'layouts/shim' %>
my gem file
gem 'rails'
gem 'bootstrap-sass'
gem 'bcrypt-ruby'
gem 'faker'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'pg'
group :development, :test do
gem 'mysql2'
gem 'annotate'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'railties'
end
gem 'jquery-rails'
group :test do
end
group :production do
# gem 'pg'
end
in D:/workspaceRor/jrpappthree/app/assets/stylesheets/custom.css.scss
@import "bootstrap";
body {
padding-top: 60px;
}
.
.
.
In development environment, it shows the above error, but in production it works fine. I even tried
# config/environments/production.rb
...
config.assets.compile = true
...
but it didnt solve my problem. So what will be the solution for running the app in development env. successfully?
Looks like it is a bug in the bootstrap.sass gem on windows.
I have seen people move the project to the C Drive and then it starts working.
这篇关于@import 'bootstrap' 错误在 win7 上,显示 500 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!