<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Özgün Koyun | Web Application Developer (Ruby on Rails)</title>
    <description>Özgün Koyun - Web Application Developer</description>
    <link>http://kozgun.net/</link>
    <item>
      <title>E-devlet'in (turkiye.gov.tr) işleyişi</title>
      <description>&lt;p&gt;Geçenlerde turkiye.gov.tr&amp;#8217;ye Linux kurulu bir bilgisayardan e-imza ile giriş yapmaya çalışırken yaşadığım sorun ile ilgili bir eposta gönderdim(bilgi@turkiye.gov.tr adresine). Epostayı gönderirken belki ulaşmak isterler diye telefon numaramı da yazmayı ihmal etmedim. 4 gün sonra aşağıdaki gibi bir cevap ile dönüş yaptılar:&lt;/p&gt;
&lt;pre&gt;
e-postanızda belirtmiş olduğunuz konunun incelenebilmesi için lütfen
 tarafımıza T.C kimlik numaranızı ve size ulaşabileceğimiz bir telefon 
numarası iletiniz.

Bilgilerinize arz eder,
İyi günler dileriz.
&lt;/pre&gt;
&lt;p&gt;Benim TC kimlik numaramı gerektirecek nasıl bir soru sormuş olabilirim ki? Benim tek istediğim libpkcs11wrapper.so kütüphanesinin 32 bit Linux için derlenmiş dosyasının https://www.turkiye.gov.tr/bilgilendirme?konu=sikcaSorulanlar adresine eklenmesiydi.&lt;/p&gt;
&lt;p&gt;Merak edenler için benim gönderdiğim mesaj şu şekildeydi:&lt;/p&gt;
&lt;pre&gt;

https://www.turkiye.gov.tr/bilgilendirme?konu=sikcaSorulanlar sayfasında
 bulunan Linux için olan ibpkcs11wrapper.so download linkine tıklandığında
 inen dosya Linux 32 bit için değil, inen dosyanın bilgileri şu şekilde:

libpkcs11wrapper.so: ELF 64-bit MSB shared object, SPARC V9, total store
 ordering, version 1 (SYSV), dynamically linked, not stripped

libpkcs11wrapper.so dosyasının 32 bit Linux için olanını siteye yüklemenizi
 rica edeceğim.
&lt;/pre&gt;</description>
      <pubDate>Fri, 23 Aug 2013 16:46:44 +0000</pubDate>
      <link>http://kozgun.net/articles/34-E-devlet-in--turkiye-gov-tr--i-leyi-i</link>
    </item>
    <item>
      <title>Dynamic "find_by" methods (Rails 2.x vs Rails 3.x)</title>
      <description>&lt;h4&gt;Rails 2.x&lt;/h4&gt;
&lt;pre&gt;
Right.find_by_site_id_and_user_id(Site.find(1), User.new)
&lt;/pre&gt;

&lt;pre&gt;
SELECT * FROM `rights` 
WHERE (`rights`.`site_id` = 1 AND `rights`.`user_id` = NULL) 
LIMIT 1
&lt;/pre&gt;
&lt;h4&gt;Rails 3.x&lt;/h4&gt;
&lt;pre&gt;
Right.find_by_site_id_and_user_id(Site.find(1), User.new)
&lt;/pre&gt;

&lt;pre&gt;
SELECT `rights`.* FROM `rights` 
WHERE `rights`.`site_id` = 1 AND `rights`.`user_id` IS NULL 
LIMIT 1
&lt;/pre&gt;
&lt;p&gt;If there are some records which user_id column is &lt;span class="caps"&gt;NULL&lt;/span&gt;, then, it is obvious that we&amp;#8217;ll have some problems.&lt;/p&gt;</description>
      <pubDate>Mon, 26 Mar 2012 08:12:35 +0000</pubDate>
      <link>http://kozgun.net/articles/33-Dynamic--find-by--methods--Rails-2-x-vs-Rails-3-x-</link>
    </item>
    <item>
      <title>undef_method vs remove_method</title>
      <description>&lt;h2&gt;undef_method&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;
