Showing posts with label macbook. Show all posts
Showing posts with label macbook. Show all posts

Saturday, June 28, 2008

Gems Gems everywhere!

Today, I set out to upgrade my MacBook Pro to a full fledged dev machine. For this, I added XCode Tools and about a dozen 10 Ruby gems plus ImageMagick which proved to be a bit hairy.

Here we go...

Last login: Fri Jun 27 22:14:41 on console
Macintosh-2:RailsProjects roupen$ sudo gem install RubyInline
Updating metadata for 528 gems from http://gems.rubyforge.org/
...............................................................................complete
Successfully installed rubyforge-1.0.0
Successfully installed hoe-1.6.0
Successfully installed RubyInline-3.7.0
3 gems installed
Installing ri documentation for rubyforge-1.0.0...
Installing ri documentation for hoe-1.6.0...
Installing ri documentation for RubyInline-3.7.0...
Installing RDoc documentation for rubyforge-1.0.0...
Installing RDoc documentation for hoe-1.6.0...
Installing RDoc documentation for RubyInline-3.7.0...


Cool, 3 birds with 1 stone.

Macintosh-2:RailsProjects roupen$ gem install log4r
Successfully installed log4r-1.0.5
1 gem installed
Installing ri documentation for log4r-1.0.5...
Installing RDoc documentation for log4r-1.0.5...
Macintosh-2:RailsProjects roupen$ gem install dsl_accessor

Successfully installed activesupport-2.1.0
Successfully installed dsl_accessor-0.1.0
2 gems installed
Installing ri documentation for activesupport-2.1.0...
Installing ri documentation for dsl_accessor-0.1.0...
Installing RDoc documentation for activesupport-2.1.0...
Installing RDoc documentation for dsl_accessor-0.1.0...


Cool, 2 birds with 1 stone.

Next, i installed google-geocode but it turns out I didn’t need it so I uninstalled it (Murali ;-) ).

Macintosh-2:RailsProjects roupen$ gem install google-geocode
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/bin directory.
Macintosh-2:RailsProjects roupen$ sudo gem install google-geocode
Password:
Successfully installed ZenTest-3.10.0
Successfully installed rc-rest-2.2.1
Successfully installed google-geocode-1.2.1
3 gems installed
Installing ri documentation for ZenTest-3.10.0...
Installing ri documentation for rc-rest-2.2.1...
Installing ri documentation for google-geocode-1.2.1...
Installing RDoc documentation for ZenTest-3.10.0...
Installing RDoc documentation for rc-rest-2.2.1...
Installing RDoc documentation for google-geocode-1.2.1...
Macintosh-2:RailsProjects roupen$ sudo gem uninstall google-geocode
Successfully uninstalled google-geocode-1.2.1
Macintosh-2:RailsProjects roupen$ sudo gem uninstall zentest
ERROR: While executing gem ... (Gem::InstallError)
Unknown gem zentest->= 0
Macintosh-2:RailsProjects roupen$ sudo gem uninstall ZenTest

You have requested to uninstall the gem:
ZenTest-3.10.0
rc-rest-2.2.1 depends on [ZenTest (>= 3.4.2)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] n
ERROR: While executing gem ... (Gem::DependencyRemovalException)
Uninstallation aborted due to dependent gem(s)
Macintosh-2:RailsProjects roupen$ sudo gem uninstall rc-rest
Successfully uninstalled rc-rest-2.2.1
Macintosh-2:RailsProjects roupen$ sudo gem uninstall ZenTest
Successfully uninstalled ZenTest-3.10.0
Remove executables:
autotest, multiruby, multiruby_setup, rails_test_audit, unit_diff, zentest

in addition to the gem? [Yn] Y
Removing autotest
Removing multiruby
Removing multiruby_setup
Removing rails_test_audit
Removing unit_diff
Removing zentest

A quick visual check…

Macintosh-2:RailsProjects roupen$ gem list

*** LOCAL GEMS ***

