错误是说它找不到引导程序但是我已经安装了引导程序?

时间:2018-04-30 09:32:41

标签: ruby-on-rails ruby bootstrapping

Sass::SyntaxError in Books#index
Showing /Users/me/apps/rails/clones/book_review/app/views/layouts/application.html.erb where line #8 raised:

File to import not found or unreadable: bootstrap.
Load paths:
  /Users/me/apps/rails/clones/book_review/app/assets/config
  /Users/me/apps/rails/clones/book_review/app/assets/images
  /Users/me/apps/rails/clones/book_review/app/assets/javascripts
  /Users/me/apps/rails/clones/book_review/app/assets/stylesheets
  /Users/me/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/coffee-rails-4.2.2/lib/assets/javascripts
  /Users/me/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actioncable-5.2.0/lib/assets/compiled
  /Users/me/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activestorage-5.2.0/app/assets/javascripts
  /Users/me/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actionview-5.2.0/lib/assets/compiled
  /Users/me/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/turbolinks-source-5.1.0/lib/assets/javascripts
  /Users/me/apps/rails/clones/book_review/node_modules
Extracted source (around line #18):
16
17


 @import "bootstrap";

Rails.root: /Users/me/apps/rails/clones/book_review

Application Trace | Framework Trace | Full Trace

1 个答案:

答案 0 :(得分:0)

你究竟安装了什么?提供bundle list可能会有帮助。

要尝试的事情:

  • 如果您尚未
  • ,请运行bundle install
  • 重新启动Rails服务器
  • application.js
  • 中要求引导程序
  • 正在运行rake assets:precompile
  • the-gem-name添加到config/application.rb以明确要求
  • 尝试使用不同版本的gem
  • 作为最后的手段,您可以自行下载引导程序文件并将其包含在资产中