class Computer
  # Eğer method __ ile başlıyorsa, veya method_missing ise veya respond_to ise
  # methodu çıkarma.  
  instance_methods.each do |m|
    # undef_method kullandığımız zaman üst sınıflardan inherit edilen 
    # tüm methodlar çıkarılır.
    undef_method m unless m.to_s =~ /^__|^method_missing$|^respond_to\?$/
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;
c = Computer.new
begin
  c.inspect
rescue Exception =&amp;gt; e
  puts "inspect methodu undef_method ile cikarilmis: #{e.message}"
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;remove_method&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;
class Monitor 
  def hello 
    "hello"; 
  end
end
m = Monitor.new
puts m.hello
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;
class Monitor
  # inspect methodu Monitor classında tanımlanmadığı için remove_method
  # ile çıkarılamaz.
  begin
    remove_method :inspect 
  rescue Exception =&amp;gt; e
    puts e.message
  end

  # remove_method sadece o sınıfa ait methodları çıkarır. Inherit edilen
  # methodlara dokunmaz. O yüzden burda inherit edilen bir methodu
  # remove_method ile çıkarmaya çalıştığımız zaman hata verir.
  puts "hello methodunu remove_method ile cikariyoruz"
  remove_method :hello 
end
&lt;/code&gt;&lt;/pre&gt;


&lt;pre&gt;&lt;code&gt;
begin
  puts m.hello
rescue Exception =&amp;gt; e
  puts e.message
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Resources&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://pragprog.com/book/ppmetr/metaprogramming-ruby"&gt;Metaprogramming Ruby: Program Like the Ruby Pros&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:00:41 +0000</pubDate>
      <link>http://kozgun.net/articles/32-undef-method-vs-remove-method</link>
    </item>
    <item>
      <title>Working with git submodules</title>
      <description>&lt;h4&gt;Cloning the main project&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;
$ cd ~
$ git clone git@github.com:ozgun/main_project.git
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Initializing the submodule (sub project):&lt;/h4&gt;
&lt;p&gt;Create ~/main_project/.gitmodules file and add the followings lines to it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
[submodule "sub_project"]
        path = sub_project
        url = git@github.com:ozgun/sub_project.git
&lt;/pre&gt;&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Run the following commands to initialize the submodule:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$ cd ~/main_project
$ git submodule init
$ git submodule update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;#8220;git submodule update&amp;#8221; command does not checkout to &amp;#8220;master&amp;#8221; branch. So we need to create master branch and then switch to it as below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$ cd ~/main_project/sub_project
$ git checkout master
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;When something changes in sub project&lt;/h4&gt;
&lt;p&gt;Since sub_project is a submodule in main_project, when something changed in submodule, main projects also needs to be notified(synced) about this change.&lt;/p&gt;
&lt;h5&gt;Adding a new file to submodule and pushing to sub_project&amp;#8217;s repository&lt;/h5&gt;
&lt;pre&gt;&lt;code&gt;
$ cd ~/main_project/sub_project
$ git checkout master # make sure you are working on master branch
$ touch README
$ git add README
$ git commit -am "Added README to sub_project - submodule update"
$ git push origin master
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Pushing the main_project to remote repository&lt;/h5&gt;
&lt;p&gt;After we updated sub_project, we need to update main_project too.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$ cd ~/main_project
$ git checkout master
$ git status
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After you run &amp;#8220;git status&amp;#8221; you should see something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# On branch master
# Changed but not updated:
#   (use "git add &amp;lt;file&amp;gt;..." to update what will be committed)
#   (use "git checkout -- &amp;lt;file&amp;gt;..." to discard changes in working directory)
#
#       modified:   sub_project
#
no changes added to commit (use "git add" and/or "git commit -a")
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Your main projects understands that something has changed inside the sub_project, so it is considered as &amp;#8220;modified&amp;#8221;. This means that we need to commit and then push to remote git repository as below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$ cd ~/main_project
$ git add sub_project # Do not append "/" !
$ git commit -am "Submodule sub_project updated"
$ git push origin master
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Resources:&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://longair.net/blog/2010/06/02/git-submodules-explained/"&gt;git Submodules Explained&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/2155887/git-submodule-head"&gt;git-submodule-head&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial"&gt;GitSubmoduleTutorial&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://pragprog.com/book/pg_git/pragmatic-guide-to-git"&gt;Pragmatic Guide to git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Mon, 15 Aug 2011 13:53:47 +0000</pubDate>
      <link>http://kozgun.net/articles/31-Working-with-git-submodules</link>
    </item>
    <item>
      <title>Mocking methods ending with equal sing (=) in (RR) Double Ruby</title>
      <description>&lt;p&gt;So, you are using Double Ruby as mocking framework instead of Rspec&amp;#8217;s default mocking framewok, and you want to mock a method which ends with the equal sign(=). Normally, if your method ends with other special characters such as &amp;#8220;!&amp;#8221; or &amp;#8220;?&amp;#8221;, you can safely mock those methods as below:&lt;/p&gt;
