我們以俄羅斯方塊為例吧....先把他解壓到某個地方,然後我們開始裝0.3.3版的Shattered Ruby
首先為了避免混淆,我們先將舊版本的ShatteredRuby全都反安裝。執行
C:\temp\mygame>gem uninstall shattered*
Select RubyGem to uninstall:
1. shattered-0.4.0.1
2. shattered_ogre-0.4-windows
3. shattered_pack-0.4.0.1
4. shattered_support-0.4.0.1
5. All versions
> 5
Successfully uninstalled shattered version 0.4.0.1
Successfully uninstalled shattered_ogre version 0.4
Successfully uninstalled shattered_pack version 0.4.0.1
Successfully uninstalled shattered_support version 0.4.0.1
然後再安裝0.3.3版的ShatteredRuby,可能又需要一些時間,因為另一個revision的DLL必需重新下載一次,安裝方式如下:
C:\temp\mygame>gem install -y shattered -v 0.3.3
Bulk updating Gem source index for: http://gems.rubyforge.org
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i386-mswin32)
1. shattered_ogre 0.4 (windows)
2. shattered_ogre 0.3.3 (windows)
3. Cancel installation
> 2
Bulk updating Gem source index for: http://gems.rubyforge.org
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed shattered-0.3.3
Successfully installed shattered_ogre-0.3.3-windows
Successfully installed shattered_pack-0.4.0.1
Successfully installed shattered_support-0.4.0.1
下略
這樣就裝好了....但我們執行tetris時卻會發生錯誤....經過一連串的試誤,我發現在gemspec中這樣定義:shattered 0.3.3版需要shattered_pack及shattered_support0.3.3「以上」的版本。但事實上是不相容的。所以我們必需手動移除,再灌正確的版本。 (如果你熟希gems的話,你可以一開始就灌正確的版本,這樣比較快)
執行這四行吧:
gem uni shattered_support -i
gem uni shattered_pack -i
gem i shattered_support -v 0.3.3
gem i shattered_pack -v 0.3.3
事情還沒結束,還要上wiki的補丁。見A Confession這段。 (我試過了,上面手動灌0.3.3版和這個補丁兩者都是必需的,缺一不可,當初gemspec沒寫好的關係 Orz)
再跑一次tetris的script/runner
好啦....終於成功了....真累....
沒有留言:
張貼留言