有人知道如何通过选择gem'rails','5.2.0'和'bootstrap','4.3.1'解决支架问题,这可能是由于无法制作scaffold.scss文件导致的。
我对Rails的了解太差,无法理解执行以下内容的解释:
rails generate scaffold Something first second
最后,脚手架坏了,并给出了解释:
1。使用引导方式
...
invoke scss
create app/assets/stylesheets/somethings.scss
/usr/local/rvm/gems/ruby-2.4.3/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': cannot load such file -- sass/css (LoadError)
from /usr/local/rvm/gems/ruby-2.4.3/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /usr/local/rvm/gems/ruby-2.4.3/gems/bootsnap-1.4.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:80:in `register'
...
2。没有引导功能
...
invoke scss
create app/assets/stylesheets/somethings.scss
/usr/local/rvm/gems/ruby-2.4.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require': cannot load such file -- sass/css (LoadError)
from /usr/local/rvm/gems/ruby-2.4.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /usr/local/rvm/gems/ruby-2.4.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
...
答案 0 :(得分:0)
我尝试运行rails generate scaffold --help
时遇到类似的错误。是
.../ruby-2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require': cannot load such file -- sass/css (LoadError)
我的Gemfile中没有引导,但是我确实有sassc-rails gem。
# Use SCSS for stylesheets
gem 'sassc-rails', '~> 2.1'
最新版本的sassc-rails是2.1.2。尝试运行bundle update sassc-rails
。这就是我的解决办法。