I have installed the latest version of rubygems as root on an old Sun UltraSparc 2 running Solaris 8. I have successfully installed the latest progressbar gem as root. I have tried to implement a simple test of progressbar in the following script:

#!/usr/local/bin/ruby

require 'progressbar'

$:.each {|a|
puts a
}

bar = ProgressBar.new("Example progress", 50)
total = 0
until total >= 50
...sleep(rand(2)/2.0)
...increment = rand(6) + 3)
...bar.inc(increment)
...total += increment
end

Of course, I do not have leading periods in my script, but when I previewed this message it failed to indent those four lines, so I tried this as an aid to clarity.

I have tried preceding the existing require line with require 'rubygems'. I have tried removing the #!/usr/local/bin/ruby and running ruby -rubygems progressbar. I have tried, as a c shell user, setenv RUBYOPT rubygems. In every case I get the identical response:

/usr/local/lib/ruby/site_ruby/1.8
/usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.8
/usr/local/lib/ruby/site_ruby
/usr/local/lib/ruby/1.8
/usr/local/ruby/1.8/sparc-solaris2.8
.
./progressbar.rb:9: unitialized constant ProgressBar (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
from /home/ga155700/ruby/progressbar.rb:4

I added the $: block in an attempt to trace my paths, but this shed no light, at least for me. Can someone explain what i am doing wrong?

Thanks in advance - GGB