&lt;pre&gt;
mock(@user).delete_account! { true }
mock(@user).admin? { true }
&lt;/pre&gt;
&lt;p&gt;However, this doesn&amp;#8217;t work if your method ends with the &amp;#8220;=&amp;#8221; sign. Here comes the solution:&lt;/p&gt;
&lt;pre&gt;
mock(@user).__send__('name=').with('Paranoid Android') { }
&lt;/pre&gt;
&lt;p&gt;Now, in your controller, you can expect the following:&lt;/p&gt;
&lt;pre&gt;
@user.name = 'Paranoid Android'
&lt;/pre&gt;
&lt;p&gt;But, why did I use &lt;code&gt;__send__&lt;/code&gt; instead of the simple &lt;code&gt;send&lt;/code&gt; ? &lt;a href="http://stackoverflow.com/questions/4658269/ruby-send-vs-send"&gt;Take a look at this&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Resources:&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="https://github.com/btakita/rr" class="RR"&gt;Double Ruby&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="https://github.com/dchelimsky/rspec"&gt;rspec&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Tue, 09 Aug 2011 11:10:14 +0000</pubDate>
      <link>http://kozgun.net/articles/30-Mocking-methods-ending-with-equal-sing-----in--RR--Double-Ruby</link>
    </item>
    <item>
      <title>This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use.</title>
      <description>&lt;h3&gt;The Problem: (occurred in Ubuntu 10.04.1)&lt;/h3&gt;
&lt;pre&gt;
This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use.
&lt;/pre&gt;
&lt;h3&gt;The Solution:&lt;/h3&gt;
&lt;h4&gt;Uninstall &amp;#8220;rmagick&amp;#8221; gem&lt;/h4&gt;
&lt;pre&gt;
$ sudo gem uninstall rmagick
&lt;/pre&gt;
&lt;h4&gt;Compile and install RMagick from source code&lt;/h4&gt;
&lt;pre&gt;
$ wget http://files.rubyforge.vm.bytemark.co.uk/rmagick/RMagick-2.13.1.tar.gz
$ tar xzf RMagick-2.13.1.tar.gz
$ cd RMagick-2.13.1
$ ruby setup.rb
$ sudo ruby setup.rb install
&lt;/pre&gt;
&lt;h4&gt;Test and see if it works&lt;/h4&gt;
&lt;pre&gt;
$ irb
irb(main):001:0&amp;gt; require "RMagick"
=&amp;gt; true
&lt;/pre&gt;
&lt;h3&gt;Alternate solutions&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="https://bugs.launchpad.net/ubuntu/+source/librmagick-ruby/+bug/565461"&gt;https://bugs.launchpad.net/ubuntu/&lt;ins&gt;source/librmagick-ruby/&lt;/ins&gt;bug/565461&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=QBrNkPyr8I8"&gt;These pretzels are making me thirsty&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 01 Sep 2010 00:07:06 +0000</pubDate>
      <link>http://kozgun.net/articles/28-This-installation-of-RMagick-was-configured-with-ImageMagick-6-5-5-but-ImageMagick-6-5-7-8-is-in-use-</link>
    </item>
    <item>
      <title>Social Icons Rails Plugin</title>
      <description>&lt;p&gt;I&amp;#8217;ve created a simple Rails plugin called &lt;a href="http://github.com/ozgun/social_icons"&gt;Social Icons&lt;/a&gt; to put social media/network icons to your website easily.&lt;/p&gt;
