Re: Problem compiling first Cocoa app in Xcode 3.1
Re: Problem compiling first Cocoa app in Xcode 3.1
- Subject: Re: Problem compiling first Cocoa app in Xcode 3.1
- From: Thomas Wetmore <email@hidden>
- Date: Sun, 20 Jul 2008 20:54:04 -0400
Paul,
The arcanery of the different shells can get complicated. I'm running
bash (the "Bourne again" shell) as my shell and am using .profile to
give the start-up extras. I don't use .bash_profile. You can use
either and I don't want to find out the advantages or disadvantages of
the two. What I do works. Some shells require the EXPORT, some don't,
some use a "set" terminology. I don't use EXPORT for changes to PATH
because I think PATH is already exported. So that single line I've
written in my emails should be all you need. To be absolutely sure you
can add the line EXPORT PATH after that line.
You need to find out:
1. Do you have the right ruby in /usr/bin. If you don't you have to
find out why.
2. You have to arrange things so that when Xcode wants to run ruby it
finds the one in /usr/bin. This is based on the speculation that if
you are not using the right ruby, which we know you are not, then that
is the problem. Though one of the other posters does not think that is
the case. You need to find out.
You control these things through the setting of the PATH environment
variable. That's really all there is to it. The various instructions
on what to do with the .profile or the .bash_profile file are all
about getting number 2) taken care of. Getting 1) taken care of is an
installation issue. The right ruby should have been put in your /usr/
bin as part of the developer tools installation.
Have you looked into your /usr/bin to see if there is a ruby program
in there? Pretty basic stuff. Ruby is a program, so a file, in a bin,
which is a directory. It's a file in a place. You just have to go to
that place and look in it to see if what you are looking for is there.
When you posted what you see when you do "echo $PATH" it became
obvious you have a very long path with quite a bit of duplication.
This indicates a series of installations of things in the past that
have had some accumulation of effects and changes on your PATH. It
could be that you know have a fairly fragile PATH setting.
The first thing you should do is get the ruby in /usr/bin the ruby
that is running in your Xcode. If that fixes the problem, great. If
not, not great, but until you get that one fact determined everything
else is just speculation.
Tom Wetmore
On Jul 20, 2008, at 8:24 PM, Paul Denlinger wrote:
I have a question re .bash_profile and .profile.
The instructions in the directions for the installation
for .bash_profile at http://www.buildingwebapps.com/articles/17-setting-up-rails-on-leopard-mac
state the following for setting up the environmental variables for
the .bash_profile file say:
"After MacPorts completes installation, you need to adjust your
command line PATH environment variable so you can run theport command.
Fire up the Terminal program and enter the command:
$ open .bash_profile
Note that there is a period in front of "bash_profile". The bash
shell configuration file should open in the TextEdit program. If you
don't have a .bash_profile, you can create a new one in your text
editor and save it in your home directory.
(By the way, we recommend iTerm as a nice open source replacement
for the Apple Terminal program.)
Inside of .bash_profile, find the line that starts with export
PATH=, if present. You are going to insert the new directories used
by MacPorts into your path:
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
If you don't have a line that exports your PATH, use the text
exactly as above. If you do already have such a line, add the/opt/
local/bin:/opt/local/sbin: (note colons) after the first quote, but
before any other paths. Here is an example:
export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/
local/sbin:$PATH"
Save the file and close TextEdit. Open a new terminal window and
have MacPorts update itself with the command:
$ sudo port selfupdate
Now if I create a new .profile file with its own environmental
variables, won't that create a path conflict? Don't
the .bash_profile and .profile do one and the same function? So if I
edit a file and set its environmental variables, shouldn't it just
be one file and not two whose instructions which would potentially
conflict with each other?
TIA
Paul Denlinger
On Sun, Jul 20, 2008 at 4:26 PM, Conrad Taylor <email@hidden>
wrote:
Hi, I'm currently using a MacPorts Ruby installation and I'm not
having any issues with XCode. Thus, it appears to be something
wrong with your installation. At this time, my .profile looks like
the following:
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:$
{PATH}
Good luck,
-Conrad
On Sun, Jul 20, 2008 at 4:06 PM, Sam Net <email@hidden> wrote:
Hi Paul,
I had a similar problem when I was building WebKit from the cmd-line
and I suspect that solution to my problem could also be the solution
to your problem.
You will have to do one of the following:
1) Remove /sw/bin from your PATH environment variable (if it's
there) - (i.e. You will need to edit .profile),
2) Move /sw/bin to the end of PATH after /usr/bin so that system
binaries take preference,
3) Upgrade the version of iconv that you have installed via MacPort,
4) Or edit the copystrings script to hard-code /usr/bin/iconv.
Essentially, you just need to ensure that /usr/bin is the first
entry for PATH in your .profile file that is located in your home
directory. This will ensure that the System binaries take
precedence over any other binaries that may have been inadvertently
installed by MacPorts, Fink, etc.
You can use TextWangler (http://www.versiontracker.com/dyn/moreinfo/macosx/18529
) or TextEdit (Apple application) to edit the .profile file in your
home directory. If the .profile file isn't in your home directory
then you will need to create it. If you are not to familiar with
the shell and how to edit the .profile file then I would suggest
having a look at: http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable
. Here you will find a good tutorial that will help you to
understand what you need to do.
Good luck!
- Sam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden