<?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>Dhaval Parikh</title>
	<atom:link href="http://blog.dhavalparikh.co.in/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dhavalparikh.co.in</link>
	<description>Ruby on Rails, Stock Markets, Technology news and info - Its all about my passion</description>
	<lastBuildDate>Wed, 25 Jan 2012 07:06:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>solve no such file to load &#8212; openssl error</title>
		<link>http://blog.dhavalparikh.co.in/2011/10/solve-no-such-file-to-load-openssl-error/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/10/solve-no-such-file-to-load-openssl-error/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 10:33:20 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[open ssl error]]></category>
		<category><![CDATA[openssl + ruby]]></category>
		<category><![CDATA[openssl + ubuntu]]></category>
		<category><![CDATA[openssl error]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=344</guid>
		<description><![CDATA[Hi all Was updating one server with rails 2.2.2 to rails 2.3.8. I upgraded ruby from 1.8.6 to 1.8.7 and also rubygems to 1.3.4 version from a source. When i did ruby script/server to start the server I got this error no such file to load &#8212; openssl After a 15 mins R&#038;D i found [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all</p>
<p>Was updating one server with rails 2.2.2 to rails 2.3.8. I upgraded ruby from 1.8.6 to 1.8.7 and also rubygems to 1.3.4 version from a source. When i did ruby script/server to start the server I got this error no such file to load &#8212; openssl</p>
<p>After a 15 mins R&#038;D i found that this usually happens on an Ubuntu machine (which it was in my case). The solution is as follows</p>
<p>First install libssl using </p>
<p>sudo apt-get install libssl-dev</p>
<p>Than go to the source of ruby and go to the following path</p>
<p>cd ext/openssl</p>
<p>Run the command one after the others.</p>
<p>ruby extconf.rb<br />
make<br />
sudo make install</p>
<p>Now try to do ruby script/server again&#8230;&#8230;and boooooooom! solved.. Even after trying this you are stuck let me know I shall help you out.</p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/10/solve-no-such-file-to-load-openssl-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install VNC server on Ubuntu Server</title>
		<link>http://blog.dhavalparikh.co.in/2011/09/install-vnc-server-on-ubuntu-server/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/09/install-vnc-server-on-ubuntu-server/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 10:49:57 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[vnc + ubuntu]]></category>
		<category><![CDATA[vnc on ubuntu]]></category>
		<category><![CDATA[vnc server on ubuntu]]></category>
		<category><![CDATA[vnc server ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=339</guid>
		<description><![CDATA[Hi all sometimes VNC is really useful when you want to access the remote server. Though every thing can be done via command prompt but sometimes a GUI is useful (Atleast I find it useful). Now if you want to do that here are the steps you need to follow. As you know that most [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all</p>
<p>sometimes VNC is really useful when you want to access the remote server. Though every thing can be done via command prompt but sometimes a GUI is useful (Atleast I find it useful).</p>
<p>Now if you want to do that here are the steps you need to follow. As you know that most or all servers dont come with Gnome installed. So thats the first step you need to do</p>
<p>Start with the following command</p>
<p>sudo apt-get update</p>
<p>Than install the Gnome-Core components using </p>
<p>sudo apt-get install gnome-core</p>
<p>Now install a virtual desktop using</p>
<p>sudo apt-get install vnc4server</p>
<p>Now setup a password to login using the following command. It will prompt to setup a password and verify it</p>
<p>vncpasswd</p>
<p>Than run the vnc server using </p>
<p>vncserver  :1</p>
<p>Now before you proceed kill it once using </p>
<p>vncserver -kill :1</p>
<p>Now open the config file from .vnc/xstartup or ~/.vnc/xstartup</p>
<p>using nano .vnc/xstartup (I perfer nano you may use vim or vi)</p>
<p>Than uncomment the line which says</p>
<p>unset SESSION_MANAGER</p>
<p>And add sh to the line below it like this</p>
<p>exec sh /etc/X11/xinit/xinitrc</p>
<p>Exit the file and run the command as below</p>
<p>vncserver  :1  -depth 16  -geometry 1028&#215;1024</p>
<p>Than download tightVNC from http://www.tightvnc.com/download.html</p>
<p>connect using ip:1 (:1 is for the vnc server window)</p>
<p>You might see a dialog box with error and a delete option. Click delete and done <img src='http://blog.dhavalparikh.co.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>You now have GUI access to your server. </p>
<p>You may want to install synaptic using</p>
<p>apt-get install synaptic</p>
<p>Thats all..  Hope this article helps. If you get stuck do write to me. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/09/install-vnc-server-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Install Tokyo cabinet on ubuntu + ruby</title>
		<link>http://blog.dhavalparikh.co.in/2011/09/install-tokyo-cabinet-on-ubuntu-ruby/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/09/install-tokyo-cabinet-on-ubuntu-ruby/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 10:31:30 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[tokyo cabinet]]></category>
		<category><![CDATA[tokyo cabinet + rails]]></category>
		<category><![CDATA[tokyo cabinet + ruby]]></category>
		<category><![CDATA[tokyo cabinet + ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=336</guid>
		<description><![CDATA[Every came across a task where in you get a task to insert 1 million + records in few hours? than the answer is NOSQL Use Tokyo Cabinet. Here are the installation steps for the same. First of all download the latest version of tokyocabinet via the following url wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz tar xvf tokyocabinet-1.4.47.tar.gz cd [...]]]></description>
			<content:encoded><![CDATA[<p>Every came across a task where in you get a task to insert 1 million + records in few hours? than the answer is NOSQL<br />
Use Tokyo Cabinet. Here are the installation steps for the same. </p>
<p>First of all download the latest version of tokyocabinet via the following url</p>
<p>wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz<br />
tar xvf tokyocabinet-1.4.47.tar.gz<br />
cd tokyocabinet-1.4.47<br />
./configure<br />
make<br />
make install</p>
<p>Next step is to install the ruby library which you can download from the url below</p>
<p>wget http://fallabs.com/tokyocabinet/rubypkg/tokyocabinet-ruby-1.31.tar.gz</p>
<p>tar xvf tokyocabinet-ruby-1.31.tar.gz<br />
cd tokyocabinet-ruby-1.31<br />
ruby extconf.rb<br />
make<br />
make install</p>
<p>Now to verify you installation go to irb</p>
<p>irb(main):001:0> require &#8216;rubygems&#8217;<br />
=> true</p>
<p>irb(main):002:0> require &#8216;tokyocabinet&#8217;<br />
=> true</p>
<p>Done. If you get any errors while doing this please free to comment. Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/09/install-tokyo-cabinet-on-ubuntu-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>solve libxslt is missing error when installing omniauth or nokogiri</title>
		<link>http://blog.dhavalparikh.co.in/2011/08/libxslt-is-missing-using-omniauth-and-nokogiri/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/08/libxslt-is-missing-using-omniauth-and-nokogiri/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 07:23:38 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[libxslt error]]></category>
		<category><![CDATA[libxslt nokogiri]]></category>
		<category><![CDATA[libxslt2 errpr]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=331</guid>
		<description><![CDATA[I was trying to install omniauth and was getting error for nokogiri libxslt is missing. If you are facing the same issue you may solve it using the following command. I have tested it with ubuntu and it worked for me. Its not tested on Fedora but should work. on Ubuntu 10 sudo apt-get install [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to install omniauth and was getting error for nokogiri libxslt is missing. If you are facing the same issue you may solve it using the following command. I have tested it with ubuntu and it worked for me. Its not tested on Fedora but should work.</p>
<p>on Ubuntu 10</p>
<p>sudo apt-get install libxml2 libxml2-dev libxslt libxslt-dev</p>
<p>on Ubuntu 11</p>
<p>sudo apt-get install libxml2 libxml2-dev libxslt1-dev</p>
<p>On fedora </p>
<p>sudo yum install libxml2-devel libxslt-devel</p>
<p>If you still face issues do write to me.</p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/08/libxslt-is-missing-using-omniauth-and-nokogiri/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>solving sudo: /etc/sudoers is mode 0777, should be 0440 error</title>
		<link>http://blog.dhavalparikh.co.in/2011/07/solving-sudo-etcsudoers-is-mode-0777-should-be-0440-error/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/07/solving-sudo-etcsudoers-is-mode-0777-should-be-0440-error/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 10:05:37 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[sudo chmod]]></category>
		<category><![CDATA[sudo recovery]]></category>
		<category><![CDATA[sudoers chmod]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=328</guid>
		<description><![CDATA[Today one of my team mate accidently gave chmod -R 777 on all folders. So he was not able to do sudo su and login as a root user. Now as a normal user it wont allow you to change the rights. This is a big headache. Ultimately I found the solution to this issue. [...]]]></description>
			<content:encoded><![CDATA[<p>Today one of my team mate accidently gave chmod -R 777 on all folders. So he was not able to do sudo su and login as a root user.</p>
<p>Now as a normal user it wont allow you to change the rights.  This is a big headache. Ultimately I found the solution to this issue. Restart ur pc and press shift key which will give u an option to start your system in recovery mode.</p>
<p>Select that and you will get an option to login as root with command prompt. Now change the rights of /etc/sudoers to 0440 by using the command chmod 0440 /etc/sudoers. Exit and restart your system. </p>
<p>Now start your terminal and try sudo su to login as a root user. Ah! finally the problem got solved.</p>
<p>If you are still not able to solve this issue. Just write back to me and I shall help you out.</p>
<p>Njoi</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/07/solving-sudo-etcsudoers-is-mode-0777-should-be-0440-error/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Generate self signed certificates for nginx</title>
		<link>http://blog.dhavalparikh.co.in/2011/07/generate-self-signed-certificates-for-nginx/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/07/generate-self-signed-certificates-for-nginx/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 09:51:51 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=325</guid>
		<description><![CDATA[As i mentioned in my previous post that I will let u know how to generate self signed certificates here is the procedure for it. First of all install ssl-cert using sudo aptitude install ssl-cert Next step is to create a private key using the command below. openssl genrsa -des3 -out myssl.key 1024 Now create [...]]]></description>
			<content:encoded><![CDATA[<p>As i mentioned in my previous post that I will let u know how to generate self  signed certificates here is the procedure for it.</p>
<p>First of all install ssl-cert using</p>
<p>sudo aptitude install ssl-cert</p>
<p>Next step is to create a private key using the command below.</p>
<p>openssl genrsa -des3 -out myssl.key 1024</p>
<p>Now create a CSR where you need to provide details such as Country, State, City, Orgainzation name, Unit Name, Common Name and Email id</p>
<p>openssl req -new -key myssl.key -out myssl.csr</p>
<p>And the last step is the actual certificate</p>
<p>openssl x509 -req -days 365 -in myssl.csr -signkey myssl.key -out myssl.crt</p>
<p>Thats it. So its just 3-4 steps. Now start configuring it with nginx using the link below</p>
<p><a href="http://blog.dhavalparikh.co.in/2011/06/configure-self-signed-certificates-with-nginx-and-rails/">http://blog.dhavalparikh.co.in/2011/06/configure-self-signed-certificates-with-nginx-and-rails/</a></p>
<p>If you have any doubts please feel free to ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/07/generate-self-signed-certificates-for-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Self Signed Certificates with Nginx and Rails</title>
		<link>http://blog.dhavalparikh.co.in/2011/06/configure-self-signed-certificates-with-nginx-and-rails/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/06/configure-self-signed-certificates-with-nginx-and-rails/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 09:21:00 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rails + ssl]]></category>
		<category><![CDATA[rails + ssl + nginx]]></category>
		<category><![CDATA[ssl + nginx]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=319</guid>
		<description><![CDATA[Guys, I was given a task to setup https using self signed certificate using nginx in our latest rails app. This was basically for the paypal page where we were accepting credit card details on our site. Below is the nginx.conf file configuration which u require in order to implement SSL certificate. If you see [...]]]></description>
			<content:encoded><![CDATA[<p>Guys,</p>
<p>I was given a task to setup https using self signed certificate using nginx in our latest rails app. This was basically for the paypal page where we were accepting credit card details on our site.</p>
<p>Below is the nginx.conf file configuration which u require in order to implement SSL certificate. If you see closely there are 2 port defined. 1) port 80 2) port 443. Port 80 is for standard http request and port 443 is for https request.</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;code starts below&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>#user nobody;</p>
<p>worker_processes 4;</p>
<p>pid /var/run/nginx.pid;</p>
<p>events {<br />
worker_connections 1024;<br />
}</p>
<p>http {<br />
include /etc/nginx/mime.types;</p>
<p>default_type application/octet-stream;</p>
<p>log_format main &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8216;<br />
                  &#8216;&#8221;$request&#8221; $status  $body_bytes_sent &#8220;$http_referer&#8221; &#8216;<br />
                  &#8216;&#8221;$http_user_agent&#8221; &#8220;$http_x_forwarded_for&#8221;&#8216;;</p>
<p>sendfile on;<br />
tcp_nopush on;<br />
tcp_nodelay off;<br />
#keepalive_timeout 0;<br />
keepalive_timeout 65;</p>
<p>gzip on;<br />
gzip_http_version 1.0;<br />
gzip_comp_level 2;<br />
gzip_buffers      16 8k;<br />
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript ;</p>
<p>upstream main{<br />
server 127.0.0.1:8000;<br />
server 127.0.0.1:8001;<br />
server 127.0.0.1:8002;<br />
server 127.0.0.1:8003;<br />
}</p>
<p>server {<br />
listen 80;<br />
#server_name yourdomain.com;</p>
<p>#client_max_body_size 4M;<br />
client_body_buffer_size 128k;<br />
root /var/www/yourapplication/public/;</p>
<p># needed to forward user.s IP address to rails<br />
proxy_set_header X-Real-IP $remote_addr;</p>
<p># needed for HTTPS<br />
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
proxy_set_header Host $http_host;<br />
proxy_redirect false;<br />
proxy_max_temp_file_size 0;</p>
<p>location ~ ^/(images|javascripts|stylesheets|product)/ {<br />
  expires 10y;<br />
}</p>
<p># If the file exists as a static file serve it directly without<br />
# running all the other rewite tests on it<br />
if (-f $request_filename) {<br />
break;<br />
}</p>
<p># check for index.html for directory index<br />
# if its there on the filesystem then rewite<br />
# the url to add /index.html to the end of it<br />
# and then break to send it to the next config rules.<br />
if (-f $request_filename/index.html) {<br />
rewrite (.*) $1/index.html break;<br />
}<br />
# redirect the traffic to the upstream mongrel defined as .main.<br />
proxy_pass http://main/;<br />
}<br />
}</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;https&#8212;&#8212;&#8212;&#8212;</p>
<p>server {<br />
listen 443;<br />
server_name yourdomain.com;<br />
ssl    on;<br />
ssl_certificate    /etc/ssl/certs/myssl.crt;<br />
ssl_certificate_key     /etc/ssl/private/myssl.key;</p>
<p>#client_max_body_size 4M;<br />
client_body_buffer_size 128k;<br />
root /var/www/yourapplication/public/;</p>
<p># needed to forward user.s IP address to rails<br />
proxy_set_header X-Real-IP $remote_addr;</p>
<p># needed for HTTPS<br />
              proxy_set_header X_FORWARDED_PROTO https;<br />
              proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;<br />
              proxy_set_header  Host $http_host;<br />
              proxy_set_header  X-Url-Scheme $scheme;<br />
              proxy_redirect    off;<br />
              proxy_max_temp_file_size 0;</p>
<p>location ~ ^/(images|javascripts|stylesheets|product)/ {<br />
  expires 10y;<br />
}</p>
<p># If the file exists as a static file serve it directly without<br />
# running all the other rewite tests on it<br />
if (-f $request_filename) {<br />
break;<br />
}</p>
<p># check for index.html for directory index<br />
# if its there on the filesystem then rewite<br />
# the url to add /index.html to the end of it<br />
# and then break to send it to the next config rules.<br />
if (-f $request_filename/index.html) {<br />
rewrite (.*) $1/index.html break;<br />
}<br />
# redirect the traffic to the upstream mongrel defined as .main.<br />
proxy_pass http://main/;<br />
}<br />
}</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-https&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>In the code above the most important part is </p>
<p>ssl    on;<br />
ssl_certificate    /etc/ssl/certs/myssl.crt;<br />
ssl_certificate_key     /etc/ssl/private/myssl.key;</p>
<p>Now how to generate self signed certificates i will let u know in my next post. (Though i should have covered it b4 but ne ways will do it now)</p>
<p>Thats all. You can add and remove basic paraments you want from the above given nginx.conf file.<br />
Let me know if you find any issues in implementing SSL for your app. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/06/configure-self-signed-certificates-with-nginx-and-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>you are being redirected error with rails 2.3.8, mongrel and nginx</title>
		<link>http://blog.dhavalparikh.co.in/2011/05/you-are-being-redirected-error-with-rails-2-3-8-and-nginx/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/05/you-are-being-redirected-error-with-rails-2-3-8-and-nginx/#comments</comments>
		<pubDate>Thu, 19 May 2011 06:54:42 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[redirected + rails 2.3.8]]></category>
		<category><![CDATA[redirected error + nginx]]></category>
		<category><![CDATA[redirected error + rails 2.3.8]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=309</guid>
		<description><![CDATA[Guys if you get this error you are being redirected while working with rails 2.3.7 + nginx + mongrel in production mode. Just add the code below in the initializer folder in a file called mongrel.rb if Rails.version == &#8217;2.3.8&#8242; &#38;&#38; Gem.available?(&#8216;mongrel&#8217;, Gem::Requirement.new(&#8216;~&#62;1.1.5&#8242;)) &#38;&#38; self.class.const_defined?(:Mongrel) # Pulled right from latest rack. Old looked like this [...]]]></description>
			<content:encoded><![CDATA[<p>Guys if you get this error you are being redirected while working with rails 2.3.7 + nginx + mongrel<br />
in production mode. Just add the code below in the initializer folder in a file called mongrel.rb</p>
<p>if Rails.version == &#8217;2.3.8&#8242; &amp;&amp; Gem.available?(&#8216;mongrel&#8217;, Gem::Requirement.new(&#8216;~&gt;1.1.5&#8242;))<br />
&amp;&amp; self.class.const_defined?(:Mongrel)</p>
<p># Pulled right from latest rack. Old looked like this in 1.1.0 version.<br />
#<br />
# def [](k)<br />
#   super(@names[k] ||= @names[k.downcase])<br />
# end<br />
#<br />
module Rack<br />
module Utils<br />
class HeaderHash &lt; Hash<br />
def [](k)<br />
super(@names[k]) if @names[k]<br />
super(@names[k.downcase])<br />
end<br />
end<br />
end<br />
end</p>
<p># Code pulled from the ticket above.<br />
#<br />
class Mongrel::CGIWrapper<br />
def header_with_rails_fix(options = &#8216;text/html&#8217;)<br />
@head['cookie'] = options.delete(&#8216;cookie&#8217;).flatten.map { |v| v.sub(/^\n/,&#8221;) } if options.class != String and options['cookie']<br />
header_without_rails_fix(options)<br />
end<br />
alias_method_chain :header, :rails_fix<br />
end</p>
<p># Pulled right from 2.3.8 ActionPack. Simple diff was<br />
#<br />
# if headers.include?(&#8216;Set-Cookie&#8217;)<br />
#   headers['cookie'] = headers.delete(&#8216;Set-Cookie&#8217;).split(&#8220;\n&#8221;)<br />
# end<br />
#<br />
# to<br />
#<br />
# if headers['Set-Cookie']<br />
#   headers['cookie'] = headers.delete(&#8216;Set-Cookie&#8217;).split(&#8220;\n&#8221;)<br />
# end<br />
#<br />
module ActionController<br />
class CGIHandler<br />
def self.dispatch_cgi(app, cgi, out = $stdout)<br />
env = cgi.__send__(:env_table)<br />
env.delete &#8220;HTTP_CONTENT_LENGTH&#8221;<br />
cgi.stdinput.extend ProperStream<br />
env["SCRIPT_NAME"] = &#8220;&#8221; if env["SCRIPT_NAME"] == &#8220;/&#8221;<br />
env.update({<br />
&#8220;rack.version&#8221; =&gt; [0,1],<br />
&#8220;rack.input&#8221; =&gt; cgi.stdinput,<br />
&#8220;rack.errors&#8221; =&gt; $stderr,<br />
&#8220;rack.multithread&#8221; =&gt; false,<br />
&#8220;rack.multiprocess&#8221; =&gt; true,<br />
&#8220;rack.run_once&#8221; =&gt; false,<br />
         &#8220;rack.url_scheme&#8221; =&gt; ["yes", "on", "1"].include?(env["HTTPS"]) ? &#8220;https&#8221; : &#8220;http&#8221;<br />
        })<br />
        env["QUERY_STRING"] ||= &#8220;&#8221;<br />
        env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"]<br />
        env["REQUEST_PATH"] ||= &#8220;/&#8221;<br />
        env.delete &#8220;PATH_INFO&#8221; if env["PATH_INFO"] == &#8220;&#8221;<br />
        status, headers, body = app.call(env)<br />
        begin<br />
         out.binmode if out.respond_to?(:binmode)<br />
          out.sync = false if out.respond_to?(:sync=)<br />
          headers['Status'] = status.to_s<br />
          if headers['Set-Cookie']<br />
            headers['cookie'] = headers.delete(&#8216;Set-Cookie&#8217;).split(&#8220;\n&#8221;)<br />
          end<br />
          out.write(cgi.header(headers))<br />
          body.each { |part|<br />
            out.write part<br />
            out.flush if out.respond_to?(:flush)<br />
          }<br />
        ensure<br />
          body.close if body.respond_to?(:close)<br />
        end<br />
      end<br />
    end<br />
  end</p>
<p>end</p>
<p>Thats all just restart your server nginx and mongrel cluster and the error should be gone.</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/05/you-are-being-redirected-error-with-rails-2-3-8-and-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying Rails Application on Amazon Ec2</title>
		<link>http://blog.dhavalparikh.co.in/2011/01/deploying-rails-application-on-amazon-ec2/</link>
		<comments>http://blog.dhavalparikh.co.in/2011/01/deploying-rails-application-on-amazon-ec2/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 13:55:05 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon + rails app]]></category>
		<category><![CDATA[ec2 + rails]]></category>
		<category><![CDATA[rails amazon]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=305</guid>
		<description><![CDATA[Hello guys Posting after a long time. But any ways below are the steps if you want to deploy a rails app on ec2 directly without using any 3rd party service providers All the details mentioned below after for ubuntu so path might vary for other Linux flavours. step 1 = Set java home. Ofcourse [...]]]></description>
			<content:encoded><![CDATA[<p>Hello guys</p>
<p>Posting after a long time. But any ways below are the steps if you want to deploy a rails app on ec2 directly without using any 3rd party service providers</p>
<p>All the details mentioned below after for ubuntu so path might vary for other Linux flavours.</p>
<p>step 1 = Set java home. Ofcourse you need to have java installed and I assume that you already have it installed.</p>
<p>JAVA_HOME=/usr/lib/jvm/java-6-openjdk/<br />
export JAVA_HOME<br />
PATH=$PATH:$JAVA_HOME/bin<br />
export PATH</p>
<p>Step 2 = login to amazon aws go to the account tab and download security credentials.  You will see 2 things</p>
<p>1) private key 2) certificate</p>
<p>Download them and store it on some path like /home/dhaval/cert or whatevery</p>
<p>Than export the keys and set it up with the following commands</p>
<p>export EC2_PRIVATE_KEY=/home/dhaval/cert/pk-2spdXHCQ4HDMJNCULJB5NA4JNLE7SWOR.pem<br />
export EC2_CERT=/home/dhaval/cert/cert-2spdJXHCQ4HDMJNCULJB5NA4JNLE7SWOR.pem</p>
<p>Step 3 = Download api tools available on aws site</p>
<p>http://aws.amazon.com/developertools/351?_encoding=UTF8&#038;jiveRedirect=1</p>
<p>export it and set the path</p>
<p>export EC2_HOME=/home/dhaval/cert/ec2-api-tools-1.3-62308<br />
export PATH=$EC2_HOME/bin:$PATH</p>
<p>Step 4 = set up ssh keys using the following commands</p>
<p>ec2-add-keypair gsg-keypair</p>
<p>Now save this generated kaypair in ~/.shh folder with name id_rsa-gsg-keypair</p>
<p>Step 5 = Start an instance using the command below</p>
<p>ec2-run-instances (ami instance name) -k gsg-keypair</p>
<p>Step 6 = Check status of the instance</p>
<p>check status with</p>
<p>ec2-describe-instances (instant name)</p>
<p>eg.</p>
<p>ec2-describe-instances i-10a64379</p>
<p>Step 7 = Authorization of network ports using commands as below</p>
<p>ec2-authorize default -p 22<br />
ec2-authorize default -p 80</p>
<p>Step 8 = Connect to your instance using the command below</p>
<p>ssh -i id_rsa-gsg-keypair root@machine_name</p>
<p>Thats all once these steps are done you can see the instance running on the aws console.</p>
<p>Than install ruby gems + rails + other required gems and packages and you are set to go.</p>
<p>In order to upload your files you can use Capistrano or also you can ssh through ftp using the key specified.</p>
<p>Hope this helps. If you are stuck at any step do feel free to ask question and I shall get back to you.</p>
<p>Njoi</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2011/01/deploying-rails-application-on-amazon-ec2/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>3 Step Solution to Missing rs-ruby error</title>
		<link>http://blog.dhavalparikh.co.in/2010/09/missing-rs-ruby-error/</link>
		<comments>http://blog.dhavalparikh.co.in/2010/09/missing-rs-ruby-error/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 09:07:57 +0000</pubDate>
		<dc:creator>Dhaval Parikh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[missing rsruby]]></category>
		<category><![CDATA[rsruby error]]></category>
		<category><![CDATA[solve missing rs-ruby error]]></category>

		<guid isPermaLink="false">http://blog.dhavalparikh.co.in/?p=294</guid>
		<description><![CDATA[Today we were trying to move one project of rails from one pc to the other. We took the source code along with the db (since the db had data in it and it was required) and configured it. But when we started the server using ruby script/server we got a strange error missing rsruby [...]]]></description>
			<content:encoded><![CDATA[<p>Today we were trying to move one project of rails from one pc to the other. We took the source code along with the db (since the db had data in it and it was required) and configured it. But when we started the server using ruby script/server we got a strange error missing rsruby</p>
<p>searched for it and tried few things. Finally got it solved in 3 steps</p>
<p>&gt;export R_HOME=/usr/lib/R<br />
&gt; sudo ln -s /usr/lib/R/lib/libR.so /usr/lib/libR.so<br />
&gt; gem install rsruby &#8212; &#8211;with-R-dir=$R_HOME &#8211;with-R-include=/usr/share/R/include/</p>
<p>Thats all&#8230; rsruby will be installed on your system and the project will be running without any issue.</p>
<p>Hope this works for you</p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dhavalparikh.co.in/2010/09/missing-rs-ruby-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

