我在 Rails 5.1 上使用 bootstrap4 生成 simple_form,所以我在网上搜索并尝试以下方法:
rails generate simple_form:install --bootstrap
rails generate simple_form:install --bootstrap4
rails generate simple_form:install --bootstrap4 --force
并且没有一个会生成如下配置的文件:config/initializers/simple_form_bootstrap.rb
我看版本已安装并且是simple_form 1.4.1
. 我尝试安装新版本 3.2.1,但运行bundle update
命令时出现错误。我有这些错误:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (~> 5.1.0) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0)
rails (~> 5.1.0) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0)
rails (~> 5.1.0) was resolved to 5.1.0, which depends on
actionpack (= 5.1.0)
rspec-rails (~> 3.5) was resolved to 3.6.0, which depends on
actionpack (>= 3.0)
simple_form (~> 3.2.1) was resolved to 3.2.1, which depends on
actionpack (< 5.1, > 4)
我正在尝试使用新版本 rails 5.1 做一个应用程序。任何人都可以帮助我,我将不胜感激!