0

Working on a rails app on windows in WSL 2. The app works comepletely fine, but I am unable to get the rails test command to work. I've tried setting active_support to "required: false" in the dependencies.rb file. I've also tried building a skeleton app without the active_support gem in a linux(ubuntu) virtual machine. Same error. Can't find any documentation online. Here's the error.

$ rails test
/home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require': cannot load such file -- rexml/document (LoadError)
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `block in require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:299:in `load_dependency'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox.rb:22:in `<top (required)>'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `block in require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:299:in `load_dependency'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/webdrivers-4.6.0/lib/webdrivers/geckodriver.rb:72:in `<top (required)>'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `block in require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:299:in `load_dependency'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/activesupport-6.1.3/lib/active_support/dependencies.rb:332:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/webdrivers-4.6.0/lib/webdrivers.rb:4:in `<top (required)>'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:66:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:66:in `block (2 levels) in require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:61:in `each'
jnqt@LAPTOP-T1CV6L61:~/environment/budget_app$  from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:61:in `block in require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:50:in `each'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler/runtime.rb:50:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/bundler-2.2.14/lib/bundler.rb:173:in `require'
        from /home/jnqt/environment/budget_app/config/application.rb:7:in `<top (required)>'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `require'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `preload'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
        from /home/jnqt/.rvm/gems/ruby-3.0.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
        from <internal:/home/jnqt/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/jnqt/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from -e:1:in `<main>'
mu is too short
  • 426,620
  • 70
  • 833
  • 800
jnqt
  • 11
  • Hey! I think this answer might help you: https://stackoverflow.com/a/65480744/249353. In short, you need to explicitly add gem rexml to your Gemfile from Ruby 3 on. – Josien Mar 23 '21 at 21:28
  • this worked! Thank you so much! – jnqt Mar 23 '21 at 22:33

0 Answers0