&lt;h4&gt;Installation:&lt;/h4&gt;
&lt;pre&gt;
$ ./script/plugin install git://github.com/ozgun/social_icons.git
&lt;/pre&gt;
&lt;p&gt;The command above will copy a simple css(social_icons.css) file to &amp;#8220;public/stylesheets&amp;#8221; folder and &amp;#8220;social_icons&amp;#8221; folder to &amp;#8220;public/images&amp;#8221; folder.&lt;/p&gt;
&lt;p&gt;Although it is not necessary, you can load css file like above: (i.e. application.html.erb)&lt;/p&gt;
&lt;pre&gt;
&amp;lt;%= stylesheet_link_tag 'social_icons' %&amp;gt;
&lt;/pre&gt;
&lt;h4&gt;Usage:&lt;/h4&gt;
&lt;p&gt;You can call &amp;#8220;print_social_icons&amp;#8221; method in your views or partials.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;%= print_social_icons %&amp;gt;
&lt;/pre&gt;
&lt;h4&gt;Icons supported so far:&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;Facebook like button&lt;/li&gt;
	&lt;li&gt;Facebook&lt;/li&gt;
	&lt;li&gt;Twitter&lt;/li&gt;
	&lt;li&gt;Delicious&lt;/li&gt;
	&lt;li&gt;Reddit&lt;/li&gt;
	&lt;li&gt;Digg&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Images (Icon pack)&lt;/h4&gt;
&lt;p&gt;&amp;#8220;social.me&amp;#8221; icons from &amp;#8220;Quaqe9&amp;#8221; are used.&lt;/p&gt;
&lt;h4&gt;Showtime:&lt;/h4&gt;
&lt;div style="overflow:hidden"&gt;
&lt;p&gt;&lt;img src="/assets/social-icons-screenshot.png" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h4&gt;Links:&lt;/h4&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://github.com/ozgun/social_icons"&gt;social_icons plugin&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://www.iconspedia.com/pack/social-me-1467/"&gt;Social.me icon pack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Sun, 04 Jul 2010 15:38:27 +0000</pubDate>
      <link>http://kozgun.net/articles/27-Social-Icons-Rails-Plugin</link>
    </item>
    <item>
      <title>ArchLinux sistem güncellemesinden sonra ortaya çıkan xorg ve intel ekran kartı problemi</title>
      <description>&lt;p&gt;Ne zamandır planladığım &lt;a href="http://bbs.archlinux.org"&gt;ArchLinux&lt;/a&gt; full sistem güncellemesini niyahet dün akşam yapmaya başlamıştım. Başlamıştım başlamasına ama, 1 GB&amp;#8217;ı indirmek pek kolay olmadığından güncelleme işlemi yarım kalmıştı. Güncellemeye bugün kaldığım yerden devam ettim. Güncelleme esnasında bir sorunla karşılaşmamak için, önce masaüstünden logout olup terminale geçtim. Sonra da wireless&amp;#8217;ı devre dışı bırakıp, ethernet kablosunu taktım ki bir de komut satırından wireless ile uğraşmak durumunda kalmayayım.&lt;/p&gt;
