<br><br><div class="gmail_quote">On 18 August 2011 00:05, Ben Walton <span dir="ltr"><<a href="mailto:bwalton@opencsw.org">bwalton@opencsw.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Excerpts from Jesse Reynolds's message of Wed Aug 17 09:49:<a href="tel:45%20-0400%202011" value="+14504002011">45 -0400 2011</a>:<br>
<br>
Hi Jesse,<br>
<div class="im"><br>
> I wonder if anyone knows why a very basic gem recipe for rake (at<br>
> rbgems/rake/branches/rb18) doesn't create a link / executable at<br>
> /opt/csw/bin/rake ? This would be created if you ran 'gem install<br>
> rake'.<br>
<br>
</div>Does it create the symlink anywhere else in the tree? If not, you can<br>
use:<br>
<br>
post-install-modulated:<br>
(cd $(DESTDIR); mkdir -p opt/csw/bin; ln -s /path/to/rake.rb<br>
opt/csw/bin/rake)<br></blockquote><div><br></div><div>OK ta.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
or some such. If the symlink should be delivered normally but isn't,<br>
maybe we're not calling gem properly?<br></blockquote><div><br></div><div>I suspect this is the case. Usually when you install a gem that has a command line interface, like rake, rubygems installs a wrapper script for it. It doesn't use a symlink actually (which was my assumption until now), the wrapper script looks like this on my mac:</div>
<div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div class="gmail_quote"><div><div>jesse@ren $ cat /opt/local/bin/rake</div></div></div><div class="gmail_quote">
<div><div>#!/opt/local/bin/ruby</div></div></div><div class="gmail_quote"><div><div>#</div></div></div><div class="gmail_quote"><div><div># This file was generated by RubyGems.</div></div></div><div class="gmail_quote"><div>
<div>#</div></div></div><div class="gmail_quote"><div><div># The application 'rake' is installed as part of a gem, and</div></div></div><div class="gmail_quote"><div><div># this file is here to facilitate running it.</div>
</div></div><div class="gmail_quote"><div><div>#</div></div></div><div class="gmail_quote"><div><div><br></div></div></div><div class="gmail_quote"><div><div>require 'rubygems'</div></div></div><div class="gmail_quote">
<div><div><br></div></div></div><div class="gmail_quote"><div><div>version = ">= 0"</div></div></div><div class="gmail_quote"><div><div><br></div></div></div><div class="gmail_quote"><div><div>if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then</div>
</div></div><div class="gmail_quote"><div><div> version = $1</div></div></div><div class="gmail_quote"><div><div> ARGV.shift</div></div></div><div class="gmail_quote"><div><div>end</div></div></div><div class="gmail_quote">
<div><div><br></div></div></div><div class="gmail_quote"><div><div>gem 'rake', version</div></div></div><div class="gmail_quote"><div><div>load Gem.bin_path('rake', 'rake', version)</div></div></div>
</blockquote><div class="gmail_quote"><div><br></div><div><br></div><div>Whereas the 'rake' command line executable installed within the ruby gems heirarchy is entirely different:</div><div><br></div><div><br></div>
</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div class="gmail_quote"><div><div>jesse@ren $ cat /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake</div></div>
</div><div class="gmail_quote"><div><div>#!/usr/bin/env ruby</div></div></div><div class="gmail_quote"><div><div><br></div></div></div><div class="gmail_quote"><div><div>#--</div></div></div><div class="gmail_quote"><div>
<div># Copyright (c) 2003, 2004, 2005, 2006, 2007 Jim Weirich</div></div></div><div class="gmail_quote"><div><div>#</div></div></div><div class="gmail_quote"><div><div># Permission is hereby granted, free of charge, to any person obtaining a copy</div>
</div></div><div class="gmail_quote"><div><div># of this software and associated documentation files (the "Software"), to</div></div></div><div class="gmail_quote"><div><div># deal in the Software without restriction, including without limitation the</div>
</div></div><div class="gmail_quote"><div><div># rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</div></div></div><div class="gmail_quote"><div><div># sell copies of the Software, and to permit persons to whom the Software is</div>
</div></div><div class="gmail_quote"><div><div># furnished to do so, subject to the following conditions:</div></div></div><div class="gmail_quote"><div><div>#</div></div></div><div class="gmail_quote"><div><div># The above copyright notice and this permission notice shall be included in</div>
</div></div><div class="gmail_quote"><div><div># all copies or substantial portions of the Software.</div></div></div><div class="gmail_quote"><div><div>#</div></div></div><div class="gmail_quote"><div><div># THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</div>
</div></div><div class="gmail_quote"><div><div># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</div></div></div><div class="gmail_quote"><div><div># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</div>
</div></div><div class="gmail_quote"><div><div># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</div></div></div><div class="gmail_quote"><div><div># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</div>
</div></div><div class="gmail_quote"><div><div># FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS</div></div></div><div class="gmail_quote"><div><div># IN THE SOFTWARE.</div></div></div><div class="gmail_quote">
<div><div>#++</div></div></div><div class="gmail_quote"><div><div><br></div></div></div><div class="gmail_quote"><div><div>begin</div></div></div><div class="gmail_quote"><div><div> require 'rake'</div></div></div>
<div class="gmail_quote"><div><div>rescue LoadError</div></div></div><div class="gmail_quote"><div><div> require 'rubygems'</div></div></div><div class="gmail_quote"><div><div> require 'rake'</div></div>
</div><div class="gmail_quote"><div><div>end</div></div></div><div class="gmail_quote"><div><div>Rake.application.run</div></div></div></blockquote><div class="gmail_quote"><div><br></div><div>I'm not sure how rubygems knows to create these wrapper scripts. I imagine there is some kind of installation recipe embedded within the gemfile. I'll take a look. </div>
<div><br></div><div>Jesse</div></div>