Project

General

Profile

Bug #2650

Rails console doesn't load: cannot load such file -- minitest/unit

Added by Dominic Cleal about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
High
Category:
Packaging
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

On a 1.2.0-RC2 install on EL6, we don't have any test related packages. This causes the Rails console to fail:

/opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- minitest/unit (LoadError)
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /opt/rh/ruby193/root/usr/share/ruby/test/unit/assertions.rb:1:in `<top (required)>'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /opt/rh/ruby193/root/usr/share/ruby/test/unit/testcase.rb:1:in `<top (required)>'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/test_case.rb:1:in `<top (required)>'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/console/app.rb:2:in `<top (required)>'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:302:in `initialize_console'
    from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/application.rb:152:in `load_console'
    from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands/console.rb:27:in `start'
    from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
    from /opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in `require'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:60:in `rescue in require'
    from /opt/rh/ruby193/root/usr/share/rubygems/rubygems/custom_require.rb:35:in `require'
    from script/rails:6:in `<main>'

Related issues

Related to Foreman - Bug #2701: Error when foreman-console is installed: cannot load such file -- minitestClosed2013-06-24

Associated revisions

Revision 95234b21 (diff)
Added by Lukas Zapletal about 6 years ago

fixes #2650 - adding minitest dependency for console

Revision 9e3f1dff (diff)
Added by Dominic Cleal about 6 years ago

refs #2650 - fix minitest version

Revision 50f31137 (diff)
Added by Lukas Zapletal about 6 years ago

fixes #2650 - adding minitest dependency for console
(cherry picked from commit 95234b21bc9fba36206274f8996a0f933b2d4d33)

Revision b2314c2c (diff)
Added by Dominic Cleal about 6 years ago

refs #2650 - fix minitest version
(cherry picked from commit 9e3f1dff75a3a60568fa39fd3b8c52665f9819ac)

History

#1 Updated by Dominic Cleal about 6 years ago

  • Priority changed from Normal to High

#2 Updated by Lukas Zapletal about 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Lukas Zapletal

Yami yami

#3 Updated by Ohad Levy about 6 years ago

this would require a couple of line patches to rails itself, its fixed in rails 4.0
see https://github.com/rails/rails/issues/6907

#5 Updated by Lukas Zapletal about 6 years ago

Ok this was hard to find. But it seems to be easy fix. Anyway, interesting subject:

It looks like Ruby deveopers bundles some libraries (like minitest) which they use for internal stuff (e.g. implementation for test-unit). Unfortunately the way they do that (standard rubygem) allows users to use those libraries (they export public API). There are couple of problems with this approach - it is being discussed on Fedora and Ruby lists.

The main issue is some projects, including activesupport, do use minitest and do rely on minitest being bundled with Ruby 1.9+ but this will hopefully change in future.

Resolution: To add minitest as Foreman require in SPEC and add it to main Gemfile until this gets sorted in the upstream projects. Fixing this upstream would be challenging since there are two opinions: one group (me) says it's not official API (it's not documented) and should not be used, the other group says "they bundle it, we will use it"-

#6 Updated by Lukas Zapletal about 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

#7 Updated by Gaël Chamoulaud about 6 years ago

Hi guys,

I got this error this morning after a yum update (EL6 and 1.2.0-0.4.RC3).

The bundler.d/console.rb seems to be ok and contains the Lukas patch.

Gaël

#8 Updated by Dominic Cleal about 6 years ago

Gaël Chamoulaud wrote:

Hi guys,

I got this error this morning after a yum update (EL6 and 1.2.0-0.4.RC3).

The bundler.d/console.rb seems to be ok and contains the Lukas patch.

Gaël

When using the console, or doing something else? In theory it shouldn't be needed for normal operations.

#9 Updated by Gaël Chamoulaud about 6 years ago

The console is not available anymore for me. I've just the passenger error page with the ruby stack message!

#10 Updated by Dominic Cleal about 6 years ago

It's a bug in the console.rb change, it should read like this I think:

gem 'minitest', '~> 4.7', :require => 'minitest/unit'

Filed as #2701.

#11 Updated by Gaël Chamoulaud about 6 years ago

Thx Dominic, It works now !

Also available in: Atom PDF