Smart Phone Tools

About ruby on rails, hackintosh, iphone3g and etc.

Wednesday, February 10, 2010

Postbox discount coupon

Postbox Mac Email Client Discount Coupon. Use this discount coupon to save on Postbox Email Client: R6UYCBW to save $10 on Postbox! http://postbox-inc.com/ref.php?r=R6UYCBW



Click here to save $10 on Postbox

Update: I have been using postbox mac for exactly 1 month now and so far so good. Generally no problem and it has good IMAP support for google apps. Very fast and can search accurately. To get $10 discount, which is 25% savings on the price, click the link here. Mac Email Client PostBox Discount Coupon - 25% OFF

Sunday, January 24, 2010

Add Sources from Github

To add plugin from github, you may encounter problem. Add git hub as gem sources:

gem sources -a http://gems.github.com/


Saturday, January 23, 2010

Install Mysql in Snow Leopard

Download / install the 64-bit MySQL 5.1.37 from mysql.com
run the following commands:

sudo gem update --system

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Tuesday, December 15, 2009

Install Nokogiri on Leopard

If you have this problem:

HI. You're using libxml2 version 2.6.16 which is over 4 years old and has
plenty of bugs. We suggest that for maximum HTML/XML parsing pleasure, you
upgrade your version of libxml2 and re-install nokogiri. If you like using
libxml2 version 2.6.16, but don't like this warning, please define the constant
I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring nokogiri.

Here is the solution:

Install the latest libxml2 and libxslt

Make a source directory somewhere and do the following commands to grab the latest versions of libxml2 and libxslt:

$ curl -O ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz

$ curl -O ftp://xmlsoft.org/libxml2/libxslt-1.1.24.tar.gz

Once done, unpack both like so:

$ tar xzf libxml2-2.7.3.tar.gz

$ tar xzf libxslt-1.1.24.tar.gz

Now change into the libxml directory and build it:

$ ./configure

$ make

$ sudo make install

Now jump back to the libxslt directory and do the same:

$ cd ../libxslt-1.1.24

$ ./configure

$ make

$ sudo make install

If you want, go ahead and delete the sources to save space. Now you’re ready for the final step.

Install Nokogiri

Now installing Nokogiri is super easy once we tell it where to link.

$ sudo gem install nokogiri -- --with-xml2-include=/usr/local/include/libxml2 --with-xml2-lib=/usr/local/lib


Saturday, December 5, 2009

CORE_RL_magick_.dll not found

For Windows Environment Only

This error happens when during installation of ImageMagick, the path is not set, you can set the path manually at my computer, environment.

set PATH: C:\Program Files\ImageMagick-6.5.6-Q8

Upon this, if you still encounter error like R6034, it means the dll has some problem, need to install MS VC++ 2008 Redistributable.


Using RMagick to add text to image

Here is the way to do it:

require 'rubygems'
require 'RMagick'
include
Magick

image
= Image.new(50, 50) {
self.background_color = "white"
}
text
= Draw.new
text
.annotate(image, 0,0,0,40, 'Named Colors') {
self.fill = 'black'
self.pointsize = 32
}
image
.write("image.png")

If you encounter error in mongrel like

Mongrel not starting: `initialize_without_backlog': Cannot assign requested address, it may be because if you use rmagick and the process keeps running as it cannot find the requested font. Then you need to find the process like ruby script/server. look for the process id.

use this command in OSX: ps -ef

look for the line ruby script/server
get the pid (e.g. 925652)
then use this command

kill -9 925652

Installing RMagick in Snow Leopard

This entry is extracted from this blog:http://blog.d27n.com/2009/08/26/mac-os-x-snow-leopard-rails-mysql-and-sphinx/

Today I also got my SnowLeopard copy and updated my 10.5 System to 10.6. Yeah well, as you, I had some problems with the RoR installation but after about 4 hours I finally got it.

In your blog, you asked for some tips about the RMagick installation. First of all, the mentioned script installs some outdated versions, that’s why I used another way. First of all, I installed the current version of MacPorts (for SnowLeopard).

http://distfiles.macports.org/MacPorts/MacPorts-1.8.0-10.6-SnowLeopard.dmg

Then I tried just to install ImageMagick, that failed for me, because of libxml2 compiled for the i386 architecture. So you have to recompile / update it first.

sudo port install libxml2
sudo port install ImageMagick

It was enough for to have a running x64 version of ImageMagick on SL. It could be, that some other libs are compiled in i386, too. Than you have to update it first before compiling ImageMagick.

My next step was the installation of the RMagick gem. It’s maybe a bug, but after my first run of

sudo gem install rmagick

I get the error, that rmagick was configured for a wrong version if ImageMagick, after the second run of the gem install rmagick, I hat a working solution.