Hatena::ブログ(Diary)

ikeasの日記 RSSフィード Twitter

2011-04-16

rascut + Ruby 1.9.2

| 19:31 | rascut + Ruby 1.9.2を含むブックマーク

gemrascutインストールしようとして以下のエラーが出る場合、

% gem install rascut
Building native extensions.  This could take a while...
...

make
gcc -I. -I/Users/saeki/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/x86_64-darwin10.6.0 -I/Users/saeki/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/ruby/backward -I/Users/saeki/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-common -pipe  -o http11.o -c http11.c
http11.c: In function ‘http_field’:
http11.c:70: warning: format not a string literal and no format arguments
http11.c:71: warning: format not a string literal and no format arguments
http11.c:77: error: ‘struct RString’ has no member named ‘ptr’
http11.c:77: error: ‘struct RString’ has no member named ‘len’
...
http11.c:307: warning: format not a string literal and no format arguments
make: *** [http11.o] Error 1

以下の形で先にMongrelインストールしてからrascutを導入する。

 % gem install mongrel --pre

さらにrascutを起動して以下のエラーが出る場合、

 % rascut HelloWorld.as 
 /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/lib/rascut/command.rb:119:in `block in setting_signals': undefined method `upcase' for 0:Fixnum (NoMethodError)
	from /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/lib/rascut/command.rb:116:in `each'
	from /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/lib/rascut/command.rb:116:in `setting_signals'
	from /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/lib/rascut/command.rb:41:in `run'
	from /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/bin/rascut:10:in `<top (required)>'
	from /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/bin/rascut:19:in `load'
	from /Users/saeki/.rvm/gems/ruby-1.9.2-p136@my_app/bin/rascut:19:in `<main>'

以下のファイルを編集する。(下はRVM環境の例なのでパスは適宜変更する)

~/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/lib/rascut/command.rb
# 117行目くらい
def setting_signals
  methods(true).each do |mname|
    if m = mname.to_s.match(/^sig_(.+)$/)      # to_sを追加
      begin def setting

ついでに以下も編集。

~/.rvm/gems/ruby-1.9.2-p136@my_app/gems/rascut-0.2.1/lib/rascut/fcsh_wrapper.rb
# 68行目くらい
@process = IO.popen(@config[:fcsh_cmd] + ' 2>&1', 'r+') unless @process
@process.set_encoding "Shift_JIS"     # この行を追加
ENV['LANG'] = orig_lang
トラックバック - http://d.hatena.ne.jp/ikeas/20110416/1302949899