The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   Am I missing something or is UNIX completely retarded ? … (http://hintsforums.macworld.com/showthread.php?t=75612)

simonwh 07-21-2007 03:30 PM

Am I missing something or is UNIX completely retarded ? …
 
Email : simonwhel@yahoo.com

“If I can do it then it can’t be done ! …”.

Hi Everybody :

I’m trying to get the installation & setup instructions for Mac OSX in Patrick Lenz’s book “Build Your Own Ruby on Rails Web Applications” to work.

I’m currently stuck on trying to connect to the MySQL database.

At this point in time I’m trying to add ““/usr/local/mysql/bin/”” to the environment path.

The Unix FAQ on this site is actually quite good and very helpful (Thank You hayne !).

FAQ 3 “How do I set up my shell execution PATH?” is actually quite helpful.

Unfortunately, I’ve run into what I consider to be a rather inexplicable problem that I need some help with.

In essence, I’ve been able to change the content of the environment path but the changes I’m making are being discarded each time I close the Terminal window rather than savingt hem between sessions with a Terminal window.

If I type in :

echo $PATH

I get back :

/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

I assume here that this means that the paths my system will search when looking for a command are the following :

/usr/local/bin
/usr/local/sbin
/bin
/sbin
/usr/bin
/usr/sbin

Now, I would like to add “/usr/local/mysql/bin/” to this list.

So, apparently, I have to do the following :

export PATH="/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin/:/usr/local/mysql/bin"

If I do that and I then type in :

echo $PATH

I get back :

/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin/:/usr/local/mysql/bin

So, it looks to me like I now have “/usr/local/mysql/bin” added to my environment path.

Now, things start to get a little weird.

If I close the Terminal window and open up another Terminal window and then type in :

echo $PATH

I get back :

/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

In other words, the “/usr/local/mysql/bin” path that I just added in the last Terminal window session is now missing from the environment path. In other words, it looks like the system has just dropped the pathname “/usr/local/mysql/bin” that I added the last time I used the Terminal window.

I now have to ask : IS UNIX COMPLETELY RETARDED OR AM I MISSING SOMETHING HERE !?!

I would think the default behavior would be to save the items appended to the environment path between sessions. Otherwise, I’m just going to have to keep adding the same environment path crap every time I want to use a Terminal window.

In other words, if someone could explain to me how I can alter/append to the environment path and have that change made permanent. I would really appreciate it.

I’m also curious as to why the default behavior for altering the environment path is to discard all environment path changes made between sessions.

I mean, really, do the people who develop and support UNIX have stock in companies who treat carpal tunnel syndrome ?

OK, let’s try your other suggestion; i.e. : mysql -u root

This is, of course, bearing in mind that my environment path now has “/usr/local/mysql/bin” appended to it.

If anyone can explain to me what I’m doing wrong I would really appreciate it.

I’d like to thank anyone and everyone for any help, advice, answers, solutions or suggestions you could send my way.

Thank you !


All the best & talk to you soon … Simon.



Edit - do NOT put phone numbers and such into posts on Internet forums - Craig A, site admin

patgmac 07-21-2007 05:01 PM

sudo vi /etc/profile

You'll see where your existing PATH is, you can add to that.

tlarkin 07-21-2007 05:08 PM

Quote:

Originally Posted by simonwh (Post 395046)
Edit - do NOT put phone numbers and such into posts on Internet forums - Craig A, site admin

Haha, I just had to laugh at this....

the above is good advice but sometimes vi can be confusing to use, so alternatively you can use pico in its place since it may be a bit simpler to use.

trevor 07-21-2007 07:20 PM

Simon, as patgmac hinted in his/her post, you need to add /usr/local/mysql/bin to a file that is called by your shell. While patgmac is suggesting that you edit /etc/profile, I would suggest that you should edit a file specific to your user, as other users on your computer probably don't want /usr/local/mysql/bin in their path.

Assuming that you use bash, what do you currently have in ~/.bash_profile? (The ~ is the same as /Users/yourusername, where yourusername is your actual short username.)

If you don't have it, you could create that file, and put the commands to add /usr/local/mysql/bin to your path into the file.

Trevor

simonwh 07-21-2007 10:04 PM

No, UNIX isn't retarded & I'm really missing a lot …
 
Email : simonwhel@yahoo.com

“If I can do it then it can’t be done ! …”.

Hi Everybody :

1st off, I’d like to thank “patgmac”, “tlarkin” & “trevor” for their help & suggestions.

2nd, I’d like to apologize for the rather pissy tone of my posting.

It appears that UNIX isn’t retarded but rather I am definitely missing a lot of somethings.

The truth is that I’m extremely frustrated at the moment.

I’m working on my 1st Ruby on Rails contract and I’ve spent the last 2 weeks trying to get my Ruby on Rails environment set up properly.

Prior to this I’ve spent the last 13 or so years working on self contained development environments like Metrowerks Code Warrior and I’m both astonished and extremely frustrated by how difficult it is to simply get the development tools properly installed and working.

I’m not even at the point where I can start making bewildering and frustrating mistakes with either Ruby or Rails.

I’m using the Site Point book written by Patrick Lenz entitled “Build Your Own Ruby On Rails Web Applications”.

The problem is (this is assuming, of course that I haven’t made some small mistake or mistakes that have screwed things up. This probably isn’t true because I’ve tried installing the damn thing from scratch 4 times now. By “scratch” I mean erasing the entire logical drive down to zeroes, reinstalling Mac OSX 10.4.10, XCode 2.4.1, Readline-5.1, Ruby 1.8.4, Rails 1.2.3 & MySQL 5.0.45) that his instructions simply don’t work.

I don’t know why they don’t work but they simply don’t work. I have the impression that they wrote the installation instructions for Mac OSX and then didn’t even bother to test them. The only other explanations I can come up with for my installation problems are :

1. I’ve made some small error(s) that are creating problems. As I’ve said immediately above this is the 4th time I’m installing the Ruby/Rails/MySQL environment and I’ve tried to be as careful as possible, double and then triple checking everything before I proceed with an installation step.
2. There’s something different about my setup that’s causing problems. I’m running on a 1.8 GHz Power PC G5 under Mac OSX 10.4.10 . The CPU Type is “PowerPC 970 (2.2)”. I’m booting of a logical drive called “TigerRuby”. All the development stuff is on this logical drive.

My basic problem because I am very unfamiliar and rather uncomfortable dealing with Command line Interfaces more generally and the Unix command line specifically in that doing even the simplest things seems to be incredibly and inordinately complex.

I’m hoping that, as I get more comfortable and familiar with Unix that my familiarity with how things are done and my frustration with how to do them will decrease.

For example, he problem I’m trying to solve on this forum is simply that of adding the pathname “/usr/local/mysql/bin” to the existing list of pathnames in PATH.

In the development environments that I’m used to I would simply open up the file containing the path names and simply append the “/usr/local/mysql/bin” pathname to the text contained therein. This would take me about 5 seconds. I’m finding it to be incredibly difficult to do a task as simple as this under Unix. The Unix text editors seem to be incredibly complex.

All I need to do is the following :

1. Open up the file in question (I that file seems to be “~/.profile”) using one of these editors.
2. Look at the contents of that file.
3. Append the string the “/usr/local/mysql/bin” to those contents.
4. Save the file and then close it.
5. Open the file up again and verify that the new appended text has been saved along with the original contents.

This should be really simple but I’m finding that it isn’t.

If type “sudo vi ~/.profile” into the Terminal window I get :

Password:


















export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"~/.profile" 1L, 51C

Now, I’m assuming here that I’m displaying the contents of the right file.

I’m also assuming that I want to change the string :

‘export PATH="/usr/local/bin:/usr/local/sbin:$PATH"’

To the following :

‘export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"’

I think (but I’m not really sure) that entering the following line of text in the Terminal window will do that :

echo ‘export PATH="/usr/local/mysql/bin:$PATH"’ >> ~/.profile

If I then enter :

sudo vi ~/.profile

I get :

Password:

And then I get :





















export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PATH="/usr/local/mysql/bin:$PATH"
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

So, have I now managed to screw myself or is this correct ?

If I’ve now managed to screw myself I’d appreciate it if oyu could give me instructions on how I can repair the damage I’ve already done.

The problem I’m finding is that the Unix editors like vi, emacs, pico etc. are a lot harder to use than the editors I’m used to working with in integrated development environments.

The other problem I’m having is that I don’t find the “Man pages” particularly useful.

They seem to be designed to tell you the question when you already know the answer.

Anyhow folks (& folkettes (no chauvinist, me !) any help, advice and suggestions you could send my way would be immensely appreciated !

Thank you !
All the best & talk to you soon … Simon.

hayne 07-22-2007 12:50 AM

You don't seem to have read beyond the section of the Unix FAQ that tells you about setting up your PATH.
In particular, you don't seem to have read the section about editing text files that mentions some text editors with a GUI like you are used to.

And I think one of the problems you are having is due to expecting it to be easy. You need to spend much more time on this. Man pages will make more sense after you read them several times. And be sure to read the section of the FAQ about commonly used commands.

cwtnospam 07-22-2007 08:35 AM

In simonwh's defense, man pages, although technically correct, are almost universally poorly written. They're supposed to be explaining how things work, yet they assume that you already know most of what you're looking for and only need a reference guide for the details. It's a shame, because with just a few examples they could be much more helpful.

Lutin 07-22-2007 10:33 AM

simonwh, you should have a look at locomotive. It's an application that installs a complete Ruby On Rails environment, just by drag & drop.

baf 07-22-2007 10:42 AM

And have faith.
From Unknown source: "Unix it's hell to visit. But paradise to live in"

simonwh 07-24-2007 09:34 AM

Was Franz Kafka one of the early Unix architects ?
 
Email : simonwhel@yahoo.com

Life is a tragedy for those who feel
And life is a comedy for those who think …

-Sir Horace Walpole (among other things, inventor of the word “Serendipity”)


As Dr. Nick of the Simpsons sez :

Hi Everybody ! :

This is a continuation of my rather acerbic and quite curmudgeonly previous post entitled :

Am I missing something or is UNIX completely retarded ? …

1st off, I would like to everyone for taking the time to respond to that posting; i.e. :

• patgmac
• tlarkin
• trevor
• hayne
• cwtnospam
• lutin
• baf

Thank you, one and all !

As the French say, in this post I’m going to “Réculer pour mieux sauter” (i.e. : “Stand back in order to jump further”).

I’m trying to get started on my 1st Ruby on Rails contract.

This means that I have to set up a Ruby on Rails/MySQL development environment so that I can get started on confounding, confusing and frustrating myself with Ruby and Rails conundrums and enigmas as opposed to Unix imbroglios & cul de sacs.

The book I’m working with is published by Site Point.

It’s called “Build Your Own Ruby On Rails Web Applications” and the author is Patrick Lenz.

From now on in this email I’ll refer to it as : “BYORORWA” (which, come to think of it, kinda reminds me of : “BUWAHHAHA” which seems to me to be sort of appropriate, bearing in mind the twisted and distorted tale of chagrin, consternation, dismay and woe I’m about to relate).

By the way I’m running a 1.8 GHz G5 PowerPC (according to “About This Mac – More Info … it’s a “CPU Type: PowerPC 970 (2.2)”).

The problem is the Ruby/Rails/MySQL installation instructions for Mac OSX given in Chapter 2 : Getting Started, “Installing on Mac OSX”, pages 19-31 simply don’t work.

I don’t, at this point know whether or not this is because :

1. There’s something different about my hardware/software setup that’s causing problems.
2. I’m making mistakes in the installation that are causing problems.
3. The installation instructions are simply wrong at certain crucial points.

My suspicion is that the author and the publishers didn’t bother to test the installation instructions for Mac OSX.

The prime reason why I think this is that I’ve tried doing a complete install 4 times. Each time I did the install I checked every instruction 2 and then 3 times to make sure the string of instruction text was correct before I hit the Return key while in the Terminal Window.

Now, let me explain to you what I mean by a “complete install “ :

1. I erased everything on the logical drive “TigerRuby”. I also zeroed out all the data.
This took a couple of hours.
2. I installed Mac OSX 10.4.3 from a DVD. This took about an hour.
3. I updated Mac OSX from 10.4.3 to 10.4.10. I did this over the web.
At the same time, I accepted all the other updates that were provided.
This took about another hour.
4. I downloaded all 930 megabytes of XCode 2.4.1 from the web and installed it.
This took about another 2 hours.
5. Software Update came up with another raft of updates. I accepted them all.
6. I set the Path as per the instructions on page 23 of BYORORWA.
7. I created a “Build” directory on my Desktop as per page 24 of BYORORWA.
8. I downloaded and installed “readline-5.1” as per page 25 of BYORORWA.
9. I downloaded Ruby as per page 25 of BYORORWA.
10. I checked the version using “ruby -v”.
It came back with : “ruby 1.8.4 (2005-12-24) [powerpc-darwin8.10.0]”
I think this is correct.
11. I then downloaded and installed RubyGems as per page 26 of BYORORWA.
12. I then checked the version of RubyGems using : “gem -v”.
That returned the string : “0.9.0” which I think is correct.
13. I then downloaded and installed rails as per page 27 of BYORORWA.
14. I then checked the version of rails using : rails –v.
It returned the string “Rails 1.2.3”. I think this is correct.
15. I then attempted to download and install MySQL.
The specific package I downloaded is :
“mysql-5.0.45-osx10.4-powerpc.dmg”.
The truth is, given that I have a 1.8 GHz Power PC G5 (PowerPC 970 (2.2)),
I’m not actually 100% certain that I downloaded the correct version for my machine.
According to “About this Mac … More Info …” the Machine Model is a :
“PowerMac 7,2”.

The problem with the installation is that the Instructions for installing MySQL and then getting it up and running simply don’t work.

I won’t go into the details here of what exactly are the MySQL problems. I’m posting here because I’ve got some Unix problems I have to solve before I can even move on to the MySQL problems. For the MySQL problems, that’s assuming of course I’m actually able to solve my Unix problems, I’m planning on moseying on over to the MySQL site and making a pestiferous nuisance of myself on the fora I assume exist over there.

So, after trying 4 times from scratch to get the instructions in BYORORWA to work, I’ve given up on them.

They don’t work. In spite of having spend the last 2 weeks working on them and writing several post I haven’t been able to figure out why.

I’m now trying to use the HiveLogic instructions for setting up a Ruby/Rails/MySQL environment.

The specific earl for the article that I’m using is :

http://hivelogic.com/narrative/artic...grel-mysql-osx

The title of the article is :

Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X

The author is Dan Benjamin (may God bless him !).

And, this brings me back to both Unix and to this forum.

But, before I get into all of that, I’d like to address the remark made by “Lutin”; i.e. :

simonwh, you should have a look at locomotive. It's an application that installs a complete Ruby On Rails environment, just by drag & drop.

The reason why I’m not using Locomotive (which I actually did download and take a look at (by the way, I think it’s pretty good)) is a footnote that appears at the bottom of page 19 of BYORORWA; i.e. :

<Quote>
There is an all-in-one installer available for Mac OSX, called Locomotive.
(http://locomotive.raaum.org/).
Unfortunately, it ships with the SQLite database server, instead of MySQL. It’s not that I have anything against SQLite as a database, but in a book that’s already covering all operating systems, there’s only so far one can go to cater for possible combinations of technologies. For this reason, I don’t recommend that you use Locomotive to work through this book.
</Quote>

Seeing as how I’m still using BYORORWA, I’m following Patrick Lenz’s advice in order to avoid unnecessarily complicating things for myself (I already have more than enough problems just trying to get the damn installation up and running properly).

And now that we’ve gotten through my ponderous preamble, I’ll now explain why I’m posting on this Unix forum for problems that ultimately have to do with Ruby, Rails and MySQL rather than Unix itself.

The answer is that I’m stuck on a Unix problem that has completely stopped me from getting on with the Ruby/Rails/MySQL installation.

It’s actually the same problem that I posted about under my previous snippy and somewhat snooty post entitled :

Am I missing something or is UNIX completely retarded ? …

And what is that problem ? I have to change the path in the “.bash_login” file.

I don’t know how to do this.

In case anybody’s wondering, the part of the HiveLogic article that I’m stuck at is entitled :

Paths
Do not skip this step! Most everything else will fail if you do.

I don’t know about you folks (and folkettes, no chauvinist me !) but that sub heading seems to suggest that getting the paths properly set is rather important.

Now, “Hayne” said :

You don't seem to have read beyond the section of the Unix FAQ that tells you about setting up your PATH.
In particular, you don't seem to have read the section about editing text files that mentions some text editors with a GUI like you are used to.

And I think one of the problems you are having is due to expecting it to be easy. You need to spend much more time on this. Man pages will make more sense after you read them several times. And be sure to read the section of the FAQ about commonly used commands.
__________________
hayne.net/macosx.html

Hayne is quite correct, I didn’t read beyond the path setting entry to the entry about GUI based editors.

In my defense I will say that there are a few reasons why I didn’t do so.

1st, I’m under some severe time constraints and my primary focus is not becoming a Unix expert. Rather my focus is simply to get my Ruby/Rails/MySQL environment up and running so that I could move on to the problem of creating the RoR application for my client.

2nd, I’m utterly dumbfounded and extremely frustrated that things as simple as editing a file under Unix seem to be so extraordinarily more difficult than doing the same simple task using gui based text editor running under the Mac OSX Finder.

Anyhow, Hayne is right in that I didn’t notice that there was a posting on his FAQ entitled :

“10) How do I edit text files (e.g. configuration files)?”.

By the way, Hayne, I’d just like to make a comment about your FAQ and the “man” pages.

Your FAQ is easily at least an order of magnitude BETTER than the “man” pages.

If the “man” pages were of the same quality as your FAQ there would be far, far fewer postings like mine on sites like these.

You are to be commended for all the effort you’ve put into your FAQ and I very much appreciate the help it’s given me. I’ve bookmarked the damn thing and I frequently refer to it now. Actually, whenever I have a Unix problem now your FAC is the 1st place I go to.

THANK YOU !

I decided to take Hayne’s advice. I downloaded and installed the gui editor called “TextWrangler”. It looks pretty good, and, even better, it’s free !

I gleefully and blissfully figured that I could use this rather good gui based text editor to make the modifications that the HiveLogic author, Dan Benjamin tells me I have to make to the “~/.bash_login” file in order to successfully installed Ruby/Rails/MySQL et al and thereby avoid the complexities and difficulties of dealing with command line editors like “vi”, “emacs” & “pico”.

And then I realized that I don’t know where the file “~/.bash_login” is located. What’s worse is that it’s an “invisible” file.

By the way, although I do understand that some files are made invisible so that dimwitted Unix dullards such as me won’t accidentally trash them. But I have to tell you that looking for that damn file made me feel sort of like Wonder Woman when she looks for her Invisible Airplane (I mean how do you find an invisible airplane if you forgot where you last parked it ? Do you wander around airport runways until you eventually bark your shins on the stupid plane ?).

I tried using the “Open Hidden …” option in the “File” menu of TextWrangler” but I have no idea where this file is located. I looked in every place that I could think of but I haven’t been able to find it.

So, my 1st question is :

Where exactly is the file “~/.bash_login” located ?

But, just like Lewis & Clark in Stephen J. Ambrose’s book “Undaunted Courage” I continued to intrepidly work at resolving the problem. Come to think of it, to me Unix is sort of like a vast unexplored and rather unfriendly (present company, excepted, of course !) & unknown continent hiding vast, untapped (well, for me , anyway) technological riches and resources.

Hmmm … On further reflection I guess this means that I’m sort of hoping that one of you will intentionally or unintentionally fulfill the role of becoming a metaphorical Sacagawea for me.

Anyhow … Dear Friends, I then took a precipitous step rarely observed in the general Macintosh User Community; i.e. : I opened up the TextWrangler online user manual ! … And then … I started reading it !

Amazingly enough, in Chapter 3 “Working With Files”, on page 49 there’s a section entitled : “Using Text Wrangler from the Command Line”.

“Hot diggity” I thought to myself : “I don’t actually have to know where the damn ‘“~/.bash_login’ file is ! I’ll just enter ‘TextWrangler ~/.bash_login’ from the Terminal, window, make the modifications , save the changes and … Bob’s yer uncle, I’ll be able to move forward on the Ruby/Rail/MySQL et al installation !”.

Well, I fired up the Terminal window and entered the following text :

TextWrangler ~/.bash_login

Here’s what I got back :

-bash: TextWrangler: command not found

Now, I thought this was odd (and, more than a little annoying. Well, actually, by this point, to tell you the truth, it was goddamned infuriating) as I’d just installed TextWrangler so it should be working.

So, just like Lewis & Clark, undaunted, I went back to reading the TextWrangler online user manual.

The paragraph just under the section heading “Using TextWrangler from the Command Line” on page 49 of Chapter 3 “Working with Files” reads as follows :

You can use the “TextWrangler” command line tool to open files in TextWrangler via the Unix command line. The first time you run TextWrangler after installation, it offers to install the “TextWrangler” tool for you. If you choose not to do so, you can use the “Install Command Line Tools” button in the Application preference panel to install the tool at a later time.

The truth is that I don’t recall being asked to “to install the “TextWrangler” tool for you” when I 1st opened up TextWrangler.

So, I fired up TextWrangler and went on over to the ‘TextWrangler’ menu and selected the “Preferences” option.

I then clicked on “Install Command Line Tools” button”.

A modal dialog button appeared containing the text :

The installed copy of the TextWrangler command line tool is up to date.

I clicked on the “OK” button to dismiss this dialog.

Another modal dialog button appeared containing the text :

The installed copy of the “twdiff” command line tool is up to date.

I clicked on the “OK” button to dismiss this dialog.

Now, the forgoing strongly suggests to me that I can now bring TextWrangler up from inside the Terminal window.

So, I open up a Terminal window and I type in :

TextWrangler ~/.bash_login

And, I get back the following :

-bash: TextWrangler: command not found

So, it would appear that despite what the TextWrangler online help manual sez, you (well, by “you” I actually mean “me) can’t actually use TextWrangler from the command line.

I just don’t get it, I’ve done exactly what the manual told me to do and it just doesn’t work.

If I open up the TextWrangler app from the finder I can’t find the file I need to modify (i.e. : ~/.bash_login).

simonwh 07-24-2007 09:35 AM

Kafka et al … part 2
 
If I try to open up TextWrangler for a Terminal window and give it the file I need to modify the Terminal can’t find the TextWrangler application even though the Text Wrangler sez that it should be able to do this.

I don’t know about you guys but whenever I work with Unix I that unbeknownst to myself, I’ve actually died and gone to Hell.

Except, in my particular case, Hell is actually the set of a Cheesy TV Game show called “You Cant’ Win” and the game show host is Dick Cheney and I’m stuck here for all eternity. 1st prize, if I win is to be struck here for all eternity. The consolation prize if I lose is to be stuck here for all eternity

So, I guess I have a few questions here; i.e. :

1. Why doesn’t TextWrangler work from the Terminal window ? It’s supposed to but it doesn’t.
2. Where’s the damn ” ~/.bash_login” file and how can I open it from TextWrangler ?
3. If I can’t get TextWrangler to find and open the damn “~/.bash_login” so I can edit it then can you show me some other way I can edit the damn file ?

Unix really frustrates me. It seems that no matter what I do to try and solve a problem at least one other problem springs up that prevents me from doing so. The problems I’m having with TextWrangler really take the cake.

Anyhow folks (& folkettes (no chauvinist, me !) any help, advice and suggestions you could send my way would be immensely appreciated !

Thank you !
All the best & talk to you soon … Simon.


P.S. : The more tenacious of you have read all the way to the end of this singularly & severely plaintive and rather massive missive.

So, you might be wondering about the tag line for this posting; i.e. : “Was Franz Kafka one of the early architects of Unix ?”.

The reason why I say this is that so far my experiences of Unix remind me of Franz Kafka’s novel “The Castle”.

trevor 07-24-2007 10:05 AM

Quote:

Where exactly is the file “~/.bash_login” located ?
~ is your home folder. So ~ = /Users/yourusername where yourusername is exactly your short username. So, for example if your short username is simonwh, then ~ is /Users/simonwh

Because we don't know what your short username is, we can't get any more explicit than that. ~ is much easier to write, too.

As ~ is /Users/simonwh or similar, then ~/.bash_login translates to /Users/simonwh/.bash_login

Files that begin with a dot (or a period if you prefer the three-syllable name) are usually rendered invisible by the Finder, but my understanding of TextWrangler (I don't use it myself) is that it can see dot files.

Quote:

TextWrangler ~/.bash_login

Here’s what I got back :

-bash: TextWrangler: command not found
That would only work if TextWrangler is in your PATH. As you've probably installed it into /Applications, and as /Applications is very unlikely to be in your PATH, you will have to call it using the full path. Also, I'm not sure where TextWrangler has a Unix executable file--that would be in the manual you are reading.

However, if you are more comfortable with the GUI, I'd just use the GUI for this, now that you know where ~/.bash_login is located. If you really want to pursue using TextWrangler from the command line, perhaps someone who has it installed could help you further.

Quote:

If I can’t get TextWrangler to find and open the damn “~/.bash_login” so I can edit it then can you show me some other way I can edit the damn file ?
Pico is really an easy editor. The commands for it are found at the bottom of the window--for all of them you hold down the Control key and hit a letter. (Not the Command key, remember.)

You can edit the file from the command line with

pico ~/.bash_login

Trevor

hayne 07-24-2007 10:49 PM

Quote:

Originally Posted by simonwh (Post 395578)
This is a continuation of my rather acerbic and quite curmudgeonly previous post

And hence I have merged your new thread with the previous one.
We like to keep threads together when on the same (or very similar) topic.

hayne 07-24-2007 10:57 PM

Quote:

Originally Posted by simonwh (Post 395579)
1.Why doesn’t TextWrangler work from the Terminal window ? It’s supposed to but it doesn’t.
2. Where’s the damn ” ~/.bash_login” file and how can I open it from TextWrangler ?

As I said earlier, your basic problem is that you are expecting this to be easier than it is. You should expect to dedicate several hours if not days to reading and basic experimenting before trying to actually accomplish anything. There is a lot to learn and you aren't taking the time to learn it.

You can't expect to do anything at the Unix level without careful reading of the documentation.
As to your question #1 above, you failed to read the TextWrangler documentation or help. Chapter 12 of the extensive User Manual for TextWrangler explains that the Unix command to invoke TextWrangler from the command line is 'edit'.

As to your question #2, you seem to have failed to read the "basics" section of the Unix FAQ referred to above - it explains quite clearly that ~ is an abbreviation for your home folder.

ataraxia 07-25-2007 02:42 PM

The real problem here is that it's nearly impossible to do something useful in Unix at the same as learning the basics of it. Being under a time constraint to do all this Unix stuff for a contract, such that you don't have enough time to back off and take it slowly, is a no-win situation.

yellow 07-25-2007 03:16 PM

Quote:

Originally Posted by patgmac (Post 395074)
sudo vi /etc/profile

You'll see where your existing PATH is, you can add to that.

As Trevor noted,

Please don't edit the default bash profile on the machine.
That could have really nasty unintended consequences.

Craig R. Arko 07-25-2007 08:11 PM

And for what it's worth, the most heavily recommended text editor these days for Ruby on Rails work is TextMate. It's a commercial app, but not a terribly expensive one. They have a 30-day trial available.

http://macromates.com/

There's also a book on it from the Pragmatic Programmers (heavy hitters in the Ruby industry):

http://www.pragmaticprogrammer.com/titles/textmate/

marnen 10-19-2007 06:24 PM

Quote:

Originally Posted by simonwh (Post 395578)
Email : simonwhel@yahoo.com
The reason why I’m not using Locomotive (which I actually did download and take a look at (by the way, I think it’s pretty good)) is a footnote that appears at the bottom of page 19 of BYORORWA

Yeah...unfortunately, Patrick got this completely wrong. Locomotive may only ship with SQLite, but it will work with other DB servers (I'm running it right now with PostgreSQL), and it's a dead-simple installation.

Quote:

Seeing as how I’m still using BYORORWA, I’m following Patrick Lenz’s advice in order to avoid unnecessarily complicating things for myself
Good principle, but in this case it's Patrick's inaccurate warning against Locomotive that's complicating things for you. I just downloaded his book and saw this footnote, and frankly it's so far from the truth that it's making me wonder about the quality of the book as a whole.

marnen 10-19-2007 06:27 PM

Off topic, but I'm finding more and more errors in this book -- such as Patrick's claim on p. 48 that TextWrangler doesn't support syntax highlighting. Not only is this completely untrue, but the screenshot (on p. 49) clearly shows the highlighting! Sheesh.

paygun 10-20-2007 03:37 AM

Dude. Push your deadline out or pass on this project, you're going to need to do a lot of learning before you get up and running if you're starting with no Unix experience. A Unix system is a tool box, not a kit. That's why it can be so frustrating, but also so powerful if you learn to use it.

If pushing or passing isn't an option, consider buying hosting with ruby on rails already configured. Then you could start developing right away and leave the system admin stuff for later when you have time to burn on it.


All times are GMT -5. The time now is 10:17 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.