Forum: Ruby on Rails A rather rudimentary & decidely dopey MySQL question ...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb36fa5b120efff98d352bc86b3f462b?d=identicon&s=25 simonwhel@yahoo.com (Guest)
on 2007-07-29 18:50
(Received via mailing list)
Email : simonwhel@yahoo.com

If I can do it then it can't be done ! ...  - Anonymous


Hi Everyone ! :

I'm a Ruby on Rails noobie and a Unix ignoramus (not proud of it but
there it is).

I'm starting my 1st Ruby on Rails (RoR) software project. I intend to
use MySQL as the back end database.

I used the HiveLogic article to install the various components of the
RoR development environment.

The earl for the HiveLogic article I just referred to is :

  http://hivelogic.com/narrative/articles/ruby-rails...

The specific tools/software packages I've installed are the
following :

  · readline-5.1

  · ruby v. 1.8.6

  · rubygems v. 0.9.2

  · rails v. 1.2.3

  · mongrel v. 1.0.1

  · subversion v. 1.4.3

  · Capistrano v. ?

  · MySQL v. 5.0.45 ?


I'm pretty (but not completely) confident that I've installed all the
aforementioned tools correctly.

The reason why I say this is that when I :

1. Open up a Terminal window.
2. Enter the command "cd cyf" to change the directory to the RoR
project I've created (which is called "cyf").
3. Enter the command "script/server" to start up the Mongrel web
server for this project.
4. Fire up the Safari application.
5. Enter the earl "http://localhost:3000/" in the earl display/input
field at the top of the Safari application.
6. Click on the "About your application's environment" earl in the
"Welcome Aboard" page that typing in the previous step brings up.
7. Step 6 above brings up the following text displayed in a yellow
box :

Ruby version      :  1.8.6 (powerpc-darwin8.10.0)
RubyGems version    :  0.9.2
Rails version      :  1.2.3
Active Record version    :  1.15.3
Action Pack version    :  1.13.3
Active Web Service version  :  1.2.3
Action Mailer version    :  1.3.3
Active Support version  :  1.4.2
Application root version  :  /Users/simonwhelan/cyf
Environment version    :  development
Database adapter version  :  mysql

The specific problem that is confusing me at the moment is that I seem
to have somehow installed 2 separate versions of MySQL.

The questions that I need to resolve before I can move onto other,
more interesting RoR problems are the following :

1. How do I determine which of the 2 versions of MySQL my 'cyf' RoR
application is using ?
2. Once I've resolved question 1 listed immediately above then should
I erase the directory containing the other version of MySQL ?

The 2 copies of MySQL I seem to have installed are called

1. mysql
2. mysql-5.0.45-osx10.4-powerpc

If I do the following :

1. Open up a Terminal window.
2. Enter the command : "cd /usr/local".
3. Enter the command : "ls".

I get the following listing for the contents of the directory "/usr/
local".

bin                             man
build                          mysql
include                       mysql-5.0.45-osx10.4-powerpc
info                            share
lib                              src

As you can see I seem to have 2 copies of the MySQL database; i.e. :
"mysql" & "mysql-5.0.45-osx10.4-powerpc".

If I input the following 2 commands :

1. Enter the command : "cd /usr/local/mysql".
2.   Enter the command : "ls".

I get the following listing for the contents of the directory "/usr/
local/mysql".

COPYING                     data                   scripts
EXCEPTIONS-CLIENT        docs                  share
INSTALL-BINARY           include              sql-bench
README                     lib                     support-files
bin                         man                   tests
configure                   mysql-test


If I input the following 2 commands :

2. Enter the command : "cd /usr/local/mysql-5.0.45-osx10.4-powerpc".
2.   Enter the command : "ls".

I get the following listing for the contents of the directory "/usr/
local/mysql-5.0.45-osx10.4-powerpc".

