[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Binary not executing using RubyGems

Trans

4/17/2005 2:02:00 PM

I created a Ruby Gem for one of my projects. I managed to get
everything working okay (it wasn't as easy as I would have liked), but
I have a binary executable in the package and it fails to work after
installation of the gem. These are probably the most relevant sections
of the gemspec:

autorequire: reap/reap
default_executable: reap
bindir: bin
executables:
- reap

The file 'bin/reap' is included in the files list.

When I actualy type 'reap' on the commandline it simple does nothing.
No error, no nothing.

Any suggestions?

Thanks,
T.

3 Answers

Chad Fowler

4/17/2005 3:27:00 PM

0

On 4/17/05, Trans <transfire@gmail.com> wrote:
> I created a Ruby Gem for one of my projects. I managed to get
> everything working okay (it wasn't as easy as I would have liked),

What was difficult about it?

>
> autorequire: reap/reap
> default_executable: reap
> bindir: bin
> executables:
> - reap
>
> The file 'bin/reap' is included in the files list.
>
> When I actualy type 'reap' on the commandline it simple does nothing.
> No error, no nothing.
>
> Any suggestions?

The script wrappers don't work with "if __FILE__ == $0" blocks,
because they use "load" to execute the script. Since you're probably
not ever going to use 'require "bin/reap"', you could take the if
condition out and it would work.

--

Chad Fowler
http://chad...
http://rubyc...
http://ruby...
http://rubygems.rub... (over 100,000 gems served!)



Trans

4/17/2005 4:02:00 PM

0

Hi Chad--

Chad Fowler wrote:
> On 4/17/05, Trans <transfire@gmail.com> wrote:
> > I created a Ruby Gem for one of my projects. I managed to get
> > everything working okay (it wasn't as easy as I would have liked),
>
> What was difficult about it?

Primarily it's still setting up the whole RUBYOPT thing. Not that its
hard per se, just that one has to do it. But also I had to 'gem install
rubygems-update' even though I had installed a very recent verion of
RubyGems. I assume the whole RUBYOPT thing (vs. stubs) arises from
versioning. I'm surprised that there is no other way to do this.

> >
> > autorequire: reap/reap
> > default_executable: reap
> > bindir: bin
> > executables:
> > - reap
> >
> > The file 'bin/reap' is included in the files list.
> >
> > When I actualy type 'reap' on the commandline it simple does
nothing.
> > No error, no nothing.
> >
> > Any suggestions?
>
> The script wrappers don't work with "if __FILE__ == $0" blocks,
> because they use "load" to execute the script. Since you're probably
> not ever going to use 'require "bin/reap"', you could take the if
> condition out and it would work.

Ah, That'll do it. Thanks.

T.

Jim Freeze

4/17/2005 11:42:00 PM

0

* Chad Fowler <chadfowler@gmail.com> [2005-04-18 00:26:54 +0900]:

> The script wrappers don't work with "if __FILE__ == $0" blocks,
> because they use "load" to execute the script. Since you're probably
> not ever going to use 'require "bin/reap"', you could take the if
> condition out and it would work.

The $0 == __FILE__ is good for facilitating system testing.
Is there a constant that gems can set so that we can do
system testing and have versioning? Something like:

if $0 == __FILE__ || RUBYGEMS
run code
end

--
Jim Freeze
Code Red. Code Ruby