Project

General

Profile

Actions

Bug #2650

closed

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

Added by Dominic Cleal over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
High
Category:
Packaging
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Foreman - Bug #2701: Error when foreman-console is installed: cannot load such file -- minitestClosedDominic Cleal06/24/2013Actions
Actions #1

Updated by Dominic Cleal over 10 years ago

  • Priority changed from Normal to High
Actions #2

Updated by Lukas Zapletal over 10 years ago

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

Yami yami

Actions #3

Updated by Ohad Levy over 10 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

Actions #5

Updated by Lukas Zapletal over 10 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"-

Actions #6

Updated by Lukas Zapletal over 10 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
Actions #7

Updated by Gaël Chamoulaud over 10 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

Actions #8

Updated by Dominic Cleal over 10 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.

Actions #9

Updated by Gaël Chamoulaud over 10 years ago

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

Actions #10

Updated by Dominic Cleal over 10 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.

Actions #11

Updated by Gaël Chamoulaud over 10 years ago

Thx Dominic, It works now !

Actions

Also available in: Atom PDF