【问题标题】:The error is saying it can't find bootstrap but i've installed it?错误是说它找不到引导程序但我已经安装了它?
【发布时间】:2018-04-30 22:02:06
【问题描述】:
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

【问题讨论】:

  • 确保重启你的 Rails 服务器 (ctrl+c)。如果这不能解决问题,请添加bundle list的输出
  • 也许this 可以提供帮助

标签: ruby-on-rails ruby bootstrapping


【解决方案1】:

你到底安装了什么?提供您的 bundle list 可能会有所帮助。

要尝试的事情:

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

【讨论】:

    猜你喜欢
    • 2023-03-05
    • 2020-03-15
    • 1970-01-01
    • 1970-01-01
    • 2021-01-31
    • 2021-07-15
    • 1970-01-01
    • 2020-11-26
    • 2021-06-11
    相关资源
    最近更新 更多