<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Seree Woradechjamroen &#187; Application Development</title>
	<atom:link href="http://www.iamseree.com/category/application-development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iamseree.com</link>
	<description>Keep learning everyday, willing to win and take action</description>
	<lastBuildDate>Mon, 02 Jan 2012 19:00:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Configure Postgresql for my Rails Application</title>
		<link>http://www.iamseree.com/application-development/configure-postgresql-for-my-rails-application</link>
		<comments>http://www.iamseree.com/application-development/configure-postgresql-for-my-rails-application#comments</comments>
		<pubDate>Tue, 29 Nov 2011 09:09:02 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Computing Tips]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=677</guid>
		<description><![CDATA[<p>Hi there, This post I want to write as a log of my success on configuring Postgresql database to production for my Rails application. <a href="http://www.iamseree.com/wp-content/uploads/2011/11/PostgreSQL-9.0.1.gif"></a></p> <p>Let&#8217;s get started. I&#8217;ve installed Postgresql 8.4 through apt-get.</p> <p>The first step I do is to change the password of &#8216;postgres&#8217; user.</p> <p>Run the command on root shell.</p> passwd [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there, This post I want to write as a log of my success on configuring Postgresql database to production for my Rails application. <a href="http://www.iamseree.com/wp-content/uploads/2011/11/PostgreSQL-9.0.1.gif"><img class="alignnone size-medium wp-image-678" title="PostgreSQL-9.0.1" src="http://www.iamseree.com/wp-content/uploads/2011/11/PostgreSQL-9.0.1-300x237.gif" alt="" width="300" height="237" /></a></p>
<p>Let&#8217;s get started. I&#8217;ve installed Postgresql 8.4 through apt-get.</p>
<p>The first step I do is to change the password of &#8216;postgres&#8217; user.</p>
<p>Run the command on root shell.</p>
<pre> passwd postgres </pre>
<p>And I usually allow remote access into my Postgresql database. So, I have to edit the file &#8216;/etc/postgresql/8.4/main/pg_hba.conf&#8217; by seeing this line.</p>
<pre> local all all ident </pre>
<p>and change it to&#8230;</p>
<pre> local all all md5 </pre>
<p>Then restart the service.
<pre> /etc/init.d/postgresql-8.4 restart </pre>
<p> The second step I usually do is to install the admin pack.
<pre> su - postgres psql template1 &lt; /usr/share/postgresql/8.4/contrib/adminpack.sql psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';" </pre>
<p> The next step is to create a new database and user to be used by your application. Assume the application is named &#8216;Social Dating&#8217;.
<pre> createdb socialdatingdb createuser socialdatinguser --pwprompt psql socialdatingdb GRANT ALL TO socialdatinguser </pre>
<p> Then you can test CRUD on the database with&#8230;
<pre> psql -U socialdatinguser -W socialdatingdb </pre>
<p> Enjoy Postgresql!</p>
<p>Please share this page to anyone who think it is helpful for them. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/configure-postgresql-for-my-rails-application"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/configure-postgresql-for-my-rails-application/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Set-up Rails 3.1 Applications on Linode</title>
		<link>http://www.iamseree.com/application-development/how-to-set-up-rails-3-1-applications-on-linode</link>
		<comments>http://www.iamseree.com/application-development/how-to-set-up-rails-3-1-applications-on-linode#comments</comments>
		<pubDate>Tue, 29 Nov 2011 08:41:01 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Computing Tips]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=553</guid>
		<description><![CDATA[<p>Hi guys,</p> <p>This thread was written by me to be used as a future reference of mine and I would like to share here for some people who is struggling with setting up Rails applications on their own Linode cloud VPS.</p> <p><a href="http://www.iamseree.com/wp-content/uploads/2011/10/logo.png"></a></p> <p>First of all, let me introduce what is Linode and why I [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>This thread was written by me to be used as a future reference of mine and I would like to share here for some people who is struggling with setting up Rails applications on their own Linode cloud VPS.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/10/logo.png"><img class="alignnone size-full wp-image-554" title="Linode" src="http://www.iamseree.com/wp-content/uploads/2011/10/logo.png" alt="Linode" width="150" height="135" /></a></p>
<p>First of all, let me introduce what is Linode and why I choose it over its alternatives.</p>
<p>Linode is a cloud VPS provider which is quite well known by people who is working on cloud technology.</p>
<p>Linode offer various cheap plans when compared to competitors and its performance is still better from them. (based on the benchmark I found from <a href="http://journal.uggedal.com/vps-performance-comparison/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/journal.uggedal.com/vps-performance-comparison/?referer=');">here</a>)</p>
<p>With just $19.95/mo, I got 20GB disk space, 200GB outgoing bandwidth (now incoming bandwidth is free) and 512MB of memory.</p>
<p>This entry level offer is unbeatable while compared to Slicehost (now bought and managed by Rackspace), Amazon EC2 or Prgmr.</p>
<p>Let&#8217;s me say that before I decide to go with Linode, I&#8217;ve research a lot about Rails application hosting which finally ends up with Heroku because my project has a short time of development and deployment so I can&#8217;t waste my time setting up a box for it.</p>
<p>When the app is live and running smoothly, now I want to improve my ROI and want to make it more cost effective when I demand for more resources.</p>
<p>That&#8217;s the reason why I&#8217;m moving out from Heroku and ends up with Linode.</p>
<p>That&#8217;s a short introduction why I ends up with Linode and now let&#8217;s get started seeing how do I set up a Rails application on Linode cloud VPS successfully.</p>
<h2>How to set-up Rails application on Linode.</h2>
<h3></h3>
<h3><span style="text-decoration: underline;">1st, Sign-up for Linode</span></h3>
<p>Just pick a plan you think it is fit for your needs. For me, the Linode 512 is more than enough by now.</p>
<p>After picked up a plan, you will be asked to enter credit card and choose the data center location, just pick one that close to your target visitors. I saw last time there is Asia data center, anyway, I choose Newark, NJ, USA as my target will be in USA.</p>
<h3><span style="text-decoration: underline;">2nd, Create your Linux node</span></h3>
<p>After sign-up was completely, now I&#8217;m going to create a new node by choosing a linux distribution to be use with. I choose Ubuntu 10.0.4 LTS which is 32-bit because there are many sources saying that 32-bit performance is better than 64-bit of Ubuntu.</p>
<p>Just allocate the disk space and swap size that you think it will fits your needs. For me, I just choose the maximum because I need to setup only single node. If you want to separate database server from your web server, just remain some space for your second node.</p>
<p>After the node was built, just push the &#8220;Boot&#8221; button to start your node now.</p>
<h3><span style="text-decoration: underline;">3rd, connect to your node using SSH</span></h3>
<p>Now click on the &#8220;Remote Access&#8221; tab from your dashboard to see the IP address of your node.</p>
<p>Let&#8217;s see the &#8220;SSH Access&#8221; field, it should have some text like &#8220;ssh root@11.22.33.44&#8243;.</p>
<p>This is the command being used to connect to your node remotely.</p>
<p>Let&#8217;s say you are using Mac OSX or Linux, you can use terminal to execute the command.</p>
<p>Then, enter your specified password and you will ends up connected to your node completely.</p>
<p>Note that, you can remote access into your Linode without entering password by appending your computer&#8217;s public key to Linode&#8217;s authorized keys. This can be done by&#8230;</p>
<ul>
<li>Open up your terminal</li>
<li>If you don&#8217;t have an existing public key (the file &#8216;id_rsa.pub&#8217; in &#8216;~/.ssh/&#8217; folder), then you should do it by issuing this command</li>
</ul>
<div>
<pre>&lt;/div&gt;
&lt;div&gt;ssh-keygen -t rsa -C &quot;youremail@email.com&quot;&lt;/div&gt;
&lt;div&gt;# Note that you will be asked to enter the passphrase. Just enter and remember it.&lt;/div&gt;
&lt;div&gt;</pre>
</div>
<ul>
<li>Run this command to copy the content of your public key to the clipboard &#8216;cat ~/.ssh/id_rsa.pub | pbcopy&#8217;</li>
<li>Now connect to your Linode through ssh</li>
<li>Create a file &#8216;~/.ssh/authorized_keys&#8217; and paste the content of your public key there, then save</li>
</ul>
<div>Now try to logout from ssh and login again and you don&#8217;t need to enter the password any more. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<h3></h3>
<h3><span style="text-decoration: underline;">4th, basic configuration</span></h3>
<p>Begin with updating system, run these commands.</p>
<pre>

apt-get update

apt-get upgrade --show-upgraded
</pre>
<p>Next is to set the host name. This is not actually a host name or domain name you want your Linode to host. It can be anything. Let&#8217;s say I&#8217;ve named it &#8216;mickey&#8217;.</p>
<p>Run the following commands. (don&#8217;t forget to change &#8216;mickey&#8217; to your own host name)</p>
<pre>

echo "mickey" &gt; /etc/hostname

hostname -F /etc/hostname
</pre>
<p>Now it&#8217;s time to update your /etc/hosts file to let them know your host name.</p>
<p>I issue the command &#8216;vi /etc/hosts&#8217; to edit the file.</p>
<p>Add the following lines into the file. (you have to enter your Linode&#8217;s IP address in the first line, and the IPv6 in the second line, also don&#8217;t forget to change &#8216;mickey&#8217; and host name with your desired name)</p>
<pre>

12.34.56.78    mickey.example.com    mickey

1234:1234::1234:1234:1234:1234    mickey.example.com    mickey
</pre>
<p>Next, it&#8217;s time to configure the time zone. I usually set UTC as my time zone for all of my Linodes.</p>
<pre>

dpkg-reconfigure tzdata
</pre>
<p>Select UTC from the list, or just select your desired time zone.</p>
<p>Then you need to make a symbolic link to your time zone info.</p>
<pre>

ln -sf /usr/share/zoneinfo/UTC /etc/localtime
</pre>
<p>If you are using any other time zone than UTC, then you should find your time zone info in the &#8216;/usr/share/zoneinfo/&#8217; directory.</p>
<p>Ok, let&#8217;s go to the next step. I hate ASCII, so I configure my box to use UTF-8 by editing the &#8216;~/.bashrc&#8217; file to include these lines.</p>
<pre>

export LANG="en_US.UTF-8"

export LC_CTYPE="en_US.UTF-8"
</pre>
<p>The basic configuration is completed now.</p>
<h3><span style="text-decoration: underline;">5th, installing Ruby</span></h3>
<p>First, you need to install some pre-requisite libraries.</p>
<pre>

apt-get install build-essential bison openssl libreadline6 libreadline6-dev libcurl4-openssl-dev git-core zlib1g zlib1g-dev  libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev curl
</pre>
<p>Note that the above is a single line command.</p>
<p>If you are using MySQL, you need to execute the following command.</p>
<pre>

apt-get install mysql-server mysql-client
</pre>
<p>Also, if you are using Image Magick library, run this command.</p>
<pre>

apt-get install libmagickwand-dev imagemagick
</pre>
<p>Now it&#8217;s time to install Ruby. I choose to use RVM as it can handle multiple versions of Ruby installation. Run this shell command.</p>
<pre>

bash &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
</pre>
<p>Check if the RVM was installed correctly.</p>
<pre>

type rvm | head -1
</pre>
<p>It should output &#8216;rvm is a function&#8217;. This prove you are correct in this step.</p>
<p>Now I decide to install the latest version of Ruby.</p>
<pre>

rvm install ruby
</pre>
<p>If you want to install the specific version of Ruby, you can do it by&#8230;</p>
<pre>

rvm install ruby-1.9.2
</pre>
<p>Wait a few minutes and it&#8217;s time to configure the default version of Ruby to be used by the Linode.</p>
<pre>

rvm --default use 1.9.2-p290

rvm gem set use global # install gems to this gemset

gem install rdoc

gem install bundler
</pre>
<p>Now it&#8217;s time to install Passenger and Nginx and make it start up at boot.</p>
<pre>

gem install passenger

rvmsudo passenger-install-nginx-module

rvm wrapper 1.9.2-p290@global passenger

curl -L http://bit.ly/nginx-ubuntu-init-file &gt; /etc/init.d/nginx

chmod +x /etc/init.d/nginx

update-rc.d nginx defaults

/etc/init.d/nginx start
</pre>
<p>Wooo Hooo, now my Linode is ready to run Rails app and serve web visitors.</p>
<p>However, for my Linode, I need Postgresql as my production database server. So, I would required to run&#8230;</p>
<pre>

apt-get install postgresql postgresql-contrib

apt-get install libpq-dev

gem install pg
</pre>
<p>Now the box we created is fully packed with Ruby, Nginx, Passenger, it&#8217;s ready now.</p>
<h3><span style="text-decoration: underline;">6th, time to deploy your Rails application</span></h3>
<p>We will deploy using another user than root regards to security reason. Let&#8217;s add one by&#8230;</p>
<pre>

adduser deploy

adduser deploy rvm
</pre>
<p>Then, logout from current ssh session and re-login using the deploy user.</p>
<p>As I&#8217;m using GitHub as my Git server, I need to create a public key for deploy user and add the key to GitHub account.</p>
<p>So, I create a public key by&#8230;</p>
<pre>

ssh-keygen -t rsa -C "youremail@email.com"
</pre>
<p>Then login to GitHub account and add the key (~/.ssh/id_rsa.pub) to the GitHub account.</p>
<p>Also, I copy the token of my GitHub account.</p>
<p>Then I configure my Git.</p>
<pre>

git config --global user.name 'FirstName LastName'

git config --global user.email 'myemail@email.com'

git config --global github.user 'githubusername'

git config --global github.token 012345678901234567890 #change the long digit to your GitHub's token
</pre>
<p><span style="text-decoration: underline;"><strong><em>Now get back to your workstation which you are using to develop your Rails application. (The following steps not being run at your Linode box!)</em></strong></span></p>
<p>This step is not sure if it required or not, so please try at your own risk.</p>
<p>Create a file &#8216;setup_load_paths.rb&#8217; in the &#8216;config&#8217; directory of your Rails application. Then add the following content.</p>
<pre>
if ENV['MY_RUBY_HOME'] &amp;&amp; ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
# RVM is unavailable at this point.
raise "RVM ruby lib is currently unavailable."
end
end

ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
require 'bundler/setup'
</pre>
<p>Then add &#8216;capistrano&#8217; into your Gemfile and run &#8216;bundle install&#8217;.</p>
<p>Now it&#8217;s time to prepare capistrano.</p>
<pre>

capify .
</pre>
<p>Then prepend the following lines in the file &#8216;Capfile&#8217; which was created by the above &#8216;capify&#8217; command.</p>
<pre>

# Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
# Load RVM's capistrano plugin.
require "rvm/capistrano"
# Set it to the ruby + gemset of your app, e.g:
set :rvm_ruby_string, 'ruby-1.9.2-p290@global'

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'

Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks
</pre>
<p>Then edit the file &#8216;deploy.rb&#8217; in the &#8216;config&#8217; directory with this content.</p>
<pre>

set :user, 'deploy'
set :domain, 'myrailsapp.com'
set :application, "myrailsapp"

set :repository, "git@github.com:username/repo.git" # Your clone URL
set :scm, "git"
set :branch, "master"
set :scm_verbose, true
set :deploy_via, :remote_cache
set :scm_passphrase, "password" # The deploy user's password
set :deploy_to, "/home/#{user}/#{domain}"
set :use_sudo, false

require "bundler/capistrano"

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary =&gt; true # This is where Rails migrations will run

namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles =&gt; :app, :except =&gt; { :no_release =&gt; true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end

after "deploy:migrations", "deploy:cleanup"
</pre>
<p>Note that you have to edit each parameters to fit your environment.</p>
<p>Then, you need to configure your Nginx to serve the specified domain name and map to the path to be deployed by capistrano.</p>
<p>Edit the file &#8216;/opt/nginx/conf/nginx.conf&#8217; and add the following lines.</p>
<pre>

server {

listen 80;

server_name *.myrailsapp.com;

root /home/deploy/myrailsapp.com/current/public/;

passenger_enabled on;

}
</pre>
<p>Now it&#8217;s time to deploy your Rails application.</p>
<p>capistrano required you to setup for the first time, so you have to run this command for the first time only.</p>
<pre>

cap deploy:setup
</pre>
<p>Then, it is a time to deploy actual files.</p>
<pre>

cap deploy
</pre>
<p>If you are following the above instructions carefully. You should have a production of your Rails application running now. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers!</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/how-to-set-up-rails-3-1-applications-on-linode"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/how-to-set-up-rails-3-1-applications-on-linode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corona SDK vs cocos2d, What Will You Choose?</title>
		<link>http://www.iamseree.com/application-development/corona-sdk-vs-cocos2d-what-will-you-choose</link>
		<comments>http://www.iamseree.com/application-development/corona-sdk-vs-cocos2d-what-will-you-choose#comments</comments>
		<pubDate>Wed, 14 Sep 2011 16:16:31 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[iPhone development]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cocos]]></category>
		<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[corona]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=547</guid>
		<description><![CDATA[<p>Hi there,</p> <p>Today I&#8217;m going to write a post about what I think on comparing between Corona SDK by anscamobile and Cocos2d framework.</p> <p>As I&#8217;m planning to launch a new project that based on mobile platform primarily on Apple iOS 5, I&#8217;m considering between Corona SDK and cocos2d and I decide to avoid the native [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>Today I&#8217;m going to write a post about what I think on comparing between Corona SDK by anscamobile and Cocos2d framework.</p>
<p>As I&#8217;m planning to launch a new project that based on mobile platform primarily on Apple iOS 5, I&#8217;m considering between Corona SDK and cocos2d and I decide to avoid the native iOS framework because I need to build an app that can differentiate from normal app.</p>
<p>Also, productivity is the point too as these two frameworks can be boost productivity while comparing to the original iOS framework by Apple.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/09/corona-sdk-154x154.png"><img class="alignnone size-full wp-image-548" title="corona-sdk-154x154" src="http://www.iamseree.com/wp-content/uploads/2011/09/corona-sdk-154x154.png" alt="" width="154" height="154" /></a></p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/corona-sdk-vs-cocos2d-what-will-you-choose"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/corona-sdk-vs-cocos2d-what-will-you-choose/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>readline 6.2 Make Error in Mac OS X Lion</title>
		<link>http://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion</link>
		<comments>http://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion#comments</comments>
		<pubDate>Thu, 18 Aug 2011 04:52:39 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[readline]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=544</guid>
		<description><![CDATA[<p>After I&#8217;ve upgraded my Snow Leopard to Lion, I found many things regard to my development environment doesn&#8217;t work anymore.</p> <p>This is including the process to compile the library readline 6.2 which is a need to be done before installing the latest Ruby. (1.9.2-p290)</p> <p>When I try to make, I got the error like this.</p> [...]]]></description>
			<content:encoded><![CDATA[<p>After I&#8217;ve upgraded my Snow Leopard to Lion, I found many things regard to my development environment doesn&#8217;t work anymore.</p>
<p>This is including the process to compile the library readline 6.2 which is a need to be done before installing the latest Ruby. (1.9.2-p290)</p>
<p>When I try to make, I got the error like this.</p>
<p>gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)<br />
i686-apple-darwin11-llvm-gcc-4.2: -compatibility_version only allowed with -dynamiclib<br />
make[1]: *** [libreadline.6.2.dylib] Error 1<br />
make: [shared] Error 2 (ignored)</p>
<p>I wonder why it doesn&#8217;t work because I just did the same to install Ruby 1.9.2-p181 on my old Snow Leopard.</p>
<p>Then, after I research some information through Google.</p>
<p>I found this solution to make it works.</p>
<p>After configured the source code with ./configure &#8211;prefix=/usr/local</p>
<p>Follow this&#8230;</p>
<pre>

cd shlib

sed -e 's/-dynamic/-dynamiclib/' Makefile &gt; Makefile.good

mv Makefile.good Makefile

cd ..

make

sudo make install
</pre>
<p>This works for me and I&#8217;m fairly sure it will works for you too. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Ruby 1.9.2 and Rails 3.1.0 RC on Mac OS X Snow Leopard</title>
		<link>http://www.iamseree.com/application-development/install-ruby-1-9-2-and-rails-3-1-0-rc-on-mac-os-x-snow-leopard</link>
		<comments>http://www.iamseree.com/application-development/install-ruby-1-9-2-and-rails-3-1-0-rc-on-mac-os-x-snow-leopard#comments</comments>
		<pubDate>Mon, 04 Jul 2011 16:50:10 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=508</guid>
		<description><![CDATA[<p>Hi Rubyists,</p> <p>As I&#8217;m going to start a new project using Ruby on Rails and I just found Rails just released a new version as 3.1.0 Release Candidate 4 and will be out as an official release in a few weeks if everything goes well.</p> <p>Well, I&#8217;m going to use my Mac mini as the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Rubyists,</p>
<p>As I&#8217;m going to start a new project using Ruby on Rails and I just found Rails just released a new version as 3.1.0 Release Candidate 4 and will be out as an official release in a few weeks if everything goes well.</p>
<p>Well, I&#8217;m going to use my Mac mini as the primary machine to work on this project as it is a hobby project. (anyway, I have a strategy to make money for me as well)</p>
<p>So, the problem is Mac OS X snow leopard already bundled with Ruby 1.8.7 and we need to upgrade it to version 1.9.2.</p>
<p>First, we need to download the source code of Ruby 1.9.2, compile, install and install Rails 3.</p>
<h2>Here is detailed instructions.</h2>
<p>You need to install readline.</p>
<pre>

curl -O ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz
tar -xvzf readline-6.0.tar.gz
cd readline-6.0
./configure --prefix=/usr/local
make
sudo make install
</pre>
<p>Don&#8217;t concern on some warning, just make sure there is no error.</p>
<p>Next, you need to download Ruby 1.9.2 from <a href="http://www.ruby-lang.org/en/downloads/" onclick="pageTracker._trackPageview('/outgoing/www.ruby-lang.org/en/downloads/?referer=');">http://www.ruby-lang.org/en/downloads/</a></p>
<p>Extract the archive, open a terminal and go to the extracted directory.</p>
<p>Then, execute these lines.</p>
<pre>

./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local --enable-shared
make
sudo make install
sudo make install-doc
</pre>
<p>Then, you need to add this line into your &#8220;~/.bash_profile&#8221; file. (create a new one if it doesn&#8217;t exists)</p>
<pre>

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
</pre>
<p>Close the terminal, open the new one, then check Ruby version using this command.</p>
<pre>

ruby -v
</pre>
<p>You will see it is now version 1.9.2!</p>
<p>Bingo, now just install RubyGems, or if installed, execute this command.</p>
<pre>

gem install rails --pre
</pre>
<p>&#8211;pre state that you want to install a pre-release version which is RC.</p>
<p>So, if Rails 3.1.0 is already an official version, you can ignore &#8211;pre parameter.</p>
<p>Hope this help.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/install-ruby-1-9-2-and-rails-3-1-0-rc-on-mac-os-x-snow-leopard"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/install-ruby-1-9-2-and-rails-3-1-0-rc-on-mac-os-x-snow-leopard/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up xdebug on Zend Server CE on Mac OSX with Symfony 2 framework</title>
		<link>http://www.iamseree.com/application-development/setting-up-xdebug-on-zend-server-ce-on-mac-osx-with-symfony-2-framework</link>
		<comments>http://www.iamseree.com/application-development/setting-up-xdebug-on-zend-server-ce-on-mac-osx-with-symfony-2-framework#comments</comments>
		<pubDate>Sat, 02 Jul 2011 08:53:55 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[xdebug]]></category>
		<category><![CDATA[zend server]]></category>
		<category><![CDATA[zend server ce]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=493</guid>
		<description><![CDATA[<p>Hi symfonians,</p> <p>I think you probably finding for a solution how to install and use xdebug on Zend Server CE on your Mac OSX like me.</p> <p><a href="http://www.iamseree.com/wp-content/uploads/2011/07/xdebug-logo.png"></a></p> <p>First of all, to say, Mac OSX (snow leopard), Zend Server CE and Symfony 2 didn&#8217;t well matched built to work together.</p> <p>At least, not perfect instantly.</p> [...]]]></description>
			<content:encoded><![CDATA[<p>Hi symfonians,</p>
<p>I think you probably finding for a solution how to install and use xdebug on Zend Server CE on your Mac OSX like me.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/07/xdebug-logo.png"><img class="alignnone size-full wp-image-494" title="XDebug" src="http://www.iamseree.com/wp-content/uploads/2011/07/xdebug-logo.png" alt="XDebug" width="200" height="116" /></a></p>
<p>First of all, to say, Mac OSX (snow leopard), Zend Server CE and Symfony 2 didn&#8217;t well matched built to work together.</p>
<p>At least, not perfect instantly.</p>
<p>So, if you want to work on those tools, you have to tweak a little bit of your tool to make it works together.</p>
<p>As Zend Server CE came with its own debugger, Zend Debugger, but someone prefer to use xdebug instead of Zend Debugger as the same as me.</p>
<p>Here are the steps how to make xdebug work on Zend Server CE on Mac OSX with Symfony 2.</p>
<ul>
<li>Open Zend Server page, http://localhost:10081/</li>
<li>Disable &#8220;Zend Debugger&#8221;</li>
<li>Download xdebug.so binary which I suggest to download at -&gt; http://aspn.activestate.com/ASPN/Downloads/Komodo/RemoteDebugging</li>
<li>Extract the archive and browse into &#8217;5.3&#8242; folder then copy &#8216;xdebug.so&#8217; to &#8216;/usr/local/zend/lib/php_extensions&#8217;</li>
<li>Open &#8216;/usr/local/zend/etc/php.ini&#8217; and add the following lines above [zend] section</li>
</ul>
<pre>
zend_extension=/usr/local/zend/lib/php_extensions/xdebug.so
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=”localhost”
xdebug.remote_port=9000
xdebug.show_local_vars=On
xdebug.var_display_max_data=10000
xdebug.var_display_max_depth=20
</pre>
<ul>
<li>Now restart your Zend Server by &#8216;sudo /usr/local/zend/bin/zendctl.sh stop&#8217; and &#8216;sudo /usr/local/zend/bin/zendctl.sh start&#8217;</li>
<li>You should be able to work with xdebug now!</li>
</ul>
<p>To work with xdebug, I personally love the way by JetBrain&#8217;s PhpStorm with their bookmarklet generator, very useful tool.</p>
<p>Hope this help,</p>
<p>Seree</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/setting-up-xdebug-on-zend-server-ce-on-mac-osx-with-symfony-2-framework"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/setting-up-xdebug-on-zend-server-ce-on-mac-osx-with-symfony-2-framework/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Server CE Forbidden Error Working with Virtual Hosts</title>
		<link>http://www.iamseree.com/application-development/zend-server-ce-forbidden-error-working-with-virtual-hosts</link>
		<comments>http://www.iamseree.com/application-development/zend-server-ce-forbidden-error-working-with-virtual-hosts#comments</comments>
		<pubDate>Wed, 29 Jun 2011 05:49:39 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[forbidden]]></category>
		<category><![CDATA[vhost]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend server]]></category>
		<category><![CDATA[zend server ce]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=481</guid>
		<description><![CDATA[<p>As I&#8217;m working on Mac OSX with MAMP before but found difficulty trying to install intl extension.</p> <p>Yup, it is what so wasting time for me to download icu, compile, download php source, compile intl extension, configure and install.</p> <p>Seems wasting too much time if I will do myself, so I decide to switch from [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m working on Mac OSX with MAMP before but found difficulty trying to install intl extension.</p>
<p>Yup, it is what so wasting time for me to download icu, compile, download php source, compile intl extension, configure and install.</p>
<p>Seems wasting too much time if I will do myself, so I decide to switch from MAMP to Zend Server CE (community edition) because Zend Server CE had already bundled all required libraries for Symfony 2 development.</p>
<p>Anyway, after I&#8217;ve added a virtual host into apache, I got many forbidden error which was generated because the default http.conf that specify to deny access from all directories outside of the default document root.</p>
<p>To fix this issue quickly, you have to find the Directory section for &#8216;/&#8217; path and modify to be like this.</p>
<pre>

Options FollowSymLinks

AllowOverride All

Order Deny,Allow

Allow from 127.0.0.1
</pre>
<p>Then restart the apache using zend command like this.</p>
<pre>

sudo /usr/local/zend/bin/apachectl restart
</pre>
<p>It will do the trick now!</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/zend-server-ce-forbidden-error-working-with-virtual-hosts"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/zend-server-ce-forbidden-error-working-with-virtual-hosts/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Doctrine 2 PostRemove and PreRemove Annotation</title>
		<link>http://www.iamseree.com/application-development/doctrine-2-postremove-and-preremove-annotation</link>
		<comments>http://www.iamseree.com/application-development/doctrine-2-postremove-and-preremove-annotation#comments</comments>
		<pubDate>Sat, 25 Jun 2011 20:19:09 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[postremove]]></category>
		<category><![CDATA[preremove]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=471</guid>
		<description><![CDATA[<p>Hi,</p> <p>After I&#8217;ve solved another problem while working with Doctrine 2 in Symfony 2.0 RC1, I would like to make a quick note here about what&#8217;s wrong in the Symfony 2 document about handling file upload using Doctrine&#8217;s Lifecycle callbacks aka @ORM\HasLifecycleCallbacks</p> <p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Doctrine_logo_white.png"></a></p> <p>First of all, when you want to use Lifecycle callbacks, you [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>After I&#8217;ve solved another problem while working with Doctrine 2 in Symfony 2.0 RC1, I would like to make a quick note here about what&#8217;s wrong in the Symfony 2 document about handling file upload using Doctrine&#8217;s Lifecycle callbacks aka @ORM\HasLifecycleCallbacks</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Doctrine_logo_white.png"><img class="alignnone size-full wp-image-453" title="Doctrine" src="http://www.iamseree.com/wp-content/uploads/2011/06/Doctrine_logo_white.png" alt="Doctrine" width="191" height="53" /></a></p>
<p>First of all, when you want to use Lifecycle callbacks, you don&#8217;t have to call $document-&gt;upload() in your controller anymore or your app will throw an error.</p>
<p>Secondly, if you follow the instructions from the document, the app will not work like what you think. When you remove the record, the uploaded file didn&#8217;t get removed too because you are using PostRemove and query for $document-&gt;id within the PostRemove function.</p>
<p>Yup, the PostRemove occurred when the record was removed, so you can&#8217;t access the field id anymore, this is the root cause of error that made the uploaded file didn&#8217;t get removed after the record was removed.</p>
<p>So, if you want to fix this, you should use PreRemove instead of PostRemove which allow you to query for field id before the record get removed.</p>
<p>PreRemove is the place to insert your logic when the remove process occurred for the record. (like cascading delete, update)</p>
<p>Anyway, one thing that I&#8217;m unsure is that what will happen if the record can&#8217;t be removed?</p>
<p>Does the PreRemove will occurred even though the record can&#8217;t be removed?</p>
<p>I will research more about this and will post the update here when I got an answer.</p>
<p>Hope this help you to fix the problem as well.</p>
<p><strong>UPDATED:</strong></p>
<p>If you want to make the symfony 2 handle file upload with Doctrine completely, you should add the uses of PreUpdate and PostUpdate annotation as well.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/doctrine-2-postremove-and-preremove-annotation"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/doctrine-2-postremove-and-preremove-annotation/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Symfony2 File Upload Error &#8211; &#8220;guessExtension() always return nil&#8221;</title>
		<link>http://www.iamseree.com/application-development/symfony2-file-upload-error-guessextension-always-return-nil</link>
		<comments>http://www.iamseree.com/application-development/symfony2-file-upload-error-guessextension-always-return-nil#comments</comments>
		<pubDate>Sat, 25 Jun 2011 09:57:22 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[guessExtension]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=469</guid>
		<description><![CDATA[<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png"></a></p> <p>Symfony 2.0 RC1 was released a few days ago, do not forget to grab it, it is very stable now! </p> <p>Today I&#8217;m facing an error which made me crazy a few hours.</p> <p>I&#8217;m trying to get the file upload on Symfony 2 done but never success on my Windows + wamp machine.</p> [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png"><img class="alignnone size-full wp-image-433" title="Symfony" src="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png" alt="Symfony" width="240" height="60" /></a></p>
<p>Symfony 2.0 RC1 was released a few days ago, do not forget to grab it, it is very stable now! <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Today I&#8217;m facing an error which made me crazy a few hours.</p>
<p>I&#8217;m trying to get the file upload on Symfony 2 done but never success on my Windows + wamp machine.</p>
<p>Yup, like what I&#8217;ve written on the subject, when I try to move the file using UploadedFile-&gt;move() and tell the framework to guess the file extension for me using UploadedFile-&gt;guessExtension().</p>
<p>It always return nil, the getExtension() is working but not useful at all because the uploaded file always be ended with tmp extension.</p>
<p>Even though I can&#8217;t found the solution after researched on Google for a few hours.</p>
<p>Until I try to dig into the symfony source code itself and I finally found it is using php_fileinfo extension!</p>
<p>So, I just resolve my issue by enabling the php_fileinfo extension from wamp and it works!</p>
<p>Wasted my few hours&#8230; Learn new things&#8230;</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/symfony2-file-upload-error-guessextension-always-return-nil"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/symfony2-file-upload-error-guessextension-always-return-nil/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Symfony 2 Error &#8211; &#8220;Class &#8216;ResourceBundle&#8217; Not Found&#8221;</title>
		<link>http://www.iamseree.com/application-development/symfony-2-error-class-resourcebundle-not-found</link>
		<comments>http://www.iamseree.com/application-development/symfony-2-error-class-resourcebundle-not-found#comments</comments>
		<pubDate>Fri, 24 Jun 2011 04:20:55 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[CountryType]]></category>
		<category><![CDATA[intl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=462</guid>
		<description><![CDATA[<p>Hi friends,</p> <p>Just want to post a quick note here to be a troubleshooting guide for my team, I&#8217;m getting an error when trying to use CountryType (a dropdown list with country name display and country code as a value).</p> <p>Got an error like this &#8220;Class &#8216;ResourceBundle&#8217; not found&#8221;.</p> <p>The solution to this issue is [...]]]></description>
			<content:encoded><![CDATA[<p>Hi friends,</p>
<p>Just want to post a quick note here to be a troubleshooting guide for my team, I&#8217;m getting an error when trying to use CountryType (a dropdown list with country name display and country code as a value).</p>
<p>Got an error like this &#8220;Class &#8216;ResourceBundle&#8217; not found&#8221;.</p>
<p>The solution to this issue is just install and enable intl extension for PHP.</p>
<p>As I&#8217;m using wamp, it is very easy for me just point and click to enable intl and it will works like a charm.</p>
<p>For CountryType, it is surprising me as it is easier than Ruby gems to have a country dropdown list in my web application.</p>
<p>Cheers,</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/symfony-2-error-class-resourcebundle-not-found"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/symfony-2-error-class-resourcebundle-not-found/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Submodule Error &#8211; &#8220;already exists in the index&#8221;</title>
		<link>http://www.iamseree.com/application-development/git-submodule-error-already-exists-in-the-index</link>
		<comments>http://www.iamseree.com/application-development/git-submodule-error-already-exists-in-the-index#comments</comments>
		<pubDate>Sun, 19 Jun 2011 06:29:26 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git submodule]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=460</guid>
		<description><![CDATA[<p>Just a post to act as a quick solver if you also got the same error as mine.</p> <p>My environment are&#8230;</p> <p>- A PC which I use to work in day time.</p> <p>- A Mac mini which I use to work in night time.</p> <p>I&#8217;m working on Symfony2 and trying to integrate the AdminBundle by [...]]]></description>
			<content:encoded><![CDATA[<p>Just a post to act as a quick solver if you also got the same error as mine.</p>
<p>My environment are&#8230;</p>
<p>- A PC which I use to work in day time.</p>
<p>- A Mac mini which I use to work in night time.</p>
<p>I&#8217;m working on Symfony2 and trying to integrate the AdminBundle by Sonata and it works quite well last night, in a few minutes, I can add the required submodules of AdminBundle and have the dashboard up and running.</p>
<p>Anyway, after today lunch, I boot up my PC and pull changes from GitHub and I found that my Git submodules didn&#8217;t stay on GitHub and it didn&#8217;t downloaded into my PC.</p>
<p>So I try to figure out about Git submodule and execute the command &#8220;git submodule update&#8221; and &#8220;git submodule sync&#8221;.</p>
<p>Then I got this error&#8230;</p>
<p>The bundle &#8220;<em><strong>already exists in the index</strong></em>&#8221;</p>
<p>Actually, to sync or update the submodule, you need to have .gitmodules at your Git root.</p>
<p>So, I created the file with this content.</p>
<pre>

[submodule "Symfony/src/Knplabs/Bundle/MenuBundle"]
path = Symfony/src/Knplabs/Bundle/MenuBundle
url = git://github.com/sonata-project/MenuBundle.git

[submodule "Symfony/src/Sonata/jQueryBundle"]
path = Symfony/src/Sonata/jQueryBundle
url = git://github.com/sonata-project/jQueryBundle.git

[submodule "Symfony/src/Sonata/BluePrintBundle"]
path = Symfony/src/Sonata/BluePrintBundle
url = git://github.com/sonata-project/BluePrintBundle.git

[submodule "Symfony/src/Sonata/AdminBundle"]
path = Symfony/src/Sonata/AdminBundle
url = git://github.com/sonata-project/AdminBundle.git
</pre>
<p>Then execute the sync/update again and it will checkout the current version of each submodule into my PC.</p>
<p>Then I just install the assets required by bundles with&#8230;</p>
<pre>

&lt;tt&gt;php app/console assets:install web --symlink&lt;/tt&gt;
</pre>
<p>Hope this help.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/git-submodule-error-already-exists-in-the-index"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/git-submodule-error-already-exists-in-the-index/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doctrine Error on Mac OSX &#8211; &#8220;It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.&#8221;</title>
		<link>http://www.iamseree.com/application-development/doctrine-error-on-mac-osx-it-is-not-safe-to-rely-on-the-systems-timezone-settings-you-are-required-to-use-the-date-timezone-setting-or-the-date_default_timezone_set-function</link>
		<comments>http://www.iamseree.com/application-development/doctrine-error-on-mac-osx-it-is-not-safe-to-rely-on-the-systems-timezone-settings-you-are-required-to-use-the-date-timezone-setting-or-the-date_default_timezone_set-function#comments</comments>
		<pubDate>Fri, 17 Jun 2011 19:53:42 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[date.timezone]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=458</guid>
		<description><![CDATA[<p>If you are working on Symfony 2 with Doctrine and getting stuck on &#8220;php app/console doctrine:schema:create&#8221; with this error&#8230;</p> <p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Doctrine_logo_white.png"></a></p> <p>DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or<br /> the date_default_timezone_set() function. In case you used any of those methods and [...]]]></description>
			<content:encoded><![CDATA[<p>If you are working on Symfony 2 with Doctrine and getting stuck on &#8220;php app/console doctrine:schema:create&#8221; with this error&#8230;</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Doctrine_logo_white.png"><img class="alignnone size-full wp-image-453" title="Doctrine" src="http://www.iamseree.com/wp-content/uploads/2011/06/Doctrine_logo_white.png" alt="Doctrine" width="191" height="53" /></a></p>
<p><code>DateTime::__construct(): It is not safe to rely on the system's  timezone settings. You are *required* to use the date.timezone setting  or<br />
the date_default_timezone_set() function. In case you used any of those  methods and you are still getting this warning, you most likely  misspelled the timezone identifier. We selected 'America/Chicago' for  'CDT/-5.0/DST' instead</code></p>
<p>You probably came to the right place!</p>
<p>If you are using MAMP same as me, just modify MAMP&#8217;s php.ini file is not enough to fix this error because when you execute php on the terminal, it uses the php from Mac OSX, not the one that came with MAMP.</p>
<p>So, the solution is to create new php.ini file in /private/etc directory with this content inside.</p>
<pre>

date.timezone = "UTC"
</pre>
<p>This will do the trick!</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/doctrine-error-on-mac-osx-it-is-not-safe-to-rely-on-the-systems-timezone-settings-you-are-required-to-use-the-date-timezone-setting-or-the-date_default_timezone_set-function"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/doctrine-error-on-mac-osx-it-is-not-safe-to-rely-on-the-systems-timezone-settings-you-are-required-to-use-the-date-timezone-setting-or-the-date_default_timezone_set-function/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Doctrine Create Database Error &#8211; &#8220;No such file or directory&#8221;</title>
		<link>http://www.iamseree.com/application-development/doctrine-create-database-error-no-such-file-or-directory</link>
		<comments>http://www.iamseree.com/application-development/doctrine-create-database-error-no-such-file-or-directory#comments</comments>
		<pubDate>Fri, 17 Jun 2011 19:06:55 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=445</guid>
		<description><![CDATA[<p>As I&#8217;m working with Symfony 2 with Doctrine as an ORM and using MySQL as a database.</p> <p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png"></a></p> <p>I found this error when trying to create a database using the command &#8220;php app/console doctrine:database:create&#8221;.</p> <p>I got &#8220;No such file or directory&#8221; error message.</p> <p>After researched, I&#8217;ve found that my MAMP is missing one thing&#8230;</p> [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m working with Symfony 2 with Doctrine as an ORM and using MySQL as a database.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png"><img class="alignnone size-full wp-image-433" title="Symfony" src="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png" alt="Symfony" width="240" height="60" /></a></p>
<p>I found this error when trying to create a database using the command &#8220;php app/console doctrine:database:create&#8221;.</p>
<p>I got &#8220;No such file or directory&#8221; error message.</p>
<p>After researched, I&#8217;ve found that my MAMP is missing one thing&#8230;</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/mamp.jpg"><img class="alignnone size-full wp-image-454" title="MAMP" src="http://www.iamseree.com/wp-content/uploads/2011/06/mamp.jpg" alt="MAMP" width="128" height="128" /></a></p>
<p>When Doctrine is trying to create a new database, it is finding a &#8216;/var/mysql/mysql.sock&#8217; which never exists in my system after MAMP installed.</p>
<p>So, the solution is to create a symbolic link to where the actual mysql.sock stay with this command&#8230;</p>
<p>&#8220;cd /var&#8221;</p>
<p>&#8220;sudo mkdir mysql&#8221;</p>
<p>&#8220;cd mysql&#8221;</p>
<p>&#8220;ln -s /Applications/MAMP/tmp/mysql/mysql.sock mysql.sock&#8221;</p>
<p>Then try to run &#8220;php app/console doctrine:database:create&#8221; again.</p>
<p>It will works! <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>UPDATED:</p>
<p>If you are using Zend Server, you probably found the same error, just do the same but create a symbolic link to &#8220;/usr/local/zend/mysql/tmp/mysql.sock&#8221; instead of MAMP&#8217;s. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/doctrine-create-database-error-no-such-file-or-directory"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/doctrine-create-database-error-no-such-file-or-directory/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What You Might Forget When Running Symfony Application at The First Time And Got Error!</title>
		<link>http://www.iamseree.com/application-development/what-you-might-forget-when-running-symfony-application-at-the-first-time-and-got-error</link>
		<comments>http://www.iamseree.com/application-development/what-you-might-forget-when-running-symfony-application-at-the-first-time-and-got-error#comments</comments>
		<pubDate>Wed, 15 Jun 2011 09:16:56 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[symfony2]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=436</guid>
		<description><![CDATA[<p>I believe almost every newbies to Symfony 2 (one of the best PHP framework) is getting this error at the very first time they try to install Symfony 2 into their web directory and browse it.</p> <p>I also got this error 3-4 times and doubt what&#8217;s wrong with it at the starting of project.</p> <p>Here [...]]]></description>
			<content:encoded><![CDATA[<p>I believe almost every newbies to Symfony 2 (one of the best PHP framework) is getting this error at the very first time they try to install Symfony 2 into their web directory and browse it.</p>
<p>I also got this error 3-4 times and doubt what&#8217;s wrong with it at the starting of project.</p>
<p>Here is what I have done when starting a new project.</p>
<ul>
<li>Copy &#8216;symfony&#8217; folder into my project folder.</li>
<li>Initialize Git using &#8220;git init&#8221;, &#8220;git add&#8221; and create &#8220;git remove&#8221; then &#8220;git commit&#8221; as the initial commit.</li>
<li>Configure httpd(.)conf of apache to create new virtual server at another port, then point the DocumentRoot to &#8216;symfony/web&#8217; directory.</li>
<li>Browse it and BANG! got an error!</li>
</ul>
<p>Well, if you are facing the same thing with me, you probably 99.99% forget a necessary step like me.</p>
<p>It is&#8230;</p>
<p>You forget to execute the vendors(.)php while will download required bundles for your symfony application.</p>
<p>Just bring up a command prompt and execute the command &#8220;php symfony/bin/vendors(.)php&#8221; and wait for a few minutes and browse your application again.</p>
<p>Yes, it will works now. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/what-you-might-forget-when-running-symfony-application-at-the-first-time-and-got-error"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/what-you-might-forget-when-running-symfony-application-at-the-first-time-and-got-error/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Thing to Concern That Made Me Stay Away from Ruby on Rails of My Recent Project&#8230;</title>
		<link>http://www.iamseree.com/application-development/a-thing-to-concern-that-made-me-stay-away-from-ruby-on-rails-of-my-recent-project</link>
		<comments>http://www.iamseree.com/application-development/a-thing-to-concern-that-made-me-stay-away-from-ruby-on-rails-of-my-recent-project#comments</comments>
		<pubDate>Sun, 12 Jun 2011 18:57:08 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[engineyard]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[web framework]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=432</guid>
		<description><![CDATA[<p>Even though, I found Ruby on Rails is a very powerful web application framework.</p> <p>I really love its capabilities which made me able to&#8230;</p> Produce works with less code, much less than any competitive frameworks (Symfony, CodeIgniter, Zend Framework) Fun to code Reuse many interesting Gems etc&#8230; <p>However, when I&#8217;m dealing with the most recent [...]]]></description>
			<content:encoded><![CDATA[<p>Even though, I found Ruby on Rails is a very powerful web application framework.</p>
<p>I really love its capabilities which made me able to&#8230;</p>
<ul>
<li>Produce works with less code, much less than any competitive frameworks (Symfony, CodeIgniter, Zend Framework)</li>
<li>Fun to code</li>
<li>Reuse many interesting Gems</li>
<li>etc&#8230;</li>
</ul>
<p>However, when I&#8217;m dealing with the most recent of my project, I found Ruby on Rails doesn&#8217;t fit for my project for sure.</p>
<p>And the only main reason made me switch from Ruby on Rails to Symfony is&#8230;</p>
<ul>
<li>Ruby on Rails is so complex to deploy on generic hosting companies. (unless you can afford to use a premium Ruby on Rails specific hosting like Heroku or EngineYard)</li>
</ul>
<p>Yeah, my recent project will use shorter time to code if I move on Ruby on Rails, however, I can&#8217;t accept with the difficulties of deployment because this project will be sold to mass users which doesn&#8217;t have enough technical knowledge to deploy Ruby on Rails application easily.</p>
<p>They do not know what is SSH, Nginx, Passenger and so on&#8230;</p>
<p>Also, I can&#8217;t force customers to use Heroku, even I can, my customers still have to face a difficult time to generate a private/public key using SSH as well.</p>
<p>So, I decide to go back and kick off the project using Symfony which is based from PHP.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png"><img class="alignnone size-full wp-image-433" title="Symfony" src="http://www.iamseree.com/wp-content/uploads/2011/06/logo_symfony_header.png" alt="Symfony" width="240" height="60" /></a></p>
<p>My point to write here is that each frameworks today can&#8217;t be compared, for me, it depends on how the framework fit for my post development strategy.</p>
<p>Yes, I&#8217;m using marketing-drive approach.</p>
<p>I&#8217;m not saying Symfony is better than Ruby on Rails or any other frameworks.</p>
<p>But it is very fit for my project&#8217;s strategy.</p>
<p>If today I have to develop an application to work as SaaS or it is hosted at my server only, I will probably choose Ruby on Rails 70-80%.</p>
<p>Because it is fun and less code for me.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/a-thing-to-concern-that-made-me-stay-away-from-ruby-on-rails-of-my-recent-project"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/a-thing-to-concern-that-made-me-stay-away-from-ruby-on-rails-of-my-recent-project/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon S3, Is It Worth for Online Marketing?</title>
		<link>http://www.iamseree.com/internet-marketing/amazon-s3-is-it-worth-for-online-marketing</link>
		<comments>http://www.iamseree.com/internet-marketing/amazon-s3-is-it-worth-for-online-marketing#comments</comments>
		<pubDate>Tue, 07 Jun 2011 11:38:12 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Computing Tips]]></category>
		<category><![CDATA[Internet Marketing]]></category>
		<category><![CDATA[amazon s3]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cloudfiles]]></category>
		<category><![CDATA[content delivery]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[rackspace cloud]]></category>
		<category><![CDATA[rackspace cloudfiles]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=428</guid>
		<description><![CDATA[<p>After I&#8217;ve research about how to deliver content to subscribers with as low as possible latency.</p> <p>I found it is great to have some server to store my contents in the primary region of my subscribers.</p> <p>And the great option I found is to use Amazon S3.</p> What is Amazon S3? <p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Amazon_S3_Online_Service-resized200.gif"></a></p> <p>Amazon S3 [...]]]></description>
			<content:encoded><![CDATA[<p>After I&#8217;ve research about how to deliver content to subscribers with as low as possible latency.</p>
<p>I found it is great to have some server to store my contents in the primary region of my subscribers.</p>
<p>And the great option I found is to use Amazon S3.</p>
<h2>What is Amazon S3?</h2>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Amazon_S3_Online_Service-resized200.gif"><img class="alignnone size-full wp-image-429" title="Amazon S3" src="http://www.iamseree.com/wp-content/uploads/2011/06/Amazon_S3_Online_Service-resized200.gif" alt="Amazon S3" width="200" height="202" /></a></p>
<p>Amazon S3 is a storage server let you upload your contents into it and assure you can deliver your contents to the consumer effectively.</p>
<h2>Why it is effective?</h2>
<p>Because you can specify where you want to store your contents, Amazon S3 have various region of storage server let you choose from and what I expect from region based storage are&#8230;</p>
<ul>
<li>Content delivery speed, it would be fastest if consumer is living at the same region of the content right?</li>
<li>SEO benefit, do you  know Google love the faster web in their SERP? It is said to be one of the factors.</li>
<li>Cost effective, BTW, it is very cheap if you compare to the experiences your consumer getting your contents.</li>
<li>Automatically, I can code my web application to store my contents into it. Programmatically.</li>
</ul>
<p>The alternatives to Amazon S3</p>
<p>If you are looking for alternatives, what I can suggest you to check is Rackspace CloudFiles.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/RackspaceCloudCroppedlogo.jpg"><img class="alignnone size-full wp-image-430" title="Rackspace Cloud" src="http://www.iamseree.com/wp-content/uploads/2011/06/RackspaceCloudCroppedlogo.jpg" alt="Rackspace Cloud" width="630" height="112" /></a></p>
<p>Anyway, Rackspace CloudFiles is better in the term of its delivery capability as actually, it is fully cloud, it is CDN. (Content Delivery Network)</p>
<p>To make it simple, CDN is very effective for a very large content such as video streaming media.</p>
<p>Also, Rackspace always backup with their fanatical support. However, I never have any emergency issue with my Cloud Server yet.</p>
<p>Anyway, Rackspace CloudFiles have a higher price than Amazon S3, you should visit their page and use estimated cost calculator to estimate your cost.</p>
<p>So, you should decide what&#8217;s your primary strategy on content delivery.</p>
<p>Here are links to these services.</p>
<p><a href="http://aws.amazon.com/s3/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/aws.amazon.com/s3/?referer=');">Amazon S3</a></p>
<p><a href="http://www.rackspace.com/cloud/cloud_hosting_products/files/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.rackspace.com/cloud/cloud_hosting_products/files/?referer=');">Rackspace CloudFiles</a></p>
<p>Final words here is, I believe these type of services are totally worth the investment as your consumer will get the great experiences as it can be.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/internet-marketing/amazon-s3-is-it-worth-for-online-marketing"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/internet-marketing/amazon-s3-is-it-worth-for-online-marketing/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>File Upload Handling with Ruby on Rails 3 using Paperclip</title>
		<link>http://www.iamseree.com/application-development/file-upload-handling-with-ruby-on-rails-3-using-paperclip</link>
		<comments>http://www.iamseree.com/application-development/file-upload-handling-with-ruby-on-rails-3-using-paperclip#comments</comments>
		<pubDate>Tue, 07 Jun 2011 06:38:53 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[file attachment]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[peperclip]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[thoughtbot]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=419</guid>
		<description><![CDATA[<p>If you are finding a solution to implement file upload or file attachment, you almost landed to the right place.</p> <p>Here I&#8217;m going to share with you how good paperclip is and why I think this is the best solution I found after working on web application development for over 7 years on almost every [...]]]></description>
			<content:encoded><![CDATA[<p>If you are finding a solution to implement file upload or file attachment, you almost landed to the right place.</p>
<p>Here I&#8217;m going to share with you how good paperclip is and why I think this is the best solution I found after working on web application development for over 7 years on almost every web platform.</p>
<p>After I&#8217;ve learn the basic of Ruby on Rails, I&#8217;m finding for a solution on file upload, even though it can be done through a simple HTML tag, it is not scalable.</p>
<p>How is your project if you are planning to move your web application into the world of Cloud?</p>
<p>With the common HTML file upload tag, you can&#8217;t scale and move your web application into cloud easily.</p>
<p>The paperclip created by thoughtbot, the creator of many favorite Gems.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/thoughtbot.png"><img class="alignnone size-full wp-image-420" title="thoughtbot" src="http://www.iamseree.com/wp-content/uploads/2011/06/thoughtbot.png" alt="thoughtbot" width="200" height="195" /></a></p>
<p>A short features of paperclip are&#8230;</p>
<ul>
<li>It handling MIME type, file size, file name into your existing model</li>
<li>It can automagically generates a different version of original image with different size</li>
<li>You can move your web application into cloud environment immediately</li>
<li>Working with generic file storage, Amazon S3, Rackspace Cloud Files or Heroku</li>
</ul>
<p>Just the above features, I&#8217;ve been convinced to look at it over any other Gems such as attachment_fu which I believe it also good as well.</p>
<p>What your only requirement to use paperclip is only the ImageMagick which available on every platform, I&#8217;ve set the things up and paperclip working in 10 minutes!</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/Screen_shot_2010-04-01_at_10.0.png"><img class="alignnone size-full wp-image-421" title="ImageMagick" src="http://www.iamseree.com/wp-content/uploads/2011/06/Screen_shot_2010-04-01_at_10.0.png" alt="ImageMagick" width="613" height="314" /></a></p>
<p>Here is the quick steps you can follow to make the use of paperclip from you Rails application</p>
<ul>
<li>
<pre>gem install paperclip</pre>
<p> or using the Bundler by adding this line into your Gemfile
<pre>gem 'paperclip'</pre>
</li>
<li>Install ImageMagick, download it from http://www.imagemagick.org</li>
<li>Make sure you have the ImageMagick directory in your environment PATH variable</li>
<li>Edit your model by adding this line into it
<pre>has_attached_file :banner</pre>
<p> (change &#8216;banner&#8217; with your desired members name &#8211; This will tell paperclip to add file uploading into this model)</li>
<li>Generate new migration and add 4 fields into the table, the code will look like this&#8230;</li>
<li>
<pre>class AddImagesToTable &lt; ActiveRecord::Migration
def self.up
add_column : offers, :banner_file_name, :string
add_column : offers, :banner_content_type, :string
add_column : offers, :banner_file_size, :integer
add_column : offers, :banner_updated_at,   :datetime
end&nbsp;

def self.down
remove_column : offers, :banner_file_name
remove_column : offers, :banner_content_type
remove_column : offers, :banner_file_size
remove_column : offers, :banner_updated_at
end
end</pre>
</li>
<li>Migrate the database!
<pre>rake db:migrate</pre>
</li>
<li>Modify the form tag, add multipart attribute&#8230;
<pre>&lt;%= form_for(@post, :html =&gt; {:multipart =&gt; true}) do |f| %&gt;</pre>
</li>
<li>Place the file upload object inside the form tag
<pre>&lt;%= f.file_field :banner %&gt;</pre>
</li>
<li>Now you can run and upload the file into the model!</li>
<li>If you want to render the file, use this piece of code
<pre>&lt;%= image_tag @post.banner.url %&gt;</pre>
</li>
</ul>
<p>That&#8217;s all the basic sample how to use paperclip, it is surprisingly easy for me.</p>
<p>If you are looking for advanced features of paperclip, visit the project page at Github and you will get everything.</p>
<p>Hope this help.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/file-upload-handling-with-ruby-on-rails-3-using-paperclip"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/file-upload-handling-with-ruby-on-rails-3-using-paperclip/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Am I Moved to Open Source World of Application Development?</title>
		<link>http://www.iamseree.com/application-development/am-i-moved-to-open-source-world-of-application-development</link>
		<comments>http://www.iamseree.com/application-development/am-i-moved-to-open-source-world-of-application-development#comments</comments>
		<pubDate>Mon, 06 Jun 2011 04:57:24 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=416</guid>
		<description><![CDATA[<p>It is weird to say, but after I&#8217;ve employed myself and coding various projects.</p> <p>I found that I almost moved my resources from what all based on Microsoft technology to the world of open source.</p> <p>And I found the productivity level still acceptable with a good selection of technologies.</p> <p>I found the open source application [...]]]></description>
			<content:encoded><![CDATA[<p>It is weird to say, but after I&#8217;ve employed myself and coding various projects.</p>
<p>I found that I almost moved my resources from what all based on Microsoft technology to the world of open source.</p>
<p>And I found the productivity level still acceptable with a good selection of technologies.</p>
<p>I found the open source application development didn&#8217;t as bad as I think from the previous.</p>
<p>Even I&#8217;ve many high level of certification by Microsoft on application design, development. (MCPD, MCTS, MCSD, MCAD and so on&#8230;) I still quite happy to say that I&#8217;m happy entering into the world of open source today.</p>
<p>As my most projects are built as a web application, I mainly moved from ASP.NET MVC 3 to Rails 3.</p>
<p>Even I&#8217;ve spent some time learning Ruby, I&#8217;m very happy with it, I love Ruby on Rails 3 over ASP.NET MVC 3. Much.</p>
<p>Ruby on Rails was built for high level of productivity in every aspect of it, that&#8217;s why I love RoR over ASP.NET MVC.</p>
<p>What I love on ASP.NET MVC is just it gives me control on everything of my web application.</p>
<p>I can hook and customize almost everything in the pipeline with ASP.NET MVC while I can focus on business value more in RoR.</p>
<p>Source code control, while I&#8217;m working on Visual Studio 2010, I decide to ignore Visual Source Safe as it will load my time, I&#8217;ve to setup the server and else&#8230;</p>
<p>While in open source world, I choose Git, and I&#8217;m not setting up it myself as I decide to work with GitHub.com and pay them to get some number of private repositories.</p>
<p>It is cool and by far easy to use.</p>
<p>For the coding IDE, nothing can beat the experiences got from Visual Studio. I tried Aptana Studio 3, RubyMine and no one can beat Visual Studio 2010!</p>
<p>While I&#8217;ve chosen JetBrains RubyMine as my primary IDE for RoR, I still need to use command-line to complete various things on RoR.</p>
<p>Another note, I really love Ruby Gems, the Bundler things&#8230; as I don&#8217;t have to find and pay for 3rd party components to integrate into my app, it almost FREE in RoR while in ASP.NET, it have been charged! High price!</p>
<p>Wow, after 3 months of self employed, I found I moved to open source platform surprisingly. I think I should consider to move more on open source world.</p>
<p>Here is my current development environment</p>
<p>My primary machine</p>
<ul>
<li>PC with Windows 7 x64</li>
<li>Ruby</li>
<li>RubyGems + Rails 3</li>
<li>JetBrains RubyMine</li>
<li>Git</li>
</ul>
<p>My secondary machine</p>
<ul>
<li>Mac Mini with OS X Snow Leopard</li>
<li>Ruby</li>
<li>RubyGems + Rails 3</li>
<li>JetBrains RubyMine</li>
<li>Git</li>
</ul>
<p>I&#8217;m planning to give my primary PC to my son and getting new iMac with Macbook Pro 17&#8243; for further development.</p>
<p>Good bye to Windows?</p>
<p>- Absolutely no because some of my Internet marketing tools still rely on Windows OS. (Scrapebox &#8211; who can live without it?)</p>
<p>- At least, I should have a one copy of Windows on my virtual machine application.</p>
<p>Talk soon,</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/am-i-moved-to-open-source-world-of-application-development"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/am-i-moved-to-open-source-world-of-application-development/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 3 DESTROY did not work! The solution&#8230;</title>
		<link>http://www.iamseree.com/application-development/rails-3-destroy-did-not-work-the-solution</link>
		<comments>http://www.iamseree.com/application-development/rails-3-destroy-did-not-work-the-solution#comments</comments>
		<pubDate>Sun, 05 Jun 2011 19:08:12 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ror destroy]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=405</guid>
		<description><![CDATA[<p>Hi there,</p> <p>If you are just beginning with Rails 3 and found some difficulty that made your rails app&#8217;s DESTROY command didn&#8217;t work for your scaffold views.</p> <p>I think this is a quick troubleshooting guide with solution to get pass this stupid thing.</p> Problem #1 : You didn&#8217;t included the default Rails javascript files. <p>- [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p>If you are just beginning with Rails 3 and found some difficulty that made your rails app&#8217;s DESTROY command didn&#8217;t work for your scaffold views.</p>
<p>I think this is a quick troubleshooting guide with solution to get pass this stupid thing.</p>
<h2>Problem #1 : You didn&#8217;t included the default Rails javascript files.</h2>
<p>- Please make sure you have something like
<pre>javascript_include_tag :defaults</pre>
<p> or at least
<pre>javascript_include_tag 'prototype', 'rails'</pre>
<p>- Because the generated view for DESTROY command is based on those libraries and rails is using Prototype be default.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/prototype.gif"><img class="alignnone size-full wp-image-407" title="prototype" src="http://www.iamseree.com/wp-content/uploads/2011/06/prototype.gif" alt="prototype" width="176" height="82" /></a></p>
<h2>Problem #2 : Javascript conflicted between Prototype and jQuery.</h2>
<p>- Because rails is using Prototype as default javascript library, so, if your view is using jQuery, when you&#8217;ve include both jQuery and Prototype, the DESTROY command will broke!</p>
<p>- Good thing is that Rails 3 is allow you to switch from Prototype to jQuery, the most easiest approach I found is to install gem &#8216;jquery-rails&#8217; via your terminal or using Gemfile.</p>
<p>- After the gem was installed, run the command
<pre>rails g jquery:install</pre>
<p> This will remove prototype and add jQuery into your project tree, if you are using Git, don&#8217;t forget to add those newly added files into your Git.</p>
<p>- Now just include the correct libraries, what I did is&#8230;</p>
<pre>

javascript_include_tag 'jquery.min.js',
'jquery_ujs', ...
</pre>
<p>The DESTROY command should work now without breaking your jQuery integrated views.</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/jquery-logo.gif"><img class="alignnone size-full wp-image-408" title="jquery-logo" src="http://www.iamseree.com/wp-content/uploads/2011/06/jquery-logo.gif" alt="jQuery" width="168" height="146" /></a></p>
<h2>Problem #3, missing of &lt;%= csrf_meta_tag %&gt;</h2>
<p>Just in case if you are developing new app with new template, you might forget to include Cross Site Request Forgery tag, DESTROY command will not work, all sessions will be cleared without telling you what&#8217;s wrong.</p>
<p>This is because you are forgot to include the
<pre>&lt;%= csrf_meta_tag %&gt;</pre>
<p> in your template.</p>
<p>Hope this help.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/rails-3-destroy-did-not-work-the-solution"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/rails-3-destroy-did-not-work-the-solution/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Heroku Deployment Error =&gt; fatal: &#8216;heroku&#8217; does not appear to be a git repository</title>
		<link>http://www.iamseree.com/application-development/heroku-deployment-error-fatal-heroku-does-not-appear-to-be-a-git-repository</link>
		<comments>http://www.iamseree.com/application-development/heroku-deployment-error-fatal-heroku-does-not-appear-to-be-a-git-repository#comments</comments>
		<pubDate>Wed, 01 Jun 2011 04:14:40 +0000</pubDate>
		<dc:creator>Seree</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[heroku deployment]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.iamseree.com/?p=397</guid>
		<description><![CDATA[<p>While I&#8217;m exciting how much productivity was improved while using Ruby on Rails to code my web application, I found that it is quite hard to deploy the app, much harder than any traditional framework I found!</p> <p>I almost success with Rails application deployment on shared hosting account at HostGator, but when the thing error, [...]]]></description>
			<content:encoded><![CDATA[<p>While I&#8217;m exciting how much productivity was improved while using Ruby on Rails to code my web application, I found that it is quite hard to deploy the app, much harder than any traditional framework I found!</p>
<p>I almost success with Rails application deployment on shared hosting account at HostGator, but when the thing error, I can&#8217;t find where to see error logs.</p>
<p>No logs = No way to solve the problem easily.</p>
<p>So, I&#8217;ve did some research on Ruby on Rails deployment and found some cool deployment related platform, tools which I would like to list here.</p>
<ul>
<li>Heroku &#8211; RoR deployment platform</li>
<li>EngineYard &#8211; RoR deployment platform</li>
<li>Capistrano &#8211; tool</li>
<li>RackspaceCloud &#8211; cloud server with ROI in mind in long run</li>
</ul>
<p>From what I&#8217;ve learned and tried&#8230;</p>
<p>Nothing easier than Heroku, with just a few Git commands, you can have your app running in 5 minutes!</p>
<p><a href="http://www.iamseree.com/wp-content/uploads/2011/06/herokulogo1.jpg"><img class="alignnone size-full wp-image-399" title="Heroku" src="http://www.iamseree.com/wp-content/uploads/2011/06/herokulogo1.jpg" alt="Heroku" width="185" height="73" /></a></p>
<p>These are commands you need to use with Heroku.</p>
<ul>
<li>gem install heroku (install through RubyGems &#8211; sudo if needed)</li>
<li>heroku create your_app_name (create an application on Heroku)</li>
<li>git push heroku master (deploy to Heroku)</li>
</ul>
<p>Your app will be ready at your_app_name.heroku.com.</p>
<p>Anyway, as I&#8217;m working in two places, my working room at day using Windows and bed room at night using Mac.</p>
<p>I control my source code through GitHub and first created Heroku app at my Mac.</p>
<p>Everything is fine, app can be deployed and running very quickly, I&#8217;m very exciting.</p>
<p>However, today I&#8217;ve modified my app at my Windows machine and try to deploy&#8230; I found&#8230;</p>
<ul>
<li>I can push everything into GitHub properly.</li>
<li>I can not push/deploy to Heroku with the error =&gt; fatal: &#8216;heroku&#8217; does not appear to be a git repositiry</li>
</ul>
<p>My hair losses for a night after I&#8217;ve found a solution.</p>
<p>Let&#8217;s discuss about Heroku command.</p>
<pre>heroku create your_app_name</pre>
<p>This command will try to create an app at Heroku server and seeing if you already had &#8216;heroku&#8217; repository or not, if &#8216;heroku&#8217; repository doesn&#8217;t exists in your local Git. The command will create the &#8216;heroku&#8217; repository of the active branch for you.</p>
<p>And this is the reason why I can&#8217;t deploy through my Windows machine as I didn&#8217;t run the <strong>heroku create</strong> command on this machine. I run it on my Mac.</p>
<p>So, if you are facing the same error as I got, please check if you already had the &#8216;heroku&#8217; repo or not. By using this command.</p>
<pre>git remote -v</pre>
<p>I think you didn&#8217;t saw the &#8216;heroku&#8217; repo there. So, to resolve the issue, please add &#8216;heroku&#8217; repo manually using this command.</p>
<pre>git remote add heroku git@heroku.com:your_app_name.git</pre>
<p>Then, you will be able to do&#8230;</p>
<pre>git push heroku master</pre>
<p>This will help you solve the problem. <img src='http://www.iamseree.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you still got an error message, but not the same, might be &#8220;permissions denied (publickey)&#8221;, you might need to add keys to let Heroku know by this command.</p>
<pre>heroku keys:add</pre>
<p>Hope this help.</p>
<div align="left" style="float: ; padding: 5px 5px 0px 0px;"><a name="fb_share" type="button" share_url="http://www.iamseree.com/application-development/heroku-deployment-error-fatal-heroku-does-not-appear-to-be-a-git-repository"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.iamseree.com/application-development/heroku-deployment-error-fatal-heroku-does-not-appear-to-be-a-git-repository/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

