我正在构建一个简单的rails应用程序,当我加载主页时,我得到:
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' %>
我的宝石文件
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
在D:/workspaceRor/jrpappthree/app/assets/stylesheets/custom.css.scss
@import "bootstrap"; body { padding-top: 60px; } . . .
在开发环境中,它显示上述错误,但在生产中它工作正常.
我甚至试过了
# config/environments/production.rb ... config.assets.compile = true ...
解决方法
看起来它是windows上bootstrap.sass gem中的一个bug.
我看到人们将项目移动到C盘,然后开始工作.