&lt;p&gt;Güncelleme işleminin hızlı olması için linux.org.tr yansısını aşağıdaki dosyanın en tepesine yazarsanız iyi olur:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
"/etc/pacman.d/mirrorlist"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Güncellemeye aşağıdaki komut ile başladım:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# pacman -Syu
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Paketlerin netten indirilmesi bittikten sonra kurulum işlemi başladı. Kurulum işlemi &amp;#8220;file system&amp;#8221; arızası yüzünden birkaç kez kesintiye uğradı. Onarmak için bilgisayarı &lt;a href="http://www.sysresccd.org"&gt;SystemRescueCd&lt;/a&gt; Linux Live CD ile boot edit aşağıdaki komutları çalıştırdım:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# fsck /dev/sda6
# fsck.reiserfs --rebuild-tree /dev/sda6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ama sorunlar peşimi bıraktı mı? Bırakır mı hiç! Paketlerin kurulumu tamamlandıktan sonra sıra sistemi yeniden başlatmaya geldi. Ne yalan söyleyeyim, bugüne kadar hiç bir full sistem güncellemesini ya da sürüm güncellemesini bir çırpıda başaramamış biri olarak, bu sefer de bir değişiklik olmasını beklemenin bir anlamı yoktu. Netekim de öyle oldu. Benim &amp;#8220;Intel 855GM&amp;#8221; chipsetli tümleşik ekran kartının &amp;#8220;xf86-video-intel&amp;#8221; driver&amp;#8217;ı ile ilgili bir sorun nedeniyle Xorg çakılıyordu&amp;#8230;&lt;/p&gt;
&lt;p&gt;Ama umudumu yitirmemiştim. Çünküleyin &amp;#8220;ArchLinux forumları&amp;#8221;http://bbs.archlinux.org vardı. Ne zaman dara düşsem hızır gibi imdadıma yetişen forumlar&amp;#8230; Bu sefer de öyle oldu. Forumdaki &lt;a href="http://bbs.archlinux.org/viewtopic.php?id=83741"&gt;[&lt;span class="caps"&gt;SOLVED&lt;/span&gt;] xorg-server and xf86-video-intel-legacy&lt;/a&gt; başlıklı mesaj için gönderilmiş yorumları okuduktan ve ArchLinux Wiki&amp;#8217;sindeki &lt;a href="http://wiki.archlinux.org/index.php/Intel_Graphics"&gt;Intel Graphics&lt;/a&gt; dokumanını inceledikten sonra aşağıdaki işlemleri uygulayarak xorg&amp;#8217;u yeniden başlatmayı başardım.&lt;/p&gt;
&lt;p&gt;&amp;#8220;/boot/grub/menu.lst&amp;#8221; dosyasındaki şu satırı:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/b66f3e7a-dae8-4867-b17c-cd8f6399c27f ro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;aşağıdaki gibi değiştirdim:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/b66f3e7a-dae8-4867-b17c-cd8f6399c27f ro i915.modeset=1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Sonra, &amp;#8220;/etc/mkinitcpio.conf&amp;#8221; dosyasındaki &amp;#8220;&lt;span class="caps"&gt;MODULES&lt;/span&gt;&amp;#8221; listesine &amp;#8220;intel_agp&amp;#8221; ve &amp;#8220;i915&amp;#8221; modullerini ekledim:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
MODULES="pata_acpi ata_generic scsi_mod ata_piix intel_agp i915"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Son olarak da, grub&amp;#8217;u tekrar sda&amp;#8217;ya kurdum. Bu adım gerekli mi tam olarak bilmiyorum ama &amp;#8220;menu.lst&amp;#8221; dosyasında değişklik yaptığımız için sanki gerekli gibi:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# grub-install /dev/sda
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Kaynakları tekrar toparlarsak:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://bbs.archlinux.org/viewtopic.php?id=83741"&gt;[&lt;span class="caps"&gt;SOLVED&lt;/span&gt;] xorg-server and xf86-video-intel-legacy&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://wiki.archlinux.org/index.php/Intel_Graphics"&gt;ArchLinux wiki&amp;#8217;sindeki intel ekran kartları ile ilgili dokuman&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://bbs.archlinux.org"&gt;Her derde deva ArchLinux Forumları&lt;/a&gt;&amp;quot;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://wiki.archlinux.org/"&gt;ArchLinux Wiki&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Sat, 21 Nov 2009 23:04:34 +0000</pubDate>
      <link>http://kozgun.net/articles/26-ArchLinux-sistem-g-ncellemesinden-sonra-ortaya---kan-xorg-ve-intel-ekran-kart--problemi</link>
    </item>
    <item>
      <title>Upgrading Redmine from 0.7.3 to 0.8.5</title>
      <description>&lt;p&gt;I&amp;#8217;ve just upgraded &lt;a href="http://redmine.org"&gt;Redmine&lt;/a&gt; from 0.7.3 to 0.8.5.Here are the notes I&amp;#8217;ve taken while upgrading. Please don&amp;#8217;t forget to refer to Redmine&amp;#8217;s offical documentation before you do something bad :)&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;http://www.redmine.org/wiki/redmine/RedmineUpgrade&lt;/li&gt;
	&lt;li&gt;http://www.redmine.org/wiki/redmine/RedmineInstall#Requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;First off all, before you start, backup your existing redmine installation. &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;! &lt;span class="caps"&gt;BACKUP&lt;/span&gt;!.. Both files and database.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ mkdir -p manual-backups/redmine
