# Texmate

**URL:** <https://www.ruby-forum.com/t/texmate/92636>\
**Category:** Ruby\
**Created:** [April 22, 2007, 12:46am UTC](https://www.ruby-forum.com/t/texmate/92636 "2007-04-22T00:46:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 12:46am UTC](https://www.ruby-forum.com/t/texmate/92636/1 "2007-04-22T00:46:06Z")

</div>

Hi

I installed ruby 1.8.5 and rails on mac osX 10.4.9 via darwinports.  
Ever since, using the run command (cmd-R) for ruby programs from  
textmate gives me:

“/bin/bash: line 4: Sat Apr 21 17:18:00 CDT 2007 /usr/local/bin/ruby:  
No such file or directory”

Interestingly, I get the same message if I try to run a python program  
from textmate as well.

There is a file ‘ruby’ in /usr/local/bin/ and a file ‘ruby’ in /usr/  
bin/ruby

> From the command line, “whereis ruby” gives me /usr/bin/ruby

Since I am currently looking at a book on my desk called “Textmate -  
Power editing for the Mac”, I thought someone in this group might  
have a suggestion…

TIA

C L Snyder

---

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 1:14am UTC](https://www.ruby-forum.com/t/texmate/92636/2 "2007-04-22T01:14:07Z")

</div>

On Apr 21, 2007, at 5:45 PM, Charles L. Snyder wrote:

> I installed ruby 1.8.5 and rails on mac osX 10.4.9 via darwinports.

DarwinPorts, now called MacPorts, would have installed Ruby in it’s  
directory. I believe that’s something like /opt/bin/ruby.

Try going into TM’s preferences, over to the Advanced section, and  
setting a variable called TM\_RUBY to /opt/bin/ruby (double-check me  
on the location though).

Hope that helps.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 1:21am UTC](https://www.ruby-forum.com/t/texmate/92636/3 "2007-04-22T01:21:08Z")

</div>

James Edward G. II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> On Apr 21, 2007, at 5:45 PM, Charles L. Snyder wrote:
> 
> > I installed ruby 1.8.5 and rails on mac osX 10.4.9 via darwinports.
> 
> DarwinPorts, now called MacPorts, would have installed Ruby in it’s  
> directory. I believe that’s something like /opt/bin/ruby.

/opt/local/bin/ruby

sherm–

---

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 2:31am UTC](https://www.ruby-forum.com/t/texmate/92636/4 "2007-04-22T02:31:12Z")

</div>

On Apr 21, 6:18 pm, Sherm P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> James Edward G. II [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:
> 
> > On Apr 21, 2007, at 5:45 PM, Charles L. Snyder wrote:
> 
> > > I installed ruby 1.8.5 and rails on mac osX 10.4.9 via darwinports.

Actually, I had already tried the “TM\_RUBY” trick - tried it again  
with each of these (one at a time)

1. /opt/local/bin/ruby

2. /usr/bin/ruby

3. /usr/local/bin/

This is the same error message for all three:

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/  
web\_preview.rb:70:in `html_head': undefined method `+’ for  
nil:NilClass (NoMethodError) from /Applications/TextMate.app/Contents/  
SharedSupport/Support/lib/scriptmate.rb:186:in `emit_header' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/ scriptmate.rb:91:in `emit\_html’ from /Applications/TextMate.app/  
Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/  
run\_script.rb:72

Maybe I should just reinstall textmate .? … my ruby programs will  
run from textwrangler or command line just fine

---

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 2:41am UTC](https://www.ruby-forum.com/t/texmate/92636/5 "2007-04-22T02:41:12Z")

</div>

On Apr 22, 2007, at 9:19 AM, Craig D. wrote:

> > 
> 
> The whereis command searches only the standard binary directories.

Modifying the PATH variable is probably the best solution. If you are  
not sure about doing that, and chose DarwinPorts/MacPorts as a way to  
escape such Unix trouble, well, it’s never so clean and easy. (not  
until the next version of OS X later in the year)  
I recommend you pick up UNIX in a Nutshell from OReilly press,  
because it covers exactly how to set PATH and other such things in  
the Bash shell. It covers OS X, Linux and Unix in general, so if you  
build some great Rails app, or port your Ruby code to another  
machine, you won’t have trouble.  
Working with Ruby and Rails does mean you need to know a little Unix,  
not a lot. But keep a reference handy!

---

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 4:51am UTC](https://www.ruby-forum.com/t/texmate/92636/6 "2007-04-22T04:51:19Z")

</div>

On Apr 21, 2007, at 7:30 PM, Charles L. Snyder wrote:

> This is the same error message for all three:
> 
> /Applications/TextMate.app/Contents/SharedSupport/Support/lib/  
> web\_preview.rb:70:in `html_head': undefined method`+’ for  
> nil:NilClass (NoMethodError) from /Applications/TextMate.app/Contents/  
> SharedSupport/Support/lib/scriptmate.rb:186:in `emit_header' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/ scriptmate.rb:91:in`emit\_html’ from /Applications/TextMate.app/  
> Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/  
> run\_script.rb:72

OK, this error message has nothing to do with Ruby failing to load,  
which is the problem I thought we were discussing.

The line that errors out on fetches ENV[‘HOME’]. Surely that has to  
be set on your box, but just as a reality-check try this:

1. Open a new TM document
2. Type echo $HOME
3. Press control-R on that line of shell code

What kind of answer do we get?

> Maybe I should just reinstall textmate .?

That shouldn’t do anything. We just need to figure out what the  
problem is.

James Edward G. II

P.S. This doesn’t really have anything to do with Ruby, so why don’t  
we take it off-list. You can email me privately or shift to the  
TextMate discussion list. I’ll see your response either way. Thanks.

---

<div class="post-metadata">

**Author:** ![Charles\_LSSnyder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@Charles\_LSSnyder](https://www.ruby-forum.com/u/Charles_LSSnyder)\
**Post date:** [April 22, 2007, 2:20am UTC](https://www.ruby-forum.com/t/texmate/92636/7 "2007-04-22T02:20:11Z")

</div>

On Apr 21, 2007, at 6:45 PM, Charles L. Snyder wrote:

> Interestingly, I get the same message if I try to run a python program  
> from textmate as well.
> 
> There is a file ‘ruby’ in /usr/local/bin/ and a file ‘ruby’ in /usr/  
> bin/ruby
> 
> > From the command line, “whereis ruby” gives me /usr/bin/ruby

The whereis command searches only the standard binary directories.  
Instead try the which command. Here’s how things looks on my machine,  
where I have left Apple’s Ruby install untouched and installed a  
newer Ruby via MacPorts:

$ which ruby  
/opt/local/bin/ruby  
$

The MacPorts one is found because the binary directories from  
MacPorts appear first on my path:

$ echo $PATH  
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/bin:/  
sbin:/usr/bin:/usr/sbin  
$

Maybe you just need to modify your PATH environment variable so that /  
usr/local/bin (and perhaps /usr/local/sbin) appear before /usr/bin.  
Let us know if that helps.

Craig
