我使用的是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
但因为担心弄坏东西而没有继续前进
您应该升级您的“font-awesome-sass”gem,因为旧版本可能不受支持,您可以用以下版本替换您的gem
gem "font-awesome-sass", "~> 6.4.2"