My First Time

T

Travis Tslib

I have Perl and PHP experience. I love the idea of true OO and wanted
to give Ruby a try. I expect gem to work like cpan and pear.

I want to use a very simple API to get data and dump into a local
database. I have Windows XP SP 3. I installed Ruby 1.9.2 and Eclipse
and the DLT for Ruby (I've also installed MySQL, but I haven't gotten
that far, yet).

There are three different gems out there that I could use. I'm trying
'reve'. It required 'hpricot'.

That too two hours just to get 'gem install hpricot' to work. I finally
got some sort of Ruby DevKit installed, and hpricot installed and so did
reve, without error.

Now, when I try


require 'reve'
api = Reve::API.new('my_userid','my_apikey')
api.characters.each do |character|
puts character.name
end


I get



C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/lib/reve.rb:136:in
`read': No such file or directory -
C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/lib/../VERSION
(Errno::ENOENT)
from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/lib/reve.rb:136:in
`initialize'
from C:/Documents and Settings/Travis/workspace/ODNDT Transaction
Farmer/test1.rb:5:in `new'
from C:/Documents and Settings/Travis/workspace/ODNDT Transaction
Farmer/test1.rb:5:in `<main>'



Clearly, I've done something wrong in installing this gem.

Like I said, I'm completely new to Ruby. Yes, there is probably
something I could read somewhere, but I haven't found it today. I
understand that I'm crashing into Ruby, but... I don't want to do 'hello
world'.
 
R

Ryan Davis

[Note: parts of this message were removed to make it a legal post.]



require 'reve'
api = Reve::API.new('my_userid','my_apikey')
api.characters.each do |character|
puts character.name
end

require "rubygems"

Before reve and it should load.
 
B

Brian Candler

Travis Tslib wrote in post #954723:
require 'reve'
api = Reve::API.new('my_userid','my_apikey')
api.characters.each do |character|
puts character.name
end

I get

C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/lib/reve.rb:136:in
`read': No such file or directory -
C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/lib/../VERSION
(Errno::ENOENT)
from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/lib/reve.rb:136:in
`initialize' ...

Clearly, I've done something wrong in installing this gem.

I think it's a problem with the gem itself. It's looking for a file
C:/Ruby192/lib/ruby/gems/1.9.1/gems/reve-0.0.131/VERSION and can't find
it.

Some gems are not compatible with ruby 1.9.x, and some are not
compatible with Windows.

http://www.crudvision.com/reve-ruby-eve-online-api-library/ was last
updated July 2007, although the ChangeLog in SVN has an entry from
2008-01-13. So maybe it falls into the "needs modification to work with
1.9" camp.

If you're "crashing into Ruby", this is as good a place to start as any
:)

Start at reve.rb line 136, work out what it's doing, fix it. Maybe for
now just create the VERSION file that it's looking for.

Having said that, looking in Subversion I don't see any attempt to open
VERSION, so maybe this has been fixed already, and you just need to
build a more up-to-date gem (or install directly from SVN).
http://svn.crudvision.com/reve/trunk/lib/reve.rb

But also, maybe the repo has moved - that one shows revision r117, but
your gem claims to be r131. Maybe it's somebody else' fork.
 
T

Travis Tslib

Wow, thank you guys for the support. As I said, I'm used to Perl, so
I'm used to... less than warm responses.

I did dig around in the reve.rb. But fixing that line, just uncovered
another problem and another. I decided to try one of the other two
packages. I was able to get eve-api to work with only two edits to the
code.

I just thought I was installing them wrong or something.
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

Travis Tslib wrote in post #954723:
http://www.crudvision.com/reve-ruby-eve-online-api-library/ was last
updated July 2007, although the ChangeLog in SVN has an entry from
2008-01-13. So maybe it falls into the "needs modification to work with
1.9" camp.
The one on github (http://github.com/lisa/reve the one linked to by
rubygems) was updated on the third, and has a 1300 line test file. It looks
like she added the version thing to the code on August 22
http://github.com/lisa/reve/commit/1254c3ce2f20ee17126b7ddbca2381dcc0d1cfe1

For whatever reason it doesn't download the VERSION file with the gem
install command. I don't know why, it looks like it is in what I assume is
the manifest (I've never successfully made a gem, so not experienced enough
to say)
http://github.com/lisa/reve/blob/f538128ef5cc5b4e8ef576ea3e97ee13dcdc63e0/Rakefile#L29
http://github.com/lisa/reve/blob/f538128ef5cc5b4e8ef576ea3e97ee13dcdc63e0/reve.gemspec#L20

If the eve gem doesn't work out, reve might be worth another look. Might
even be able to bug them to help you :) She would probably enjoy that
someone is interested in their work more than be annoyed that they have to
explain it.

Anyway, I don't think she is on 1.9.2, because there are a few places she
uses relative paths, but I ran the test file (
http://github.com/lisa/reve/blob/master/test/test_reve.rb), and they all
basically passed.
 
J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

For whatever reason it doesn't download the VERSION file with the gem
install command. I don't know why, it looks like it is in what I assume is
the manifest (I've never successfully made a gem, so not experienced enough
to say)

http://github.com/lisa/reve/blob/f538128ef5cc5b4e8ef576ea3e97ee13dcdc63e0/Rakefile#L29

http://github.com/lisa/reve/blob/f538128ef5cc5b4e8ef576ea3e97ee13dcdc63e0/reve.gemspec#L20
I let her know that the VERSION file wasn't getting into the gem, and she
fixed it and pushed up version 0.0.132
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top