rdoc fails to work with error "no such file to load -- rdoc/stats/normal" #1712

Closed
diegoviola opened this Issue May 10, 2012 · 20 comments

Projects

None yet

2 participants

@diegoviola

I built RBX in the clone dir from git master and added rubinius/bin to my PATH, I built RBX myself without RVM or rbenv.

[diego@(none) ~]$ echo $PATH
/home/diego/rubinius/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl
[diego@(none) ~]$ 

The problem is when I run rdoc I get this:

[diego@(none) ~]$ rdoc
uh-oh! RDoc had a problem:
no such file to load -- rdoc/stats/normal

run with --debug for full backtrace
[diego@(none) ~]$ 
[diego@(none) ~]$ rdoc --debug
no such file to load -- rdoc/stats/normal
kernel/common/codeloader.rb:385:in `load_error'
        kernel/common/codeloader.rb:372:in `resolve_require_path'
        kernel/common/codeloader.rb:104:in `require'
        kernel/bootstrap/rubinius.rb:135:in `synchronize'
        kernel/common/codeloader.rb:103:in `require'
        kernel/common/codeloader.rb:201:in `require'
        kernel/common/autoload18.rb:17:in `call'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/stats.rb:40:in `initialize'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:381:in `parse_files'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:452:in `document'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/bin/rdoc:20:in `__script__'
        kernel/common/kernel.rb:580:in `load'
        /home/diego/rubinius/gems/bin/rdoc:19:in `__script__'
        kernel/delta/codeloader.rb:67:in `load_script'
        kernel/delta/codeloader.rb:109:in `load_script'
        kernel/loader.rb:628:in `script'
        kernel/loader.rb:832:in `main'

[diego@(none) ~]$ 

rdoc version on rbx is 3.12, I have rdoc 3.9.4 on MRI and it works just fine under MRI.

My system is Arch Linux x86-64, GCC 4.7.0 20120505 (prerelease), Linux 3.3.5.

Any ideas please?

@brixen
Member
brixen commented May 10, 2012

This works fine for me. I build rbx in the clone dir.

@diegoviola

Strangely this works:

[diego@(none) ~]$ rubinius/bin/rdoc --version
rdoc 3.12
[diego@(none) ~]$ 

But this doesn't:

[diego@(none) ~]$ RBXOPT="-X19" rubinius/bin/rdoc --version
An exception occurred running /home/diego/rubinius/gems/bin/rdoc
    Could not find json (~> 1.4) amongst [ffi-1.0.11, rake-0.9.2.2, rake-compiler-0.7.9, rdoc-3.12, ruby-debug-0.10.47] (Gem::LoadError)

Backtrace:
                         Gem::Dependency#to_specs at rubinius/lib/rubygems/dependency.rb:247
  { } in Gem::Specification#activate_dependencies at rubinius/lib/rubygems/specification.rb:761
                                       Array#each at kernel/bootstrap/array.rb:68
         Gem::Specification#activate_dependencies at rubinius/lib/rubygems/specification.rb:758
                      Gem::Specification#activate at rubinius/lib/rubygems/specification.rb:742
                               Kernel(Object)#gem at rubinius/lib/rubygems.rb:1204
                                Object#__script__ at rubinius/gems/bin/rdoc:18
                 Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67                                                                                 
                 Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:109                                                                                
                          Rubinius::Loader#script at kernel/loader.rb:628                                                                                          
                            Rubinius::Loader#main at kernel/loader.rb:832                                                                                          
[diego@(none) ~]$ 
@diegoviola

It seems I was missing the json gem in 1.9 mode, so I've installed it and now I don't have that error anymore with 1.9 mode.

[diego@(none) ~]$ rubinius/bin/rdoc --version
rdoc 3.12
[diego@(none) ~]$ 
[diego@(none) ~]$ RBXOPT="-X19" rubinius/bin/rdoc --version
rdoc 3.12
[diego@(none) ~]$ 
@diegoviola

I get this which is strange though:

