ruby-on-rails 获取“require”:安装gem 'font-awesome-sass'后无法加载此类文件-- ffi(LoadError),'~> 4.7.0'

agyaoht7  于 11个月前  发布在  Ruby
关注(0)|答案(2)|浏览(206)

我使用windows。我想包括字体真棒图标到我的项目,所以我添加了gem 'font-awesome-sass', '~> 4.6', '>= 4.6.2'到我的gem文件做了一个bundle install,得到了这个:

Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Fetching rb-fsevent 0.11.2
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Installing rb-fsevent 0.11.2
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.4
Installing sass 3.7.4
Fetching font-awesome-sass 4.7.0
Installing font-awesome-sass 4.7.0
Bundle complete! 26 Gemfile dependencies, 113 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

字符串
在尝试运行我的服务器后,我会得到这个:

PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> rails s
<internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- ffi (LoadError)
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<main>'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:60:in `block (2 levels) in require'     
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:55:in `each'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:55:in `block in require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:44:in `each'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:44:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler.rb:187:in `require'
        from C:/Users/XW3R/Documents/GitHub/WindhoekTradespersonPlatform/config/application.rb:7:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:137:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:134:in `perform'   
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from bin/rails:4:in `<main>'
PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform>

我的Gemfile

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.2.2"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.8"

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"

gem "activeadmin"

gem "sassc"

gem 'bootstrap', '~> 4.3.1'

gem "devise", github: "heartcombo/devise", branch: "main"

gem "geocoder"

gem "carrierwave", "~> 3.0"

gem 'faker', '~> 3.2', '>= 3.2.1'

gem "jquery-rails"

# Use sqlite3 as the database for Active Record
gem "sqlite3", "~> 1.4"

# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails"

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails"

# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails"

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"

# Use Redis adapter to run Action Cable in production
 gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# Use Sass to process CSS
# gem "sassc-rails"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

group :development, :test do
  # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
  gem "debug", platforms: %i[ mri mingw x64_mingw ]
end

group :development do
  # Use console on exceptions pages [https://github.com/rails/web-console]
  gem "web-console"

  # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
  # gem "rack-mini-profiler"

  # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
  # gem "spring"
end

group :test do
  # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
  gem "capybara"
  gem "selenium-webdriver"

end

gem "pagy", "~> 6.2"

gem 'byebug'

# gem 'font-awesome-sass', '~> 4.7.0'


我试着注解掉# gem 'font-awesome-sass', '~> 4.7.0',但这并没有改变任何东西
我试着做了一个gem uninstall ffi,得到了这样的消息:

gem uninstall ffi

You have requested to uninstall the gem:
        ffi-1.16.3-x64-mingw-ucrt

rb-inotify-0.10.1 depends on ffi (~> 1.0)
ruby-vips-2.2.0 depends on ffi (~> 1.12)
sassc-2.4.0 depends on ffi (~> 1.9)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]