actionmailer (2.0.2, 1.3.6)
actionpack (2.0.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.0.2, 1.15.6)
activeresource (2.0.2)
activesupport (2.1.0, 2.0.2, 1.4.4)
acts_as_ferret (0.4.1)
capistrano (2.0.0)
cgi_multipart_eof_fix (2.2)
daemons (1.0.7)
dnssd (0.6.0)
dsl_accessor (0.1.0)
fastthread (1.0)
fcgi (0.8.7)
ferret (0.11.4)
gem_plugin (0.2.2)
highline (1.2.9)
hoe (1.6.0)
hpricot (0.6)
libxml-ruby (0.3.8.4)
log4r (1.0.5)
mongrel (1.0.1)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.2)
rails (2.0.2, 1.2.6)
rake (0.8.1, 0.7.3)
RedCloth (3.0.4)
ruby-openid (1.1.4)
ruby-yadis (0.3.4)
rubyforge (1.0.0)
rubygems-update (1.1.1)
RubyInline (3.7.0)
rubynode (0.1.3)
sqlite3-ruby (1.2.1)
termios (0.9.4)

Carry on…

Macintosh-2:RailsProjects roupen$ sudo gem install image_science
Password:
Successfully installed image_science-1.1.3
1 gem installed
Installing ri documentation for image_science-1.1.3...
Installing RDoc documentation for image_science-1.1.3...
Macintosh-2:RailsProjects roupen$


Time for ImageMagick.

See this go to section about Mac OS X binary release.


Download ImageMagick-universal-apple-darwin9.3.0.tar.gz and copy to /Users/roupen or somewhere permanent because you’re going to point environment variables to here.

tar xvfz ImageMagick-universal-apple-darwin9.3.0.tar.gz
rm ImageMagick-universal-apple-darwin9.3.0.tar.gz

You should see a new dir /Users/roupen/ImageMagick-6.4.1

Next, set some env variables


export MAGICK_HOME="$HOME/ImageMagick-6.4.1"
export PATH="$MAGICK_HOME/bin:$PATH"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"

Run a quick test to make sure ImageMagick is working

Macintosh-2:~ roupen$ cd
Macintosh-2:~ roupen$ pwd
/Users/roupen
Macintosh-2:~ roupen$ convert
Version: ImageMagick 6.4.1 06/12/08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

UPDATE

I had some problems getting RMagick going – the issue is well covered in discussions on the web. So I backed away from installing image_magic and then the rmagick gem separately. I deleted the image_magic directory and well rmagick never installed.

The NEW path that paid off is described here using rmagick-osx-installer. Search for How do I install RMagick on OS X? on this page for details.

As described in the README for the rmgaick_osx_installer, I first installed XCode Tools and X11SDK off the MacBook Pro DVD. After that, I installed the script and it took a while but it was very uneventful.

libpng was installed successfully
libjpeg was installed successfully
ghostscript was installed successfully
ghostscript-fonts-std was installed successfully
FreeType was installed successfully
libwmf was installed successfully
ImageMagick was installed successfully
RMagick was installed successfully
Removing rm_install_tmp directory...Done


I think I am done. The convert test passed.

Macintosh-2:rm_install-1.1.1 roupen$ convert
Version: ImageMagick 6.4.2 06/28/08 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

I got real close to using MacPorts for this last step but didn’t (felt heavy handed).

Read more...

Thursday, March 20, 2008

The Leopard, the Noob and MySQL

After much waiting, I go another Macbook Book Pro last week. The machine has 2.4GHz Intel core 2 Duo 2GB RAM 200GB HD and is running Max OS X v 10.5.2. Thanks to Carlos for pitching in the F&F Apple Discount (obrigado muito). After moving documents off the Vaio, next came the decision - to buy or not to buy Microsoft Office. I downloaded OpenOffice for Mac but my experience was so-so. Every time I launched OpenOffice, an X11 console window would pop-up (and an icon would appear in the Doc yuk). Moreover, OpenOffice would timeout (apparently waiting for X11 to start) and then things would work Ok. I read up on it and it turns out this is an issue with OpenOffice and Max OS X until the native version due out "later this year". My faith shaken, I went ahead and ordered MS Office online... Luckly, the following day, Suren clued me on NeoOffice and it is just perfect. So I canceled my order so I am still 100% MS free.

Next came the Rails environment. If you're into Raisl and Leopard, you know that Ruby, Rails, Mongrel, Sqlite3 and SVN come pre-installed with Leopard. Its all good and it all worked out of the box. HOWEVER, I wanted to get on MySQL since the others I am collaborating with on a project are also on it... This is where things got interesting.

