# OS X rails path problem

**URL:** <https://www.ruby-forum.com/t/os-x-rails-path-problem/172789>\
**Category:** Rails\
**Created:** [July 28, 2009, 3:12am UTC](https://www.ruby-forum.com/t/os-x-rails-path-problem/172789 "2009-07-28T03:12:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 28, 2009, 3:12am UTC](https://www.ruby-forum.com/t/os-x-rails-path-problem/172789/1 "2009-07-28T03:12:42Z")

</div>

I have had rails up and running for about 2 years now, but while  
troubleshooting an arduino problem, I inadvertently changed something  
related to my path variable that caused scrip/server to no longer run,  
after a reinstalling the basics… ruby-gems, etc… everything seemed  
to run smoothly but now i cannot run rake.

I obviously have two versions of almost every gem on my system, but I  
have no clue how to start cleaning up my machine. I want to point  
everything to a single copy of my correct resources. Can anyone recomend  
some good material on troubleshooting path/gem install issues, or just  
some good solid resources on OS X/Unix architecture. I understand what a  
path is, and what it does, but until now i’ve been mostly just doing  
rather than understanding.

OS X 10.5.7

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 28, 2009, 3:30am UTC](https://www.ruby-forum.com/t/os-x-rails-path-problem/172789/2 "2009-07-28T03:30:31Z")

</div>

System information here: [http://pastie.org/561126](http://pastie.org/561126)

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 28, 2009, 3:37pm UTC](https://www.ruby-forum.com/t/os-x-rails-path-problem/172789/3 "2009-07-28T15:37:57Z")

</div>

On Mon, Jul 27, 2009 at 6:12 PM, Richard  
Schneeman[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> some good material on troubleshooting path/gem install issues, or just  
> some good solid resources on OS X/Unix architecture. I understand what a  
> path is, and what it does, but until now i’ve been mostly just doing  
> rather than understanding.

From your pastie:

/usr/bin:/usr/local/lib/ruby/gems/1.8:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin/:/opt/local/bin:/Users/richard/bin/bin/:/usr/local/bin

I would first remove ‘/usr/local/lib/ruby/gems/1.8’ – there shouldn’t  
be  
any executables in that directory. Also, you’ve got duplicate  
directories  
in that PATH statement.

Then this:

richard-s-macbook-pro:restapp richard$ which ruby  
/usr/local/bin/ruby  
richard-s-macbook-pro:restapp richard$ which rails  
/usr/bin/rails  
richard-s-macbook-pro:restapp richard$ which rake  
/usr/bin/rake

If you type `ruby -v` is it the version you want?

If so, I suspect you have a /usr/local/bin/rails, /usr/local/bin/rake,  
etc.  
but because /usr/bin is first in your PATH, they are not being used.

Open a new shell and set your PATH to  
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin/:/opt/local/bin:/Users/richard/bin/bin  
(is that last “bin/bin” correct?)

Then see what `which rake` produces.

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 29, 2009, 12:36am UTC](https://www.ruby-forum.com/t/os-x-rails-path-problem/172789/4 "2009-07-29T00:36:29Z")

</div>

You were right it was the /usr/bin in front and the  
‘/usr/local/lib/ruby/gems/1.8’ that was screwing everything up

[http://pastie.org/562566d](http://pastie.org/562566d)

Everything works again, thanks! Besides the ‘profile’, ‘bashrc’, and  
‘bash\_profile’ are there any other common locations where the PATH  
variable would be set? A few of those declarations could not be  
accounted for in those three files.

---

<div class="post-metadata">

**Author:** ![indigoi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/b3f665/32.png) [@indigoi](https://www.ruby-forum.com/u/indigoi)\
**Post date:** [July 29, 2009, 1:27am UTC](https://www.ruby-forum.com/t/os-x-rails-path-problem/172789/5 "2009-07-29T01:27:29Z")

</div>

On Tue, Jul 28, 2009 at 3:36 PM, Richard  
Schneeman[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Everything works again, thanks! Besides the ‘profile’, ‘bashrc’, and  
> ‘bash\_profile’ are there any other common locations where the PATH  
> variable would be set? A few of those declarations could not be  
> accounted for in those three files.

Nothing comes immediately to my mind, but I suppose some errant  
installer could do it, especially if you decided to CTRL-C out of the  
middle of an install. 🙂

Something to keep in mind, I suppose.

## HTH,

Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
