<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Heroku on Yang's Blog</title><link>https://blog.yangtheman.com/tags/heroku/</link><description>Recent content in Heroku on Yang's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Yang Chung</copyright><lastBuildDate>Mon, 01 Mar 2010 04:44:37 +0000</lastBuildDate><atom:link href="https://blog.yangtheman.com/tags/heroku/index.xml" rel="self" type="application/rss+xml"/><item><title>Full text search on Heroku</title><link>https://blog.yangtheman.com/2010/02/28/full-text-search-on-heroku/</link><pubDate>Mon, 01 Mar 2010 04:44:37 +0000</pubDate><guid>https://blog.yangtheman.com/2010/02/28/full-text-search-on-heroku/</guid><description/></item><item><title>How to convert from MySQL to Postgres</title><link>https://blog.yangtheman.com/2010/01/30/how-to-convert-from-mysql-to-postgres/</link><pubDate>Sat, 30 Jan 2010 07:55:21 +0000</pubDate><guid>https://blog.yangtheman.com/2010/01/30/how-to-convert-from-mysql-to-postgres/</guid><description>&lt;p&gt;I have been using MySQL for probably as long as I could remember. For &lt;a href="http://www.bloglation.com" target="_blank" rel="noreferrer"&gt;Bloglation&lt;/a&gt;, search capability is an important feature since it&amp;rsquo;s hard to browse each post one by one. I will probably implement tagging functionality, but even so, it&amp;rsquo;s important to be able to search the contents with a keyword(s). While Ultrasphinx works well, Heroku only supports WebSolr&amp;hellip; I was using acts_as_ferret using /tmp for index files, but the problem using the /tmp directory is that ferret index files most likely to disappear at some point.&lt;/p&gt;
&lt;p&gt;Then, I found out that Postgres supports full-text search and since Heroku uses Postgres, I could use other plug-ins like &lt;a href="http://code.google.com/p/acts-as-tsearch/" target="_blank" rel="noreferrer"&gt;acts_as_tsearch&lt;/a&gt; or &lt;a href="http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/" target="_blank" rel="noreferrer"&gt;texticle&lt;/a&gt; for free. Free is important to me, since it&amp;rsquo;s not making any money.&lt;/p&gt;
&lt;p&gt;Searching online, there are various ways to do it like &lt;a href="http://pivotallabs.com/users/jpignata/blog/articles/1077-converting-rails-application-data-from-mysql-to-postgresql" target="_blank" rel="noreferrer"&gt;Pivotal Labs&amp;rsquo; script&lt;/a&gt; or &lt;a href="http://adam.blog.heroku.com/past/2009/2/11/taps_for_easy_database_transfers/" target="_blank" rel="noreferrer"&gt;Heroku&amp;rsquo;s Taps gem&lt;/a&gt;, but I wanted to do it in an old way like &lt;a href="http://blog.aedifice.org/2009/09/08/converting-rails-applications-from-mysql-to-postgresql" target="_blank" rel="noreferrer"&gt;AEdifice&lt;/a&gt; to check everything is going alright at each step. &lt;strong&gt;1. First thing to do is to backup MySQL&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For me, it was important to backup preserving encoding, since it had many different languages. First I pulled db from Heroku thinking that I&lt;/p&gt;</description></item><item><title>Installing acts_as_ferret with pagination and deploying on Heroku</title><link>https://blog.yangtheman.com/2009/11/05/installing-acts_as_ferret-with-pagination-and-deploying-on-heroku/</link><pubDate>Thu, 05 Nov 2009 23:56:02 +0000</pubDate><guid>https://blog.yangtheman.com/2009/11/05/installing-acts_as_ferret-with-pagination-and-deploying-on-heroku/</guid><description>&lt;p&gt;OMG!&lt;/p&gt;
&lt;p&gt;This shouldn&amp;rsquo;t have been this difficult, but it has because while there are many cool tutorials are out there, they are mostly outdated, and for some reason, the &lt;a href="http://docs.heroku.com/full-text-indexing" target="_blank" rel="noreferrer"&gt;instruction on Heroku&lt;/a&gt; was not accessible.&lt;/p&gt;
&lt;p&gt;While I picked acts_as_ferret because Heroku supports it, many seemed to prefer &lt;a href="http://freelancing-god.github.com/ts/en/" target="_blank" rel="noreferrer"&gt;Thinking Sphinx&lt;/a&gt;. So, if you are not constrained (like me with Heroku), you should try that out too.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Install acts_as_ferret&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Full instruction is outlined on &lt;a href="http://github.com/jkraemer/acts_as_ferret" target="_blank" rel="noreferrer"&gt;github&lt;/a&gt;, so you should check it out. You can also find the installation instruction and complete list of methods &lt;a href="http://projects.jkraemer.net/rdoc/acts_as_ferret/" target="_blank" rel="noreferrer"&gt;here&lt;/a&gt;, too.&lt;/p&gt;
&lt;p&gt;While the instruction asks you to put version name, since Heroku only has version 0.4.3 installed, specifying a version will break it.&lt;/p&gt;</description></item><item><title>Counting rows and modifying MySQL to work with Postgres or Heroku</title><link>https://blog.yangtheman.com/2009/10/22/counting-rows-and-modifying-mysql-to-work-with-postgres-or-heroku/</link><pubDate>Thu, 22 Oct 2009 07:48:03 +0000</pubDate><guid>https://blog.yangtheman.com/2009/10/22/counting-rows-and-modifying-mysql-to-work-with-postgres-or-heroku/</guid><description>&lt;p&gt;Now I am moving on to Open Translation Project. I&amp;rsquo;ve done some translation work before, including one of Paul Graham&amp;rsquo;s essay - &lt;a href="http://www.paulgraham.com/notnot.html" target="_blank" rel="noreferrer"&gt;Why to not not start a startup&lt;/a&gt;. BTW, he finally made a link from the essay to my translation. I used Google Translate as base, but I couldn&amp;rsquo;t believe how bad the translation was. Yahoo&amp;rsquo;s Babel Fish was a little better, but not as much. That&amp;rsquo;s where I got the idea of creating this possibly massive project.&lt;/p&gt;
&lt;p&gt;Anyhow, I wanted to find a way of selecting an article or blog that was translated the most. I had one model that stored basic information of original article/blog. Then its children are translations. So, I need to count rows of children with the same parent. In MySQL, I had the following statement in Rails.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;@top_origs = OrigPost.find(:all,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;                              :select =&amp;gt; &amp;#39;orig_posts.*, count(posts.id) as post_count&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;                              :joins =&amp;gt; &amp;#39;left outer join posts on posts.orig_post_id = orig_posts.id&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;                              :group =&amp;gt; &amp;#39;orig_posts.id&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;                              :order =&amp;gt; &amp;#39;post_count DESC&amp;#39;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;                              :limit =&amp;gt; 5)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description></item><item><title>Deploying a Rails app on Heroku (paperclip, gems, yml)</title><link>https://blog.yangtheman.com/2009/09/05/deploying-a-rails-app-on-heroku-paperclip-gems-yml/</link><pubDate>Sat, 05 Sep 2009 08:57:21 +0000</pubDate><guid>https://blog.yangtheman.com/2009/09/05/deploying-a-rails-app-on-heroku-paperclip-gems-yml/</guid><description>&lt;p&gt;I just moved my &lt;a href="http://www.playgroundrus.com" target="_blank" rel="noreferrer"&gt;PlaygroundsRUs&lt;/a&gt; site from &lt;a href="http://aws.amazon.com/ec2/" target="_blank" rel="noreferrer"&gt;AWS&lt;/a&gt; to &lt;a href="http://heroku.com/" target="_blank" rel="noreferrer"&gt;Heroku&lt;/a&gt;, and I couldn&amp;rsquo;t be happier. My first full month bill from Amazon was about $75, and $74 of that (99% of the total cost) was for running an instance. &lt;a href="http://www.harlanknight.net/pub/H@rlan_Knight_Wood/" target="_blank" rel="noreferrer"&gt;Harlan&lt;/a&gt; told me about Heroku after he deployed his &lt;a href="http://fork-this-demo.heroku.com/login" target="_blank" rel="noreferrer"&gt;ForkThis&lt;/a&gt; demo on there.&lt;/p&gt;
&lt;p&gt;Most of the transition was smooth, but there were a few hiccups on the way. One of them still hasn&amp;rsquo;t been resolved (one of the plugins is having conflict with PostgresSQL, which is used by Heroku). I will enumerate what I had to go through so that it might be easier for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Secret YAML files&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have a public GitHub account for deploying on AWS using &lt;a href="http://ec2onrails.rubyforge.org/" target="_blank" rel="noreferrer"&gt;ec2onrails&lt;/a&gt;. Since it&amp;rsquo;s public and anyone can see it, I had to omit sensitive &lt;code&gt;.yml&lt;/code&gt; files in config directory that contained passwords and keys. It&amp;rsquo;s easily done by specifying those files in &lt;code&gt;.gitignore&lt;/code&gt; and listing them in &lt;code&gt;:nonvc_configs&lt;/code&gt; in &lt;code&gt;config/deploy.rb&lt;/code&gt; used by ec2onrails.&lt;/p&gt;
&lt;p&gt;I found out that for Heroku, the same can be achieved by creating another branch, including those files, merging with master, and pushing it to Heroku. So, the following lines should do the trick.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git checkout production
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[remove those yml files from .gitignore]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git merge master
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push heroku production:master&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;**&lt;/p&gt;</description></item></channel></rss>