mcolyer / smartermeter

A ruby library to access PG&E SmartMeter data
http://matt.colyer.name/projects/smartermeter/
MIT License
48 stars 15 forks source link

can't install smartermeter ruby gem #18

Closed tels7ar closed 11 years ago

tels7ar commented 12 years ago

I get the same failure on both mac os 10.6 and on linux (Debian Squeeze):

$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
$ uname -a
Linux 2.6.32-5-amd64 #1 SMP Wed Jan 12 03:40:32 UTC 2011 x86_64 GNU/Linux
$ sudo gem install smartermeter
ERROR:  While executing gem ... (NoMethodError)
  undefined method `call' for nil:NilClass

is there something obvious I'm missing? Is the problem the version of ruby I'm using? I note that on the mac I'm using ruby-1.8.7 too, via macports:

$ ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [i686-darwin10]

I will try to get ruby-19 installed on one or the other of these systems and report back if that fixes things.

tels7ar commented 12 years ago

Ok I got ruby-19 installed from macports and that fixed things on the mac (after I followed the nokogiri install howto). I now have 1.9.3 on my mac:

$ ruby1.9 -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10]

However on the debian box I'm still stumped. I got ruby-1.9.1 installed but I'm still getting that nil:NilClass error. I ran gem install smartermeter --debug and got this:

Installing gem smartermeter-0.4.1
Exception `NoMethodError' at /usr/lib/ruby/1.9.1/rubygems/package/tar_input.rb:49 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x0000000369bee8>
Exception `IOError' at /usr/lib/ruby/1.9.1/rubygems/format.rb:50 - closed stream
Exception `Errno::EEXIST' at /usr/lib/ruby/1.9.1/fileutils.rb:243 - File exists - /var/lib/gems/1.9.1
Exception `NoMethodError' at /usr/lib/ruby/1.9.1/rubygems/requirement.rb:134 - undefined method `call' for nil:NilClass
ERROR:  While executing gem ... (NoMethodError)
    undefined method `call' for nil:NilClass
        /usr/lib/ruby/1.9.1/rubygems/requirement.rb:134:in `block in satisfied_by?'
        /usr/lib/ruby/1.9.1/rubygems/requirement.rb:134:in `each'
        /usr/lib/ruby/1.9.1/rubygems/requirement.rb:134:in `all?'
        /usr/lib/ruby/1.9.1/rubygems/requirement.rb:134:in `satisfied_by?'
        /usr/lib/ruby/1.9.1/rubygems/source_index.rb:325:in `block in search'
        /usr/lib/ruby/1.9.1/rubygems/source_index.rb:323:in `select'
        /usr/lib/ruby/1.9.1/rubygems/source_index.rb:323:in `search'
        /usr/lib/ruby/1.9.1/rubygems/source_index.rb:280:in `find_name'
        /usr/lib/ruby/1.9.1/rubygems/installer.rb:243:in `installation_satisfies_dependency?'
        /usr/lib/ruby/1.9.1/rubygems/installer.rb:232:in `ensure_dependency'
        /usr/lib/ruby/1.9.1/rubygems/installer.rb:181:in `block in install'
        /usr/lib/ruby/1.9.1/rubygems/installer.rb:180:in `each'
        /usr/lib/ruby/1.9.1/rubygems/installer.rb:180:in `install'
        /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:277:in `block in install'
        /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:247:in `each'
        /usr/lib/ruby/1.9.1/rubygems/dependency_installer.rb:247:in `install'
        /usr/lib/ruby/1.9.1/rubygems/commands/install_command.rb:119:in `block in execute'
        /usr/lib/ruby/1.9.1/rubygems/commands/install_command.rb:116:in `each'
        /usr/lib/ruby/1.9.1/rubygems/commands/install_command.rb:116:in `execute'
        /usr/lib/ruby/1.9.1/rubygems/command.rb:270:in `invoke'
        /usr/lib/ruby/1.9.1/rubygems/command_manager.rb:134:in `process_args'
        /usr/lib/ruby/1.9.1/rubygems/command_manager.rb:104:in `run'
        /usr/lib/ruby/1.9.1/rubygems/gem_runner.rb:58:in `run'
        /usr/bin/gem1.9.1:21:in `<main>'

So what am I missing now? Do you actually need something newer than the 1.9.1 I've got on debian?

mcolyer commented 12 years ago

Can you do gem -v on all of the boxes that don't work? I think it should work with 1.8.7 as well as 1.9.x however I think since I used a newer rubygems version when I packaged it, that it's causing issues.

I just tried grabbing 1.8.7-p357 and it came with rubygems 1.6.2 and it seems to have installed correctly.

Also you might try rvm, if you are having different versions of ruby/rubygems installed.

tels7ar commented 12 years ago

I suspect my problem may actually be related to using the default system rubygems-1.3.7.

mcolyer commented 11 years ago

Closing this out as I've update a few things since then and others have reported success.