Email : [email protected]
If I can do it then it can’t be done ! … - Anonymous
As Dr. Nick of the Simpsons sez :
Hi Everybody !
I’m trying to use Patrick Lenz’ Site Point book entitled “Build Your
Own Ruby on Rails Web Applications” as a guide for my 1st Ruby on
Rails project.
From here on in I’m going to refer to this book as : “BYORORWA”.
Unfortunately, I’m stuck on Chapter 2 “Getting Started”.
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)
I actually gave up on the instructions for installing the Ruby on
Rails development environment for Mac OSX given on pages 24 to 31 as I
simply couldn’t get them to work.
I then switched over to trying to install my Ruby on Rails development
environment on Mac OSX using the HiveLogic article entitled “Building
Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X” by Dan
Benjamin. The earl for this article is located at :
I’m reasonably sure that I’ve correctly installed everything because
if I do the following :
- Open up a Terminal window.
- Enter the command “cd cyf” to change the directory to the RoR
project I’ve created (which is called “cyf”). - Enter the command “script/server” to start up the Mongrel web
server for this project. - Fire up the Safari application.
- Enter the earl “http://localhost:3000/” in the earl display/input
field at the top of the Safari application. - Click on the “About your application’s environment” earl in the
“Welcome Aboard”
page that typing in the previous step brings up.
I get 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
My problem ?
Well, I believe my problem is 2 fold; i.e. :
- It looks to me as though the MySQL client is not able to connect to
the MySQL server. - I’m too ignorant and inexperienced to be sure that I’m doing things
properly and I don’t know how to properly interpret the diagnostics
I’m getting much less fix the problems I think I’m having.
I should point out here that I’ve successfully installed the MySQL
System Preferences panel.
It is set to “Automatically Start MySQL Server on Startup”.
When I bring up the MySQL System Preferences panel to have a look, it
sez : “The MySQL Server Instance is running”. The string “running” is
display in a rather attractive lime green color.
It looks to me like I’ve successfully installed MySQL 5.0.45-osx10.4
in the directory “/usr/local/mysql”.
If I ‘cd’ to that directory and enter ‘ls’, I get the following :
COPYING data scripts
EXCEPTIONS-CLIENT docs share
INSTALL-BINARY include sql-bench
README lib support-files
bin man tests
configure mysql-test yo.txt
If I type in : “cd /usr/local/mysql/bin” followed by “ls” the Terminal
window then displays the following :
CMakeLists.txt mysqld-debug
comp_err mysqld_multi
comp_sql.c mysqld_safe
make_sharedlib_distribution mysqldump
make_win_bin_dist mysqldumpslow
make_win_src_distribution mysqlhotcopy
msql2mysql mysqlimport
my_print_defaults mysqlmanager
myisam_ftdump mysqlshow
myisamchk mysqltest
myisamlog mysqltestmanager
myisampack mysqltestmanager-pwgen
mysql mysqltestmanagerc
mysql_client_test ndb_config
mysql_config ndb_cpcd
mysql_convert_table_format ndb_delete_all
mysql_explain_log ndb_desc
mysql_find_rows ndb_drop_index
mysql_fix_extensions ndb_drop_table
mysql_fix_privilege_tables ndb_error_reporter
mysql_fix_privilege_tables_sql.c ndb_mgm
mysql_secure_installation ndb_mgmd
mysql_setpermission ndb_restore
mysql_tableinfo ndb_select_all
mysql_tzinfo_to_sql ndb_select_count
mysql_upgrade ndb_show_tables
mysql_upgrade_shell ndb_size.pl
mysql_waitpid ndb_test_platform
mysql_zap ndb_waiter
mysqlaccess ndbd
mysqlaccess.conf perror
mysqladmin replace
mysqlbinlog resolve_stack_dump
mysqlbug resolveip
mysqlcheck safe_mysqld
mysqld
The directory listing displayed immediately above looks to me like all
the binaries needed for a successful MySQL installation under Mac OSX
are where they’re supposed to be (bearing in mind, of course, that I’m
really pretty much a MySQL ignoramus and I really don’t know what I’m
talking about).
If I open up a Terminal window and type in the following string : “ps -
ax | grep mysql”.
The Terminal window then displays the following text :
215 ?? S 0:00.03 /bin/sh ./bin/mysqld_safe --datadir=/usr/local/
mysql/dat
234 ?? S 0:01.19 /usr/local/mysql/bin/mysqld --basedir=/usr/
local/mysql -
268 p1 U+ 0:00.00 grep mysql
I’m assuming here that this mans the MySQL is running properly. But,
to tell you the truth, I’m too ignorant and inexperienced to really
know whether this is true or not.
On page 30 of BYORORWA Patrick tells me to type into the Terminal
Window : “mysqld”.
When I do that I get the following text displaying in the Terminal
window :
simon-whelans-power-mac-g5:/usr/local/mysql/bin simonwhelan$ mysqld
070802 20:26:26 [Warning] Can’t create test file /usr/local/
mysql-5.0.45-osx10.4-powerpc/data/simon-whelans-power-mac-g5.lower-
test
070802 20:26:26 [Warning] Can’t create test file /usr/local/
mysql-5.0.45-osx10.4-powerpc/data/simon-whelans-power-mac-g5.lower-
test
mysqld: Can’t change dir to ‘/usr/local/mysql-5.0.45-osx10.4-powerpc/
data/’ (Errcode: 13)
070802 20:26:26 [ERROR] Aborting
070802 20:26:26 [Note] mysqld: Shutdown complete
The bottom of page 30 of BYORORW sez I should get text that looks
something like the following :
Welcome to the MySQL monitor. Commands end with : or \g.
Your MySQL connection id is 8 to server version 5.0.45
Type ‘help’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
Clearly something is wrong. The problem is that I don’t know what went
wrong nor do I know how to fix it.
It occurred to me that I might not be entering the right command so I
tried a few others; i.e. :
When I typed in “mysql”, I got :
ERROR 1045 (28000): Access denied for user
‘simonwhelan’@‘localhost’ (using password: NO)
When I typed in “mysql_safe”, I got :
touch: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err:
Permission denied
chown: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err:
Permission denied
Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld_safe: line 380: /usr/local/mysql/data/
simon-whelans-power-mac-g5.local.err: Permission denied
rm: /tmp/mysql.sock: Permission denied
rm: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.pid:
Permission denied
/usr/local/mysql/bin/mysqld_safe: line 386: /usr/local/mysql/data/
simon-whelans-power-mac-g5.local.err: Permission denied
STOPPING server from pid file /usr/local/mysql/data/simon-whelans-
power-mac-g5.local.pid
tee: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err:
Permission denied
070802 20:27:07 mysqld ended
tee: /usr/local/mysql/data/simon-whelans-power-mac-g5.local.err:
Permission denied
When I typed in “mysqltest”, I got :
mysqltest: Could not open connection ‘default’: 1045 Access denied for
user ‘simonwhelan’@‘localhost’ (using password: NO)
not ok
Clearly something is wrong. The problem is, as I’ve said more than
once above I really don’t know enough about what I’m doing to
understand what the problem is much less fix it.
So folks, my questions are :
- What’s wrong; i.e. : why am I not getting text displaying on the
Terminal window more or less like the text that Patrick sez I should
be getting on the bottom of page 30 of BYORORW ? - What do I need to do to fix the problem; i.e. : get text displaying
in my Terminal window that at least displays the text that Patrick
claims I should be getting ?
Any advice, suggestions and help that you could send my way would be
greatly appreciated !
Just think, if I can solve this problem then I can move on to actual
Ruby and Rails problems rather than set up and installation problems !
Oh, Joy !
All the best & I hope to hear from you soon … Simon.