Forum: Ruby inochi newbie question - error running WordCount example on windows

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pablo Q. (Guest)
on 2009-03-06 19:01
(Received via mailing list)
Hi folks,

I tried to run the example of WordCout but I got the following problem:

E:\projects\word_count>rake test --trace
(in E:/projects/word_count)
** Invoke test (first_time)
** Execute test
c:/ruby/bin/ruby -w -I. -Ilib -r word_count -e
        # dump language phrases *after* exercising all code (and
        # thereby populating the phrases cache) in the project
        at_exit do
          if ENV['dump_lang_phrases'] == '1'
            file = "lang/phrases.yaml"
            list = WordCount::PHRASES.phrases
            data = list.map {|s| s + ':' }.join("\n")

            File.write file, data

            puts "Extracted #{list.length} language phrases into
#{file.inspect}
"
          end
        end

        # set title of test suite
        $0 = File.basename(Dir.pwd)

        require 'minitest/unit'
        require 'minitest/spec'
        require 'minitest/mock'
        MiniTest::Unit.autorun

        Dir['test/**/*.rb'].sort.each do |test|
          unit = test.sub('test/', 'lib/')

          if File.exist? unit
            # strip file extension because require()
            # does not normalize its input and it
            # will think that the two paths (with &
            # without file extension) are different
            unit_path = unit.sub(/\.rb$/, '').sub('lib/', '')
            test_path = test.sub(/\.rb$/, '')

            require unit_path
            require test_path
          else
            warn "Skipped test #{test.inspect} because it lacks a
corresponding
#{unit.inspect} unit."
          end
        end

c:/ruby/lib/ruby/1.8/pathname.rb:709:in `relative_path_from': different
prefix:
"c:/" and "E:/projects/word_count" (ArgumentError)
        from
c:/ruby/lib/ruby/gems/1.8/gems/minitest-1.3.1/lib/minitest/unit.rb:
17
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`ge
m_original_require'
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`re
quire'
        from -e:19
rake aborted!
Command failed with status (1): [c:/ruby/bin/ruby -w -I. -Ilib -r
word_coun...]
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:969:in `sh'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:982:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:982:in `sh'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1070:in `sh'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1003:in `ruby'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1070:in `ruby'
c:/ruby/lib/ruby/gems/1.8/gems/inochi-0.3.0/lib/inochi/rake.rb:191:in
`rake'

c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in
`invoke_with_call_c
hain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in
`invoke_with_call_c
hain'


It seems that is a rake problem with 'sh'..... Am I right? does anyone
have
gotten the same error? (and has solved it?)

thanks
Suraj K. (Guest)
on 2009-05-08 02:11
Hi,

Pablo Q. wrote:
> E:\projects\word_count>rake test --trace
> (in E:/projects/word_count)
> [...]
> c:/ruby/lib/ruby/1.8/pathname.rb:709:in `relative_path_from': different
> prefix:

This problem has been solved in a newer release:

U:\>inochi -v
project: Inochi
version: 1.0.0
release: 2009-05-03
website: http://snk.tuxfamily.org/lib/inochi
install: c:/Program Files/Ruby/lib/ruby/gems/1.8/gems/inochi-1.0.0

U:\>inochi WordCount
  create  word_count/CREDITS
  create  word_count/LICENSE
  create  word_count/rakefile
  create  word_count/bin/word_count
  create  word_count/lib/word_count.rb
  create  word_count/test/word_count.rb
  create  word_count/doc/index.erb
  create  word_count/doc/intro.erb
  create  word_count/doc/setup.erb
  create  word_count/doc/theory.erb
  create  word_count/doc/usage.erb
  create  word_count/doc/history.erb

U:\>cd word_count

U:\word_count>rake test
(in U:/word_count)
#<Gem::LoadError: Could not find RubyGem spicycode-rcov (>= 0)
>
#<Gem::LoadError: Could not find RubyGem voloko-sdoc (>= 0.2.10)
>
ruby -w c:/temp/4732.4732.0
Inochi establishment tests passed!
This topic is locked and can not be replied to.