今install railsすると2.1.1が入ってしまうが2.1.0を使いたい場合。
gem install RubyInline
以前書いたprawnの記事ですが、その時のgemは0.1.2でした。で色々ggってソースを読んでいくうちにどうやら最新だと:wrap => :character
gems.githu bにない
http://gem
を見てもprawnはありません。ということでcloneしてインストールすることにしました。
cloneしてgemを生成, インストール
1 $git clone git://github.com/rag gi/prawn.g it prawn.git 2 $ cd prawn.git 3 $ rake gem 4 $ ls pkg/prawn- 0.1.99.gem 5 pkg/prawn- 0.1.99.gem 6 $sudo gem install pkg/prawn- 0.1.99.gem 7 $gem search prawn 8 9 *** LOCAL GEMS *** 10 prawn (0.1.99, 0.1.2)
gemのバージョンについて
prawnのバージョンが0.1.99とでていますが、あくまでもpre-0.2としての位置づけだそうで(作者のsandalさんに教えてもらった)、バグ報告などの場合は、git logで表示されるcommitの後のSHA1をバージョンとして用いるそうです。
1 $git log 2 commit c92a03685cd013af8767 e7327b3a5d ef74a0a2ff 3 Date: Wed Aug 20 17:45:18 2008 -0400 4 5 Minimal changes to support character based wrapping
メモ:今git addしたファイルをコミットやめと思ったときに。
1 git add vendor/gems/prawn-0. 1.99.gem 2 git rm --cached vendor/gem s/prawn-0. 1.99.gem
ちなみに -f をつけるとリポジトリから削除されると同時にファイルも削除されます:
1 git rm -f vendor/gems/prawn-0. 1.99.gem
Hi all, long time no see ;-)
GoogleからChromeが出たので、久しぶりに動作確認作業などのメンテナンスを行い、Rails-2.1.
Thank you for your patience.
See Also
Gistとの差別化
Gist
がUbiquityコマンドのインストールに対応してくれたので、
Gist Ubiquitife
Sample Page
GistもそこまでUbiquity専用に機能追加するとも思えないので、 Ubiquity専用サービスである利点を生かしてみました。
そのうち評判が高い順のリストを表示するようにしようかと思います。
Gist Ubiquitifi
このたび、拡張パラメータを指定することによって、 コマンドのインストールページをカスタマイズできるようになりました。
例えば、以下のように、QueryStrin
name以外のパラメータは、インストールページ上で
表示されるだけで、実際のインストールの動作には影響しません。
Capistrano
Rails-2.1以降、config/envで、config.gemを指定することによって、アプリケーションが依存するGemを簡単に指定することができるようになりました。
また、ここで指定したGemは、
1 % sudo rake gems:install
とするだけで、インストールすることができます。
しかし、今のところ、capistrano
そこで、cap deployを実行した時に、必要なGemをサーバ上でインストールさせるためのレシピを紹介します。
config/dep
1 namespace :deploy do 2 task :restart, :roles => :app do 3 sudo "rake -f #{current_path}/Rakefile gems:insta ll" 4 end 5 end
上記のように、deploy:resのタスクで、Rakeコマンドを実行させるだけです。
簡単ですね。
今度はtridentを実行した結果、以下のようなWARNINGが出ました。
DEPRECATIO
N WARNING: Inflector is deprecated ! Use ActiveSupp ort::Infle ctor instead. See http://www .rubyonrai ls.org/dep recation for details. (called from formula/co nfig/initi alizers/in flections. rb:5)
なるほど。とりあえず、いわれたとおりに修正してみます。 Globalの名前空間を掃除する方向なのかな。
とりあえず、それ以外は特に問題なく移行完了。
s21gブログを動かしているEC2インスタンスのRailsを 2.1.1にバージョンアップしました。
Rails 2.1.1: Lots of bug fixes
Rails 2.1.1 is another maintenanc
e release that includes a bunch of bug fixes and a fix for the REXML vulnerabil ity. I’ve extracted all the changes from the CHANGELOGs into a single Gist. Enjoy!
以下、バージョンアップに関する作業ログです。
まずは
trident
を立ち上げると以下のようなWARNINGが。
DEPRECATIO
N WARNING: Dependenci es is deprecated ! Use ActiveSupp ort::Depen dencies instead. See http://www .rubyonrai ls.org/dep recation for details. (called from evaluate_i nit_rb at blog/vendo r/plugins/ background _fu/init.r b:1)
とりあえず最新版のBackground
config/env
1 config.gem 'ncr-background_fu', 2 :lib => 'background _fu', 3 :source => 'http://gem s.github.c om'
そして
1 % sudo rake gems:install
そして不要になったプラグインを削除。
1 % ./script/plugin remove background _fu 2 svn: '/home/taki uchi/blog/ vendor/plu gins' is not a working copy
おっと。script/pluはまだGitには対応してないのかな?
しかし警告メッセージは出ましたが、当該ディレクトリはきちんと削除されていた模様。
もう一度tridentを立ち上げるが、また同様の警告が出た。
ということで、background
config/env
1 config.gem 'genki-background_fu', 2 :lib => 'background _fu', 3 :source => 'http://gem s.github.c om'
これで警告は出なくなった。
rake -Tは特に問題なく実行できる。
rake testを実行。
DEPRECATIO
N WARNING: follow_red irect is deprecated and will be removed from Rails 2.2 (If you wish to follow redirects, you should use integratio n tests) See http://www .rubyonrai ls.org/dep recation for details. (called from test_clean ing_up_bla nk_page at ./test/fun ctional/ar ticles_con troller_te st.rb:305)
とのこと。follow_redを使いたい場合は
インテグレーションテストを使ってね、ということらしい。
いわれてみればその通りですね。
これを機にIntegratio
とりあえず、該当箇所をIntegratioscript/genコマンドがUpdateされてる可能性があったので、
rake rails:updaを実行してみたが、config/booが数行変わっただけであった。どうやらRubyGemsの最低要求バージョンが1.1.1以降となった模様。
Integratiofollow_redではなく、follow_red
を使う必要があった。
と、ここまででテストでのWARNINGもすべて解消。
あとはローカル環境で動作テストをした後に、
cap shellで必要なGemをインストールしてcap deploy
WARNINGを消すためにひと手間かかりましたが、 基本的には特に大きな修正も必要なくアップグレードできました。
NeverBlockの周辺の動き
最近、
NeverBlock
NeverBlock
is a Ruby library that allows developers to write non-blocki ng, concurrent code in a transparen t manner. Meaning that you will keep coding in your traditiona l ways while you get the benefit of non-blocki ng IO operations .
LL futureの講演者控え室で、まつもとさん、高橋さんから、
その辺の話を伺う機会がありましたが、
NeverBlock
Building the Never Blocking Rails, Making Rails 12X Faster
They told you it can't be done, they told you it has no scale. They told you lies!
What if you suddenly had the ability to serve mutliple concurrent
requests in a single Rails instance? What if you had the ability to multiplex IO operations from a single Rails instance? No more what ifs. It has been done.
NeverBlock
MySQLPlus:
MySQLPlus is billed as a new general purpose MySQL driver that supports "threaded access and async operations
"
NeverBlock
See Also