# Sudo: Command Not Found When Compiling Rails



## 1Copenut (May 10, 2006)

Hello Forum:

I am running a Power PC Mac with OS X 10.4.6 Tiger, multiple user accounts (one admin, and daily accounts) and File Vault on my admin account.

I am trying to compile Ruby on Rails from source, using the Hivelogic.com tutorial, but every time I get to the command *sudo gem install rails --include-dependencies,* it gives me the error:
*sudo: gem: command not found.*

The same happens when I try to use Darwin Ports,
*sudo: port: command not found.*

I believe it has to do with my hard drives. The computer only came with a 10GB, which I upgraded to a 60GB named "Data." The tech who did the install did not migrate my system to the new drive, so I used SuperDuper or Carbon Copy Cloner (I think) to migrate the system files, but I don't know if I actually moved them to the new drive or just mirrored them. I believe this to be the source of my error, but don't know how to make Data the primary drive, not just a mirrored one. I'd also like to make the small drive a scratch disk for Photoshop, but not until I know Data is the primary drive.

Any help would be greatly appreciated!

Thank you,

Trevor


----------



## tenmile (May 21, 2006)

Hi Trevor,

I had the same problem and since this is day 2 of owning my first mac it was a killer--please forgive me if I don't put this correctly, this is all brand new to me

What I found is that I was not setting my path appropriatly at login to the terminal.  I see that you checked out the Hivelogic approach, like me, and set your .bash_login file to the correct path.  Doesn't work.  Then you probably looked around on the web and it told you to set it in .profile--still no luck.

Ready to be annoyed?

You need to create a file named .bash_profile (unless it already existis, of course) in the same directory as .bash_login and set the path in it. 

That should get you going..best of luck,

Kyle


----------



## 1Copenut (May 21, 2006)

Kyle:

Thank you for the response. It did turn out that my ~/.bash_profile had already been set during a previous install of MySQL. And that was the problem, the path was set to /usr/local/mysql. I changed the ~/.bash_profile and it worked great.

Ruby has been a trip so far, now that it works like the tutorial said it would. 

I also learned a little about UNIX. It seems the bash files have a hierarchy that looks like this, (in descending order):

~/.bash_profile
~/.bash_login
~/.profile

UNIX looks for the first one with a $PATH set and runs with it. If this thread saves anyone else the same grief we both went through, we've done a good deed here.

Thanks again Kyle,

Trevor


----------