[diego@(none) ~]$ RBXOPT="-X19" rubinius/bin/rdoc 
uh-oh! RDoc had a problem:
undefined method `last' on nil:NilClass.

run with --debug for full backtrace
[diego@(none) ~]$ 
[diego@(none) ~]$ RBXOPT="-X19" rubinius/bin/rdoc --debug
undefined method `last' on nil:NilClass.
kernel/delta/kernel.rb:81:in `last (method_missing)'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/parser.rb:133:in `can_parse'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:291:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:322:in `list_files_in_directory'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:303:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:322:in `list_files_in_directory'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:303:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:322:in `list_files_in_directory'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:303:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:322:in `list_files_in_directory'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:303:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:322:in `list_files_in_directory'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:303:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:322:in `list_files_in_directory'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:303:in `normalized_file_list'
        kernel/bootstrap/array.rb:68:in `each'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:282:in `normalized_file_list'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:120:in `gather_files'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:380:in `parse_files'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/lib/rdoc/rdoc.rb:452:in `document'
        /home/diego/rubinius/gems/rubinius/preinstalled/gems/rdoc-3.12/bin/rdoc:20:in `__script__'
        kernel/common/kernel.rb:580:in `load'
        /home/diego/rubinius/gems/bin/rdoc:19:in `__script__'
        kernel/delta/codeloader.rb:67:in `load_script'
        kernel/delta/codeloader.rb:109:in `load_script'
        kernel/loader.rb:628:in `script'
        kernel/loader.rb:832:in `main'

[diego@(none) ~]$ 
@brixen brixen closed this in bed9da6 May 11, 2012
@diegoviola

I've tried building rbx from master and I got a few errors during the build: https://gist.github.com/2664177

Also, I'm not sure why but when I do "rdoc --help" it doesn't show me the rdoc help at all.

[diego@(none) ~]$ rubinius/bin/rdoc --help
Usage: rbx [subcommand] [options] [--] [script] [arguments]

Script is any valid Ruby source code file

Ruby options
   -                     Read and evaluate code from STDIN
   --                    Stop processing command line arguments
   -a                    Used with -n and -p, splits $_ into $F
   -c                    Only check the syntax
   -C DIR                Change directory to DIR before running scripts
   -d                    Enable debugging output and set $DEBUG to true
   -e CODE               Compile and execute CODE
   -G, --gemfile         Respect a Gemfile in the current path
   -h, --help            Display this help
   -i [EXT]              Edit ARGV files in place, making backup with EXT
   -I DIR1[:DIR2]        Add directories to $LOAD_PATH
   -K [code]             Set $KCODE
   -n                    Wrap running code in 'while(gets()) ...'
   -p                    Same as -n, but also print $_
   -r LIBRARY            Require library before execution
   -s                    Process options after the script into globals
   -S SCRIPT             Run SCRIPT using PATH environment variable to find it
   -v                    Display the version and set $VERBOSE to true
   -w                    Enable warnings
   -W [level]            Set warning level: 0=silence, 1=medium, 2=verbose (default)
   --version             Display the version

Rubinius subcommands

    Rubinius provides subcommands that implement various facilities. Each
    subcommand provides its own help. For example:

      rbx compile -h

    Available subcommands:

      compile       Run the bytecode compiler
      console       Run the Agent CLI
      docs          Run a local HTTP documentation server
      gem           Run RubyGems 'gem' command                                                                                                                                                            
      report        Create a gist of the last Rubinius toplevel exception                                                                                                                                 
                                                                                                                                                                                                          
VM Options                                                                                                                                                                                                
   -X[=]                                                                                                                                                                                 
     This option is recognized by the VM before any ruby code is loaded.                                                                                                                                  
     It is used to set VM configuration options.                                                                                                                                                          
                                                                                                                                                                                                          
     Use -Xconfig.print to see the list of options the VM recognizes.                                                                                                                                     
     All variables, even ones that the VM doesn't understand, are available
     in Rubinius::Config.

     A number of Rubinius features are driven by setting these variables.

[diego@(none) ~]$ 
@brixen
Member
brixen commented May 12, 2012

Looks like zlib is broken on your system. You can try building with the vendored zlib instead. See configure options. The FTP errors seem like a problem with your system.

As for rdoc, what does 'file rubinius/bin/rdoc' say?
What is the output of 'rbx -S rdoc --help'?

@diegoviola
[diego@(none) ~]$ file rubinius/bin/rdoc 
rubinius/bin/rdoc: symbolic link to `rbx'
[diego@(none) ~]$ 
[diego@(none) bin]$ ./rbx -S rdoc --help
An exception occurred running /usr/bin/rdoc
    no such file to load -- rdoc/rdoc (LoadError)

