I’m on Ubuntu 6.06 LTS and I have the Blinkenlightsgem installed, I used
sudo gem install blinkenlights and can list my local gems and see it.
So why do I get this error?
I’m a bit mystified and don’t have a Ubuntu box, but I’ll ask some
clarifying questions anyway. What versions of Ruby, Rubygems and
BlinkenLights are you running?
ruby --version
gem --version
gem list | grep blinken
I’m on Ubuntu 6.06 LTS and I have the Blinkenlightsgem installed, I used
sudo gem install blinkenlights and can list my local gems and see it.
So why do I get this error?
My guess is the class is named “Blinkenlights”, not “BlinkenLights”.
I’ve checked this out in the blinkenlights documentation.
Interestingly I’ve tried this usign IRB on a Windows machine and can run
the functionality, however if I try the same script executed from file,
I get the uninitialized constant error.
I’ll check my versions at home, but believe it to be Ruby 1.8 with
latest gem and blinkelights (installed them 2 days ago)
Interestingly I’ve tried this usign IRB on a Windows machine and can run
the functionality, however if I try the same script executed from file,
I get the uninitialized constant error.
Possibly there are two or more different versions of Ruby on your
machine,
and each is activated in different circumstances. Or the IRB invocation
differs in some subtle way from that in the source file.
I’ve just checked this out:
Ruby 1.8.4
Gem 0.9.0
Blinkenlights 0.0.4
I’ve made sure that my system is consistent with only 1.8.x versions of
Ruby and libraries, so this one confuses me.
Interestingly I’ve tried this usign IRB on a Windows machine and can run
the functionality, however if I try the same script executed from file,
I get the uninitialized constant error.
Possibly there are two or more different versions of Ruby on your
machine,
and each is activated in different circumstances. Or the IRB invocation
differs in some subtle way from that in the source file.
irb(main):001:0> require ‘blinkenlights’
LoadError: no such file to load – blinkenlights
from (irb):1:in `require’
from (irb):1
So why would gem report that the gem is there, but IRB not think it
installed?
You’ll need to require ‘rubygems’ first. (The Windows One-Click
Installer sets the environment variable RUBYOPT=rubygems so that
rubygems is automatically required when Ruby is run.)
FWIW, I’m using the same versions as you on my Windows box, and the
script works for me.
Cheers,
Dave
Thanks- my home box is Ubuntu though and that is principally where I
want to run this…
Interestingly I’ve tried this usign IRB on a Windows machine and can run
the functionality, however if I try the same script executed from file,
I get the uninitialized constant error.
Possibly there are two or more different versions of Ruby on your
machine,
and each is activated in different circumstances. Or the IRB invocation
differs in some subtle way from that in the source file.
I’ve just checked this out:
Ruby 1.8.4
Gem 0.9.0
Blinkenlights 0.0.4
I’ve made sure that my system is consistent with only 1.8.x versions of
Ruby and libraries, so this one confuses me.
Aha! More interesting stuff-
trying this out again on my Ubuntu box
it echos out the version if I do gem list | grep blinken
and if I list my local gems, I can see it in there,
however
going in through IRB and trying what I could do with the Windows box I
find:
irb(main):001:0> require ‘blinkenlights’
LoadError: no such file to load – blinkenlights
from (irb):1:in `require’
from (irb):1
So why would gem report that the gem is there, but IRB not think it
installed?
irb(main):001:0> require ‘blinkenlights’
LoadError: no such file to load – blinkenlights
from (irb):1:in `require’
from (irb):1
So why would gem report that the gem is there, but IRB not think it
installed?
You’ll need to require ‘rubygems’ first. (The Windows One-Click
Installer sets the environment variable RUBYOPT=rubygems so that
rubygems is automatically required when Ruby is run.)
FWIW, I’m using the same versions as you on my Windows box, and the
script works for me.
Then you’re are trying to ‘require’ your own script.
-Thomas
Tried renaming it also, with no success. It still compains that
BlinkenLights is and unitialised constant. This seems strange as I’ve
read through the source for the gem and the test examples, as well as
the rubyforge documentation and this does appear to be the method of
calling it…
Tried renaming it also, with no success. It still compains that
BlinkenLights is and unitialised constant. This seems strange as I’ve
read through the source for the gem and the test examples, as well as
the rubyforge documentation and this does appear to be the method of
calling it…
Tried renaming it also, with no success. It still compains that
BlinkenLights is and unitialised constant. This seems strange as I’ve
read through the source for the gem and the test examples, as well as
the rubyforge documentation and this does appear to be the method of
calling it…
Try:
RUBYOPT=-rauto_gem ruby yourfile.rb
Regards,
Jordan
Thanks- is this a system wide environment variable or should I just add
this to the top of the script?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.