# RubyGems 0.9.5 ignoring spec.bindir

**URL:** <https://rubytalk.org/t/rubygems-0-9-5-ignoring-spec-bindir/42883>\
**Category:** ruby-talk\
**Created:** [10 December 2007 03:03 UTC](https://rubytalk.org/t/rubygems-0-9-5-ignoring-spec-bindir/42883 "2007-12-10T03:03:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suraj\_Kurapati1](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Suraj\_Kurapati1](https://rubytalk.org/u/Suraj_Kurapati1)\
**Post date:** [10 December 2007 03:03 UTC](https://rubytalk.org/t/rubygems-0-9-5-ignoring-spec-bindir/42883/1 "2007-12-10T03:03:27Z")

</div>

Hello,

I want to make a gem for a small (\< 200 lines) project of mine. The  
entire project is stored in one Ruby source file, so I don't want to  
create a separate "bin/" directory. I read about RubyGems' bindir  
parameter which allows you to override the "bin/" directory requirement  
and basically put your executable anywhere inside your project  
directory.

The problem is that RubyGems 0.9.5 is ignoring my

&nbsp;&nbsp;spec.bindir = '.'

assignment and looking for a "bin/" directory instead.

I tried using

&nbsp;&nbsp;spec.bindir = nil

but that does not work either.

> **···**
>
> ---
> 
> Here is a complete example to reproduce the problem:
> 
> $ ls -l  
> -rw-r--r-- 1 sun sun 371 2007-12-09 18:53 Rakefile  
> -rwxr-xr-x 1 sun sun 39 2007-12-09 18:53 foobar\*
> 
> $ ./foobar  
> hello world
> 
> $ cat foobar  
> #!/usr/bin/env ruby  
> puts "hello world"
> 
> $ cat Rakefile  
> require 'rake/gempackagetask'
> 
> spec = Gem::Specification.new do |s|  
> &nbsp;&nbsp;[s.name](http://s.name) = 'foobar'  
> &nbsp;&nbsp;s.version = '0'  
> &nbsp;&nbsp;s.summary = 'summary'  
> &nbsp;&nbsp;s.files = 'foobar'  
> &nbsp;&nbsp;s.executables = 'foobar'  
> &nbsp;&nbsp;s.bindir = '.' # our executable is not inside 'bin/'  
> end
> 
> # does nothing unless block given, dunno why...  
> Rake::GemPackageTask.new(spec) do end
> 
> $ rake -T  
> (in /home/sun/lab/gemspec)  
> rake clobber\_package # Remove package products  
> rake gem # Build the gem file foobar-0.gem  
> rake package # Build all the packages  
> rake repackage # Force a rebuild of the package files
> 
> $ rake gem  
> (in /home/sun/lab/gemspec)  
> &nbsp;&nbsp;Successfully built RubyGem  
> &nbsp;&nbsp;Name: foobar  
> &nbsp;&nbsp;Version: 0  
> &nbsp;&nbsp;File: foobar-0.gem
> 
> $ gem install pkg/foobar-0.gem -i my\_out\_dir  
> ERROR: While executing gem ... (Errno::ENOENT)  
> &nbsp;&nbsp;&nbsp;&nbsp;No such file or directory -  
> /home/sun/lab/gemspec/my\_out\_dir/gems/foobar-0/bin/foobar
> 
> See this error? Why is it looking for a "bin/" directory when I  
> assigned spec.bindir?!
> 
> Thanks for your consideration.  
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Suraj\_Kurapati1](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Suraj\_Kurapati1](https://rubytalk.org/u/Suraj_Kurapati1)\
**Post date:** [10 December 2007 18:54 UTC](https://rubytalk.org/t/rubygems-0-9-5-ignoring-spec-bindir/42883/2 "2007-12-10T18:54:02Z")

</div>

Suraj Kurapati wrote:

> The problem is that RubyGems 0.9.5 is ignoring my
> 
> &nbsp;&nbsp;spec.bindir = '.'
> 
> assignment and looking for a "bin/" directory instead.

I filed a bug report about this on the RubyGems bug tracker:  
[http://rubyforge.org/tracker/index.php?func=detail&aid=16202&group\_id=126&atid=575](http://rubyforge.org/tracker/index.php?func=detail&aid=16202&group_id=126&atid=575)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
