BLOG     |     FORUM
Welcome, Guest
Username: Password: Remember me
All your questions answered real quick by Unleash Networks Engineers.
  • Page:
  • 1

TOPIC: anastm.rb fails with require_gem is obsolete. Use

anastm.rb fails with require_gem is obsolete. Use 16 years 10 months ago #142

C:\scripts\ruby\unsniff>anastm \"desktop trace.usnf\" 32 In
C:0:Warning: require_gem is obsolete. Use gem instead.
C:/scripts/ruby/unsniff/anastm.rb:19: uninitialized constant Fox (NameError)


So I changed \"require rubygems\" to \"require gem\" and this is the error now.


C:\scripts\ruby\unsniff>anastm \"desktop trace.usnf\" 32 In
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_re
quire': no such file to load -- gem (LoadError)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
from C:/scripts/ruby/unsniff/anastm.rb:17


does anyone have any ideas?
The administrator has disabled public write access.

Re:anastm.rb fails with require_gem is obsolete. Use 16 years 10 months ago #143

  • tvinceruby
  • tvinceruby's Avatar
So I changed \"require rubygems\" to \"require gem\" and this is the error now.

That was only a warning, Ruby 1.8 replaced the keyword require_gem with just gem.

You have changed the wrong line in order to fix the warning.

Change the line which says \"require_gem 'fxruby'\" to \"gem 'fxruby'.

The new lines should look like :

[code:1]
...
require 'rubygems'
require 'win32ole'
gem 'fxruby'
include Fox
require 'UnleashCharts'
include UnleashCharts
...
[/code:1]
The administrator has disabled public write access.

Re:anastm.rb fails with require_gem is obsolete. Use 16 years 2 months ago #166

After making the changes to anastm.rb I still get the following error:

uninitialized constant Fox (NameError)

Any ideas?
The administrator has disabled public write access.

Re:anastm.rb fails with require_gem is obsolete. Use 16 years 2 months ago #167

I figured it out. I needed to add

include 'fox16'


so ths is that it all looks like

require 'rubygems'
require 'win32ole'
gem 'fxruby'
require 'fox16'
include Fox
require 'UnleashCharts'
include UnleashCharts
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: vivek [unleash]
Time to create page: 0.038 seconds