Rails 测试命令在新项目上失败

时间:2021-08-01 20:40:10

标签: ruby ruby-on-rails-6

使用 rails new Project 创建新项目并立即更改目录并运行 rails test 命令时出现以下错误:

rails test
/usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:34:in `require': cannot load such file -- rexml/document (LoadError)
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox.rb:22:in `<main>'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/webdrivers-4.6.0/lib/webdrivers/geckodriver.rb:72:in `<main>'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/webdrivers-4.6.0/lib/webdrivers.rb:4:in `<main>'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
    from /usr/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.21/lib/bundler/runtime.rb:66:in `block (2 levels) in require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.21/lib/bundler/runtime.rb:61:in `each'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.21/lib/bundler/runtime.rb:61:in `block in require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.21/lib/bundler/runtime.rb:50:in `each'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.21/lib/bundler/runtime.rb:50:in `require'
    from /home/suchi/.local/share/gem/ruby/3.0.0/gems/bundler-2.2.21/lib/bundler.rb:174:in `require'
    from /home/suchi/Sync/Programming/Ruby/learning/learnRailsProject/config/application.rb:7:in `<top (required)>'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `require'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `preload'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
    from /usr/lib/ruby/gems/3.0.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
    from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from <internal:/usr/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from -e:1:in `<main>'

我在运行 ArcoLinux、ruby 版本 ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] 和 rails 版本 Rails 6.1.4 的 Linux 机器上。感谢您的帮助。

0 个答案:

没有答案