我正在处理多个项目,当我从一个项目切换到另一个项目时,使用以下命令编译资产:
➜ rails assets:precompile
Ruby:2.7.5 Rails:6.0
我得到的是:
/Users/luqman/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: previous definition of ProtocRetryError was here
/Users/luqman/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE
/Users/luqman/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:214: warning: previous definition of BUFSIZE was here
/Users/luqman/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket
/Users/luqman/.rvm/rubies/ruby-2.7.5/lib/ruby/gems/2.7.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:541: warning: previous definition of Socket was here
rails aborted!
LoadError: cannot load such file -- i18n/core_ext/hash
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/activesupport-6.0.6.1/lib/active_support/dependencies.rb:324:in `block in require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/activesupport-6.0.6.1/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/activesupport-6.0.6.1/lib/active_support/dependencies.rb:324:in `require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/chewy-7.1.0/lib/chewy.rb:17:in `<main>'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/luqman/Desktop/techdots-projects/ccc/config/application.rb:7:in `<main>'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/luqman/Desktop/techdots-projects/ccc/Rakefile:4:in `<main>'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/railties-6.0.6.1/lib/rails/commands/rake/rake_command.rb:22:in `block in perform'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/railties-6.0.6.1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/railties-6.0.6.1/lib/rails/command.rb:48:in `invoke'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/railties-6.0.6.1/lib/rails/commands.rb:18:in `<main>'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/Users/luqman/.rvm/gems/ruby-2.7.5/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
问题似乎是i18 n宝石的。我甚至试过更新捆绑器。但仍然得到这个问题。
即使全面追踪也没什么发现。
使用的i18 n gem是-〉i18n (>= 0.7, < 2)
耐嚼的宝石似乎是个问题/Users/luqman/.rvm/gems/ruby-2.7.5/gems/chewy-7.1.0/lib/chewy.rb:17:in
'`
1条答案
按热度按时间bbmckpt71#
因此,通过使用以下命令清理所有全局和本地gem来修复它:
gem uninstall -aIx
为每个项目创建了gemsets,并为每个项目创建了单独的gem。
Bundle install
所有gem。这里的问题是,有些宝石是相互冲突的,即便是将宝石取出来,也没有完全取出来。
我希望这有帮助!