【问题标题】:Devise Bootstrap Views error rendering: couldn't find file 'devise_bootstrap_views' with type 'text/css'设计引导视图错误渲染:找不到类型为“text/css”的文件“devise_bootstrap_views”
【发布时间】:2018-10-03 22:11:54
【问题描述】:

我正在尝试使用 devise bootstrap views gem https://github.com/hisea/devise-bootstrap-views 创建一个应用程序。

这是我所做的:

  1. 将相应的 gem 'devise-bootstrap-views' 添加到 Gemfile + 捆绑安装
  2. application.css 文件中添加了*= require devise_bootstrap_views,位于*= require_tree . 之前
  3. 运行命令rails g devise:views:locale en
  4. 运行命令rails g devise:views:bootstrap_templates

但是,当我刷新浏览器时,我看到以下错误。我试图找出错误,但无济于事。

这是错误的屏幕截图:

谁能告诉我错误是在哪里引起的?

【问题讨论】:

    标签: ruby-on-rails devise


    【解决方案1】:

    我必须删除这一行:

    *= require devise_bootstrap_views
    

    【讨论】:

    • 请详细说明你的答案。
    【解决方案2】:

    也许你错过了服务器。你重启服务器了吗?

    【讨论】:

      【解决方案3】:

      按照https://github.com/seyhunak/twitter-bootstrap-rails安装引导程序
      运行 bundle install 运行生成器 rails generate bootstrap:install static 重启服务器。
      您现在已经安装了 Bootstrap 下一步安装设计 gem 'devise' 运行捆绑安装
      运行生成器 rails 生成引导程序:安装静态
      将设计附加到模型(假设用户)rails generate devise MODEL
      重启服务器。您现在已将设计安装到用户对象
      安装 Bootstrap 视图 gem 'devise-bootstrap-views', '~> 1.0' 运行 bundle install 运行生成器 rails generate devise:views:bootstrap_templates
      重启服务器

      【讨论】:

        【解决方案4】:

        删除此行,它将正常工作。 *= 需要 devise_bootstrap_views

        【讨论】:

          猜你喜欢
          • 2017-01-06
          • 1970-01-01
          • 1970-01-01
          • 2016-07-21
          • 2020-04-13
          • 2015-01-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多