# Add binary to gem spec?

**URL:** <https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915>\
**Category:** Ruby\
**Created:** [November 21, 2007, 7:16pm UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915 "2007-11-21T19:16:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 21, 2007, 7:16pm UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915/1 "2007-11-21T19:16:21Z")

</div>

Hi all - I want to add a Ruby script to a gem, so that users of the  
gem get not just the gem itself but also a script in /opt/local/bin  
that they can run which packages up some of the functionality on the  
command line. Very much like s3sh in the Amazon S3 gem (gem install  
aws-s3).

Any pointers to relevant docs? Couldn’t find it in the Pickaxe.

–  
Giles B.

Podcast: [http://hollywoodgrit.blogspot.com](http://hollywoodgrit.blogspot.com)  
Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 21, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915/2 "2007-11-21T19:56:21Z")

</div>

On Nov 21, 3:15 pm, Giles B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all - I want to add a Ruby script to a gem, so that users of the  
> gem get not just the gem itself but also a script in /opt/local/bin  
> that they can run which packages up some of the functionality on the  
> command line. Very much like s3sh in the Amazon S3 gem (gem install  
> aws-s3).
> 
> Any pointers to relevant docs? Couldn’t find it in the Pickaxe.

[http://docs.rubygems.org/read/chapter/20#executables](http://docs.rubygems.org/read/chapter/20#executables)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 22, 2007, 12:26am UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915/3 "2007-11-22T00:26:57Z")

</div>

> > Any pointers to relevant docs? Couldn’t find it in the Pickaxe.
> 
> [http://docs.rubygems.org/read/chapter/20#executables](http://docs.rubygems.org/read/chapter/20#executables)

Awesome! Thank you.

–  
Giles B.

Podcast: [http://hollywoodgrit.blogspot.com](http://hollywoodgrit.blogspot.com)  
Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 22, 2007, 1:10pm UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915/4 "2007-11-22T13:10:56Z")

</div>

On Nov 22, 1:06 am, Jeremy McAnally [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why not just use something like newgem or hoe to build your gem that  
> will handle this sort of stuff for you?

Because at the end of the day, you outsource all the core of getting  
things working to external tools.

What happen if they are broken? How can you get the picture and maybe  
provide a patch to fix the “misbehaving” function?

Having the understanding to do it helps more than letting “magic  
happens” for you all the time.

## – Luis L. Multimedia systems

Leaders are made, they are not born. They are made by hard effort,  
which is the price which all of us must pay to achieve any goal that  
is worthwhile.  
Vince Lombardi

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 22, 2007, 7:08pm UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915/5 "2007-11-22T19:08:19Z")

</div>

> happens" for you all the time.  
> I agree with that, but I used Hoe to generate the file structure. I  
> think I got to a point where Hoe stopped being obvious, and then I  
> thought, well, if I have to learn something, it’s probably faster to  
> learn Gems.

–  
Giles B.

Podcast: [http://hollywoodgrit.blogspot.com](http://hollywoodgrit.blogspot.com)  
Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 22, 2007, 5:07am UTC](https://www.ruby-forum.com/t/add-binary-to-gem-spec/120915/6 "2007-11-22T05:07:32Z")

</div>

Why not just use something like newgem or hoe to build your gem that  
will handle this sort of stuff for you?

–Jeremy

On Nov 21, 2007 1:15 PM, Giles B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Podcast: [http://hollywoodgrit.blogspot.com](http://hollywoodgrit.blogspot.com)  
> Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> Tumblelog: [http://giles.tumblr.com](http://giles.tumblr.com)

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My books:  
Ruby in Practice

> **[Ruby in Practice](https://www.manning.com/books/ruby-in-practice)**
>
> Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale environments. A cookbook-style reference, it gives you concrete examples of systems...

My free Ruby e-book

> **[Site not found · DreamHost](http://www.humblelittlerubybook.com/)**
>
> The owner of this domain has not yet uploaded their website.

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)