Backtrace:
            Rubinius::CodeLoader#load_error at kernel/common/codeloader.rb:385
  Rubinius::CodeLoader#resolve_require_path at kernel/common/codeloader.rb:372
        { } in Rubinius::CodeLoader#require at kernel/common/codeloader.rb:104
                       Rubinius.synchronize at kernel/bootstrap/rubinius.rb:135
               Rubinius::CodeLoader#require at kernel/common/codeloader.rb:103
               Rubinius::CodeLoader.require at kernel/common/codeloader.rb:201
                     Kernel(Object)#require at kernel/common/kernel.rb:631
                          Object#__script__ at /usr/bin/rdoc:16
           Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67
           Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:109
                    Rubinius::Loader#script at kernel/loader.rb:628
                      Rubinius::Loader#main at kernel/loader.rb:832
[diego@(none) bin]$ 
@diegoviola

I've built rubinius from the latest git master with: --with-vendor-zlib. Here is the log: https://gist.github.com/2686111

So with rbx compiled with --with-vendor-zlib I still get the same thing:

[diego@(none) bin]$ pwd
/home/diego/rubinius/bin
[diego@(none) bin]$ file rdoc 
rdoc: symbolic link to `rbx'
[diego@(none) bin]$ 
[diego@(none) bin]$ ./rbx -S rdoc --help
An exception occurred running /usr/bin/rdoc
    no such file to load -- rdoc/rdoc (LoadError)

Backtrace:
            Rubinius::CodeLoader#load_error at kernel/common/codeloader.rb:385
  Rubinius::CodeLoader#resolve_require_path at kernel/common/codeloader.rb:372
        { } in Rubinius::CodeLoader#require at kernel/common/codeloader.rb:104
                       Rubinius.synchronize at kernel/bootstrap/rubinius.rb:135
               Rubinius::CodeLoader#require at kernel/common/codeloader.rb:103
               Rubinius::CodeLoader.require at kernel/common/codeloader.rb:201
                     Kernel(Object)#require at kernel/common/kernel.rb:631
                          Object#__script__ at /usr/bin/rdoc:16
           Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67
           Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:109
                    Rubinius::Loader#script at kernel/loader.rb:628
                      Rubinius::Loader#main at kernel/loader.rb:832
[diego@(none) bin]$ 
@brixen
Member
brixen commented May 13, 2012

Building with the vendored zlib fixed the zlib rubyspec failures.

The FTP spec failures may be related to your hosts file. Do you have modifications there? Do the specs fail if you run them with MRI? You'll need to investigate that.

rbx -S rdoc is finding /usr/bin/rdoc on PATH instead of the builtin rdoc wrapper. What does your config.rb file have?

I have none of these issues building rbx and running it from the clone dir on an up-to-date archlinux vbox machine.

@diegoviola

@brixen what config.rb are you referring to exactly?

my /etc/hosts is pretty basic and I haven't added anything else there:

[diego@(none) ~]$ cat /etc/hosts 
#
# /etc/hosts: static lookup table for host names
#

#      
127.0.0.1       localhost.localdomain   localhost
::1             localhost.localdomain   localhost

# End of file
[diego@(none) ~]$ 
@brixen
Member
brixen commented May 17, 2012

When you run configure, the results are written to config.rb file in the root of the clone directory.

@diegoviola

How do I run the FTP specs with MRI?

@brixen
Member
brixen commented May 17, 2012

Either ensure that 'ruby' on PATH is MRI and run 'bin/mspec -tr /path/to/specs' or run 'bin/mspec -t /full/path/to/mri /path/to/specs'.

@brixen
Member
brixen commented May 17, 2012

I don't see anything in config.rb that would explain why bin/rdoc is behaving that way for you. I cannot repro it here. Unless you can give me access to your system, I'm not sure I can help.

@diegoviola

I did this after a "git reset HEAD --hard" and "git clean -dfx"

https://raw.github.com/gist/2721546/617674efdbefe8eb97b6b211606f141ccf4f4b9e/gistfile1.txt

@diegoviola

https://gist.github.com/2721596

What did I do wrong here?

@brixen
Member
brixen commented May 17, 2012

I said '-tr' or -'t /full/path/to/MRI'

@brixen
Member
brixen commented May 17, 2012

/home/diego/rubinius/mspec/spec/ is mspec's specs, not rubyspec. spec/ruby/...

@mpapis mpapis added a commit to mpapis/rubinius that referenced this issue May 30, 2012
@mpapis mpapis reset GEM_HOME & GEM_PATH to not install gems in currently used RVM r…
…uby, update #1712, update bed9da6
fd7021e
@mpapis mpapis added a commit to mpapis/rubinius that referenced this issue May 30, 2012
@mpapis mpapis reset GEM_HOME & GEM_PATH to not install gems in currently used RVM r…
…uby, update #1712, update bed9da6
fc7ad0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment