Friday, February 5, 2010

Mistakes by a new Mac guy, When Installing Ruby, Rubygems, Rails, IntegrityApp, Mysql, Apache, Gems etc on Mac OS X 10.5 (Leopard)

Below are some of the mistakes and solutions, I did as a new Mac guy.

  • Couldn't find ruby header files, when installing some gems. Thats because Mac didn't have the Ruby dev package installed. You have to dowload and install Ruby-dev package.
  • Installed apache in /usr/local without knowing Mac comes with an apache. I was changing the http.conf file under /usr/local/apache where trying to start the default installation. Make sure you are changing httpd.conf and running the correct version of apache.
  • When I tried to start Mongrel, got the error "didn't have rails". But when you type rails -v at the terminal, it gave the correct version. I found rails was not completely installed, it was missing some packages, found out using command "gem list". I uninstalled rails gem and installed it again.
  • While installing gems, I got "c compiler not found in path" and "make not found" errors. It is logical to assume mac comes with "c compiler" and "make" when it have built-in ruby. But thats not the case, So, i have to install XCode to fix this issue.
  • Could not install mysql and do_mysql gem because of error in extconfig.h. Reason, it was not finding the mysql installation. I have to run the gem install with couple of special attributes to install it, thanks to the great post http://benr75.com/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard found in google.
  • When installing data_objects gem, had a strange error "couldn't activate data_objects 0.10.0, because 0.10.1 already activated". Looks like I already had the latest version installed and trying to install the old version again. I didn't install the old version.
  • Type mysql in the terminal, it said "command not found". I have to go the installation folder when mysql command is and run from there. Another option is you can add mysql/bin folder to path.
  • Typing mysql, took me to mysql prompt. I am able to see the databases but when I tried to create a new database it said, I didn't have permission. I have to login using command "mysql --user=root"
  • Phusion Passenger with Apache was not working. When I tried the url, it said didn't have permission to access the directory. I had to change "http.conf" to allow the directory browsing for Passenger to work.
  • When tried to run "rake test", got errors saying "cucumber gem was missing", but I already ran "gems:install" and installed all the gems necessary for the rails project. I had to run "sudo rake gems:install RAILS_ENV=test" to install the gems necessary for test environment
Please leave a comment if you find this post helpful.

No comments:

Post a Comment