$ cp -r redmine/ manual-backups/redmine/redmine-2009.10.01
$ cd manual-backups/redmine/
$ mysqldump redmine &amp;gt; redmine-2009.10.01.sql
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Upgrade rubygems to 1.3.5 and rails to 2.3.4. I had sent a message to my hosting company(hostingrails.com) explaining that I needed a new version of rubygems and they upgraded rubygems in 10 minutes. I also realized that they had already installed &amp;#8220;rails-2.3.4&amp;#8221;, so this step was the easiest one for me.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ gem install rails -v 2.3.4
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Install ruby-openid for openid logins&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ sudo gem install ruby-openid
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Since I had installed Redmine using svn, I&amp;#8217;m going to use the same method to upgrade.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ cd ~/redmine
$ svn update
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Generating session_store.rb&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ rake config/initializers/session_store.rb RAILS_ENV="production"
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Clean up&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ rake tmp:cache:clear RAILS_ENV="production"
$ rake tmp:sessions:clear RAILS_ENV="production"
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Run migrations for redmine and its plugis&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ rake db:migrate RAILS_ENV="production"
$ rake db:migrate:upgrade_plugin_migrations RAILS_ENV="production"
$ rake db:migrate_plugins RAILS_ENV="production"
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Restart your application server. Since mine is hosted one a fastcgi hosting, I just kill the fcgi processes.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ ps -ef |grep fcgi
$ kill -9 XXXX XXXX XXXX
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Installing &lt;a href="http://github.com/relaxdiego/redmine_backlogs"&gt;backlogs&lt;/a&gt; plugin:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ cd ~/redmine
$ cd vendor/plugins
$ git clone http://github.com/relaxdiego/redmine_backlogs
$ cd ../../
$ rake db:migrate_plugins RAILS_ENV="production"
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Restart Redmine&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ ps -ef |grep fcgi
$ kill -9 XXXX XXXX XXXX
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Enable &amp;#8220;backlogs&amp;#8221; in your project&amp;#8217;s setting tab.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
Your Project &amp;gt; Settings &amp;gt; Modules
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Chart Data Generator: The author of the plugin says: &amp;#8220;You may schedule a cron job to run the rake task named redmine:backlogs_plugin:generate_chart_data. I recommend you run it a few minutes after midnight to ensure that your backlogs have data everyday even when no user views the charts.&amp;#8221;&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ rake redmine:backlogs_plugin:generate_chart_data RAILS_ENV="production"
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;I&amp;#8217;d like to thank to &lt;a href="http://relaxdiego.wordpress.com/"&gt;Mark Maglana&lt;/a&gt; for this great &amp;#8220;Scrum/Agile&amp;#8221; plugin.&lt;/p&gt;
&lt;p&gt;Following the steps above, I successfully  upgraded Redmine and installed &amp;#8220;backlogs&amp;#8221; plugin. If you encounter any problems please refer to &amp;quot;Redmine&amp;#8217;s official documentation:http://www.redmine.org/projects/redmine/wiki&lt;/p&gt;</description>
      <pubDate>Thu, 01 Oct 2009 23:05:59 +0000</pubDate>
      <link>http://kozgun.net/articles/25-Upgrading-Redmine-from-0-7-3-to-0-8-5</link>
    </item>
    <item>
      <title>Dealing with Cucumber errors</title>
      <description>&lt;p&gt;To fix the following error:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