First, the question was -- which version to install? Answer: Go with v 5.0.51a MySQL 5.0 Community Server - GA release. There is an alpha of version 5.2 and 6.0 but I opted for the GA (Generally Available) release.

The release comes with two packages: 1) mysql-5.0.51a-osx10.5-x86.pkg this is the server 2) MySQLStartupItem.pkg this is a bit which along with MySQL.perfPane that comes in the installation (disk image as its called) allows you to start and stop the server from a graphic interface. This is when the plot thickened.

The first package (server) installed without incidents. I was able to tickle the server using the following command line commands:

shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safe (ENTER YOUR PASSWORD, IF NECESSARY)(PRESS CONTROL-Z) shell> bg (PRESS CONTROL-D OR ENTER "EXIT" TO EXIT THE SHELL)
Meanwhile, I had been reading blogs and forum posts on the subject and it was becoming clearer that something was up with MySQL and Leopard (people talking about stuff not starting and not being installed properly) I soon found out.The time to install the second package (MySQLStartupItem) which I did and it went ahead through the usual installer wizard steps and congratulated me on a successful installation. But when I tried to use the Startup Item to start MySQL using the command below it was no dice.
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
It turns out there is nothing under /StartupItems Gaah! The package installs /MySQLCOM under /usr/local/ go figure.

After much reading and pocking around, I came across bug 25008 on the MySQL site. The bug was first opened 12 Dec 2006 (title: Mac OS X's StartupItem does not work) and has been alive since. On Feb 7, 2008, 7 one Andrew Lindley reported the identical problem to mine.

After a few exchanges with one Mattias Jonsson, it turns out that a fix is to 1) move the MySQLCOM directory to the right place 2) Install and use a corrected MySQL.prefPane

However, if you are a newb like me, you may have trouble with the "mv" command. Thanks to Mattias, the correct syntax for this is
sudo mv /usr/local/MySQLCOM /Library/StartupItems/
The other newb thing I couldn't do is add usr/local/mysql/bin to my bash shell PATH so that I could start mysqladmin from the command line. Everything I read assumed that I knew where the said profile file needs to go. So the right thing to do here is create a .bash_profile file under /Users/ Many thanks to Jeff McLeman for guiding me through this.

The contents of the .bash_profile file as follows:
PATH=$PATH:/usr/local/mysql/bin
MANPATH=$MANPATH:/usr/local/mysql/man
The last newb thing I had to figure out is where/what the "Perf Panel" is that you're supposed to use to start/stop the server. Again, thanks to Mattias, it turns out that this is nothing more than good 'ol "System Preferences". If all went well, launch it and you should see a MySQL icon under "Other". See?


Picture 1
Originally uploaded by roupen


So moral of the story :) In 10+ years since I used Unix little has changed in the once analogy I read about Unix in an article title "if airlines were operating systems" . Its still a lot of hacking, haggling, heckling and friends helping friends. In the end, it all worked out and its all open source and $FREE$. Yey!.

Read more...

Friday, January 25, 2008

A fly in my cloud-computing ointment

So I've been happily using Gmail and Google Calendar (along with Google Docs) and enjoying my cloud computing bliss without Microsoft Office and Outlook.

Starting yesterday, however, Google Calendar has been acting-up for me on Firefox 2.0 running Windows XP. Note that the problem doesn't happen on IE (which I have also gave up on a while back).

The problem I am having is as follows - unfortunately - and this has rendered Google Calendar unusable under Firefox :(

I start Gmail and click on Calendar and the Ajax thing starts to happen... the lower left hand corner of the browser starts to show frantic activity (contacting google.com etc) and Firefox hour glass is there - all looks normal - EXCEPT I never come out of this state. Sometimes, I get the Calendar login screen often not. It just sits there...

I tried rebooting... restarting firefox... uh-ah, not working and that sucks!

Worse comes to worse, I am planning to move to an Apple MacBook soon and maybe/probably that will solve this issue. Just waiting for the new MacBook Pros with multi-touch...



Google Calendar not happning on FireFox from roupen nahabedian on Vimeo.

Read more...