使用bootstrap_form gem时,为何找不到'rails_bootstrap_form'文件?

2026-04-10 07:231阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计274个文字,预计阅读时间需要2分钟。

使用bootstrap_form gem时,为何找不到'rails_bootstrap_form'文件?

我正在尝试使用bootstrap_form~2.0.1宝石(见https://github.com/bootstrap-ruby/rails-bootstrap-forms)。尽管它给了我适配,但我按照GitHub页面上的说明安装,将其添加到我的Gemfile中:gem 'bootstrap_form', '~> 2.0.1'。

我正在尝试使用bootstrap_form~> 2.0.1宝石(见 github.com/bootstrap-ruby/rails-bootstrap-forms),但它给了我适合.我按照github页面上的说明安装,将其添加到我的Gemfile中:

gem 'bootstrap_form', '~> 2.0.1'

我运行了bundle install.然后我将它添加到我的application.css.scss文件中:

使用bootstrap_form gem时,为何找不到'rails_bootstrap_form'文件?

*= require_self *= require rails_bootstrap_forms *= require_tree .

但是,当我尝试运行我的应用程序时,我得到:

couldn’t find file ‘rails_bootstrap_forms’ (in /path/to/my/app/assets/stylesheets/application.css.scss:12)

我显然错过了一些东西.我检查了lib / assets /和vendor / assets / stylesheets /但是那里什么都没有.同样,app / assets / stylesheets /中没有任何内容.

什么是软糖?

您必须在app / assets / stylesheets中创建文件rails_bootstrap_form.css

.rails-bootstrap-forms-date-select, .rails-bootstrap-forms-time-select, .rails-bootstrap-forms-datetime-select { select { display: inline-block; width: auto; } } .rails-bootstrap-forms-error-summary { margin-top: 10px; }

本文共计274个文字,预计阅读时间需要2分钟。

使用bootstrap_form gem时,为何找不到'rails_bootstrap_form'文件?

我正在尝试使用bootstrap_form~2.0.1宝石(见https://github.com/bootstrap-ruby/rails-bootstrap-forms)。尽管它给了我适配,但我按照GitHub页面上的说明安装,将其添加到我的Gemfile中:gem 'bootstrap_form', '~> 2.0.1'。

我正在尝试使用bootstrap_form~> 2.0.1宝石(见 github.com/bootstrap-ruby/rails-bootstrap-forms),但它给了我适合.我按照github页面上的说明安装,将其添加到我的Gemfile中:

gem 'bootstrap_form', '~> 2.0.1'

我运行了bundle install.然后我将它添加到我的application.css.scss文件中:

使用bootstrap_form gem时,为何找不到'rails_bootstrap_form'文件?

*= require_self *= require rails_bootstrap_forms *= require_tree .

但是,当我尝试运行我的应用程序时,我得到:

couldn’t find file ‘rails_bootstrap_forms’ (in /path/to/my/app/assets/stylesheets/application.css.scss:12)

我显然错过了一些东西.我检查了lib / assets /和vendor / assets / stylesheets /但是那里什么都没有.同样,app / assets / stylesheets /中没有任何内容.

什么是软糖?

您必须在app / assets / stylesheets中创建文件rails_bootstrap_form.css

.rails-bootstrap-forms-date-select, .rails-bootstrap-forms-time-select, .rails-bootstrap-forms-datetime-select { select { display: inline-block; width: auto; } } .rails-bootstrap-forms-error-summary { margin-top: 10px; }