通过选择y,将带来以下消息:

ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ apply2files - C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/ffi-1.16.3-x64-mingw-ucrt/lib/3.2/ffi_c.so
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2342:in `unlink'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2342:in `block in remove_file'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2350:in `platform_support'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2341:in `remove_file'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2330:in `remove'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:1470:in `block in remove_entry'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2389:in `block (2 levels) in postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2389:in `block (2 levels) in postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2389:in `block (2 levels) in postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2393:in `postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2388:in `block in postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2387:in `each'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2387:in `postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2388:in `block in postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2387:in `each'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2387:in `postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2388:in `block in postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2387:in `each'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:2387:in `postorder_traverse'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:1468:in `remove_entry'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:1323:in `block in rm_r'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:1319:in `each'
        C:/Ruby32-x64/lib/ruby/3.2.0/fileutils.rb:1319:in `rm_r'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/uninstaller.rb:254:in `block in remove'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/uninstaller.rb:371:in `safe_delete'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/uninstaller.rb:254:in `remove'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/uninstaller.rb:166:in `uninstall_gem'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/uninstaller.rb:143:in `uninstall'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:198:in `uninstall'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:184:in `uninstall_gem'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:178:in `block in uninstall_specific'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:170:in `each'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:170:in `uninstall_specific'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:136:in `execute'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/command.rb:327:in `invoke_with_build_args'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/command_manager.rb:252:in `invoke_command'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/command_manager.rb:192:in `process_args'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/command_manager.rb:150:in `run'
        C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/gem_runner.rb:51:in `run'
        C:/Ruby32-x64/bin/gem.cmd:18:in `<main>'
PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform>

更新我更新以下内容

PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> gem uninstall rb-fsevent

You have requested to uninstall the gem:
        rb-fsevent-0.11.2

If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled rb-fsevent-0.11.2
PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> gem uninstall rb-inotify

You have requested to uninstall the gem:

sass-listen-4.0.0 depends on rb-inotify (~> 0.9, >= 0.9.7)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled rb-inotify-0.10.1
PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> gem uninstall sass 
Remove executables:
        sass, sass-convert, scss

in addition to the gem? [Yn]  n
Executables and scripts will remain installed.
Successfully uninstalled sass-3.7.4


我到这里

PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> gem uninstall ffi

You have requested to uninstall the gem:
        ffi-1.16.3-x64-mingw-ucrt

ruby-vips-2.2.0 depends on ffi (~> 1.12)
sassc-2.4.0 depends on ffi (~> 1.9)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y


但由于害怕打破某些东西,

更新在某个地方看到说我应该尝试运行gem install ffi --platform=ruby,它会修复这个问题。A运行了它,得到了以下信息。再次太害怕了,不敢继续尝试这个

PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> gem install ffi --platform=ruby
Using rubygems directory: C:/Users/XW3R/.local/share/gem/ruby/3.2.0
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Successfully installed ffi-1.16.3
Parsing documentation for ffi-1.16.3
Installing ri documentation for ffi-1.16.3
Done installing documentation for ffi after 13 seconds
1 gem installed

A new release of RubyGems is available: 3.4.10 → 3.4.22!
Run gem update --system 3.4.22 to update your installation.

更新2按照建议,我将Gemfile更新为gem "font-awesome-sass", "~> 6.4.2"并运行bundle install,但得到了这个:

PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform>  bundle install 
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Fetching font-awesome-sass 6.4.2
Installing font-awesome-sass 6.4.2
Bundle complete! 26 Gemfile dependencies, 109 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
PS C:\Users\XW3R\Documents\GitHub\WindhoekTradespersonPlatform> rails s
<internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- ffi (LoadError)
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<main>'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-rails-2.1.2/lib/sassc/rails.rb:5:in `<main>'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-rails-2.1.2/lib/sassc-rails.rb:3:in `require_relative'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/sassc-rails-2.1.2/lib/sassc-rails.rb:3:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootstrap-4.3.1/lib/bootstrap/engine.rb:4:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootstrap-4.3.1/lib/bootstrap.rb:61:in `register_rails_engine'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootstrap-4.3.1/lib/bootstrap.rb:11:in `load!'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootstrap-4.3.1/lib/bootstrap.rb:75:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:60:in `block (2 levels) in require'     
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:55:in `each'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:55:in `block in require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:44:in `each'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:44:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bundler-2.4.19/lib/bundler.rb:187:in `require'
        from C:/Users/XW3R/Documents/GitHub/WindhoekTradespersonPlatform/config/application.rb:7:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:137:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/server/server_command.rb:134:in `perform'   
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command/base.rb:87:in `perform'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command.rb:48:in `invoke'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from C:/Users/XW3R/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in 
`require'
        from bin/rails:4:in `<main>'

os8fio9y

os8fio9y1#

你应该升级你的“font-awesome-sass”gem,因为旧版本可能不支持,你可以用下面的版本替换你的gem。

gem "font-awesome-sass", "~> 6.4.2"

字符串
所以当我尝试这个版本,因为你正在使用

gem 'font-awesome-sass', '~> 4.6', '>= 4.6.2


所以我得到了下面的错误,因为你提到x1c 0d1x
所以我试图从4.6升级到6.4.2,所以它工作正常,没有得到任何错误。**希望你在升级你的gem后进行捆绑安装。**你说的是ffe gem,所以它会直接安装/升级,因为它是font-awesome-saas gem

所需要的。

puruo6ea

puruo6ea2#

所以经过多次的战斗,其中包括重新安装Ruby,我认为问题是这样的
在我的Gemfile中,我修改了以下内容:

gem "sassc"

gem "bootstrap", "~> 4.3.1"

字符串
对此:

gem "dartsass-sprockets"

gem "bootstrap", "~> 5.3.2"


我是如何理解它从引导宝石回购
将bootstrap添加到Gemfile:
gem 'bootstrap', '~> 5.3.2'这个gem需要一个Sass引擎,所以确保你的Gemfile中有这两个gem之一:
dartsass-sprockets:Dart Sass引擎,推荐但仅适用于Ruby 2.6+和Rails 5+ sassc-rails:SassC引擎,已弃用但兼容Ruby 2.3+
Rails 4还确保sprockets-rails至少是v2.3.2。
旧的 Bootstrap 依赖于sassc,所以用dartsass-sprockets替换它对我来说很有用。我还做了很多其他的事情,所以如果这个东西对你不起作用,请随时询问。

相关问题