COPYING                     configure
man                     support-files
EXCEPTIONS-CLIENT         data                      mysql-
test            tests
INSTALL-BINARY            docs                      scripts
README                      include                   share
bin                         lib                       sql-bench


As you can see from the above 2 directory listings, the files/
directories contained in both  ""/usr/local/mysql" & "/mysql-5.0.45-
osx10.4-powerpc" seem to be the same.

I should also mention here that although contentsof the 2 directories
are the same, I'm not sure if the 2 directories have the same version
of MySQL. I'm reasonably but not completely sure the directory called
""/usr/local/mysql-5.0.45-osx10.4-powerpc" contains version of 5.0.45
MySQL. I'm not sute what version of MySQL is in the other directory
named ""/usr/local/mysql".

So, I guess my basic questions are :

1. How do I determine which version of MySQl is in each directory ?
2. How do I determine which version of MySQL I'm running ?
3. Which of the 2 copies of MySQL should I be using ?
4. Is it OK to delete the other copy ?.

By the way, I'm assuming that if I can determine the answer to
questions 1 & 2 above I'll be able to determine which of the 2
directories I can safely delete (i.e. : the directory that doesn't
contain the version of MySQL that I happen to be running when I bring
up my RoR application).

I realize to many of you that these questions may seem to be both
rudimentary and, well, rather dopey, but the fact is that I'm just
learning RoR and I'm basically a Unix ignoramus.

I figure it's best to ask for the advice and counsel of the people who
are on this list as they are presumably far more knowledgeable about
Ruby, Rails & UNIX than I am.

I also figure it's better to check and make sure what I'm proposing to
do makes sense rather than go off 1st, do what I think I should doing
and risk shooting myself in the head because I don't really know what
I'm doing.

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. : I'm working on a 1.8 GHz Mac running under Mac OSX 10.4.10 .
According to "About This Mac" , "More Info ..." the specific
microprocessor my machine has is a :
"CPU Type:  PowerPC 970  (2.2)
"
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-07-29 19:19
(Received via mailing list)
simonwhel wrote:

> The reason why I say this is that when I :

> 1. Open up a Terminal window.
> 2. Enter the command "cd cyf" to change the directory to the RoR
project I've created (which is called "cyf").
> 3. Enter the command "script/server" to start up the Mongrel web
server for this project.

For future reference, you didn't need Mongrel; Ruby comes with Webrick,
and
script/server will use this if it can't find Mongrel. No biggie.

>4. Fire up the Safari application.
> 5. Enter the earl "http://localhost:3000/" in the earl display/input
field at the top of the Safari application.

Are you or your spell checker replacing URL for earl?

> 6. Click on the "About your application's environment" earl in the
"Welcome Aboard" page that typing in the previous step brings up.
> 7. Step 6 above brings up the following text displayed in a yellow
box :

> Database adapter version : mysql

> 1. Open up a Terminal window.
> 2. Enter the command : "cd /usr/local".
> 3. Enter the command : "ls".

> mysql
> mysql-5.0.45-osx10.4-powerpc

Cute! Now run this:

  ls -l

It should show that mysql is only a symlink, pointing to
mysql-5.0.45-osx10.4-powerpc

This will show the link in distinct color!

  ls -l --color=tty

> As you can see from the above 2 directory listings, the files/
directories contained in both  ""/usr/local/mysql" & "/mysql-5.0.45-
osx10.4-powerpc" seem to be the same.

That's what a symlink does. If you

        sudo touch yo.txt

in one folder, and go to the other folder, yo.txt will be there too!

That's why Unix doesn't need a Registry with seven billion entries in
it,
like Windows. It just symlinks the working names to the installed
versions.

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

Uh, "folks" is neutral. (-;

--
  Phlip
  http://www.oreilly.com/catalog/9780596510657/
  "Test Driven Ajax (on Rails)"
  assert_xpath, assert_javascript, & assert_ajax
This topic is locked and can not be replied to.