undefined method `fork=' for #&amp;lt;Cucumber::Rake::Task:0xb770bab8&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;You need to upgrade cucumber, rspec and rspec-rails.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ gem install cucumber
$ gem install rspec
$ gem install rspec-rails
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;If you run into the following error:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
cucumber database is not configured (ActiveRecord::AdapterNotSpecified)
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Then you should run the cucumber script to update your database.yml file:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ script/generate cucumber
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;If are getting the following error after your run &amp;#8220;cucumber features&amp;#8221;&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
no such file to load -- spec/test/unit
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Then you may need to install or upgrade &amp;#8220;hoe&amp;#8221; gem, U&amp;#8217; not sure though, but it worked for me.&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ gem install hoe
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Can&amp;#8217;t you install &amp;#8220;factory girl&amp;#8221; with the following command?&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ gem install thoughtbot-factory_girl
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Why not adding Github&amp;#8217;s gem archive to your gem source list?&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ gem sources -a http://gems.github.com
$ gem install thoughtbot-factory_girl
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;You upgraded to cucumber 0.3.103 and webrat 0.5.3, you run your features and get the following error:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
undefined method `use_transactional_fixtures' for Cucumber::Rails:Module (NoMethodError)
./features/support/env.rb:32
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;It is easy to fix. Replace&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
Cucumber::Rails.use_transactional_fixtures
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
Cucumber::Rails::World.use_transactional_fixtures = true
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;You fixed the error above, but this time you see the following error:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
undefined method `bypass_rescue' for Cucumber::Rails:Module (NoMethodError)
./features/support/env.rb:37
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Replace&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
Cucumber::Rails.bypass_rescue
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
ActionController::Base.allow_rescue = false
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;By the way, why don&amp;#8217;t you just create a new features/support/env.rb by running the following command?&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ ./script/generate cucumber
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;So, you upgraded to cucumber 0.3.103 and you tried to run a feature with &amp;#8220;&amp;#8212;tags&amp;#8221; or &amp;#8220;-t&amp;#8221; parameter like the following:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ cucumber -r features/ -t focus features/feedback.feature
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;And you get the following error:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
0 scenarios
0 steps
0m0.000s
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[] (NoMethodError)
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/console.rb:132:in `print_tag_limit_warnings'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/console.rb:130:in `each'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/console.rb:130:in `print_tag_limit_warnings'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/pretty.rb:232:in `print_summary'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/formatter/pretty.rb:27:in `after_features'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:170:in `__send__'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:170:in `send_to_all'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:168:in `each'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:168:in `send_to_all'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:164:in `broadcast'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/ast/tree_walker.rb:14:in `visit_features'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/cli/main.rb:55:in `execute!'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/../lib/cucumber/cli/main.rb:24:in `execute'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.103/bin/cucumber:9
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;It is obvious that none of your scenarios run, why? Because as &amp;#8220;aslakhellesoy&amp;#8221; said: &amp;#8220;you have to use -t @focus since 0.3.102&amp;#8221;. But don&amp;#8217;t worry, he also added that he was going to hack the code to display you a friendly message if you try to use tags without &amp;#8220;@&amp;#8221; symbol. So, to get rid of the error above, run your tagged feature like this:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
$ cucumber -r features/ -t @focus features/feedback.feature
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://github.com/aslakhellesoy"&gt;aslakhellesoy&lt;/a&gt; kept his promise and updated &lt;a href="http://wiki.github.com/aslakhellesoy/cucumber"&gt;Cucumber&lt;/a&gt; to display a friendly message in case you use &amp;#8216;-t&amp;#8217; parameter withouth &amp;#8216;@&amp;#8217; symbol. Related commit can be found &lt;a href="http://github.com/aslakhellesoy/cucumber/commit/50efb6789a724bb7991614950309e27ff4a0af38"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://wiki.github.com/aslakhellesoy/cucumber"&gt;Cucumber on Github&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="http://cukes.info/"&gt;Cucumber&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Mon, 10 Aug 2009 07:44:59 +0000</pubDate>
      <link>http://kozgun.net/articles/23-Dealing-with-Cucumber-errors</link>
    </item>
  </channel>
</rss>
