Hatena::Groupblo

元RX-7乗りの適当すぎる日々 このページをアンテナに追加 RSSフィード


過去記事一覧 | Main Blog (元RX-7乗りの適当な日々) | Tech Memo (id:rx7(@namikawa)の技術メモ)


2009/12/07

Radiant(0.6.9)の起動時にNoMethodError

Radiant(0.6.9)の起動時にNoMethodError - 元RX-7乗りの適当すぎる日々 を含むブックマーク はてなブックマーク - Radiant(0.6.9)の起動時にNoMethodError - 元RX-7乗りの適当すぎる日々 Radiant(0.6.9)の起動時にNoMethodError - 元RX-7乗りの適当すぎる日々 のブックマークコメント


サーバ移行した際に、移行先のサーバで以下のエラーが起動時に出力され、起動しなくなった。


$ ruby script/server -e production
=> Booting WEBrick...
/var/www/radiant/vendor/extensions/page_attachments/lib/geometry.rb:6: warning: already initialized constant FLAGS
/var/www/radiant/vendor/extensions/page_attachments/lib/geometry.rb:11: warning: already initialized constant RFLAGS
/var/www/radiant/vendor/extensions/page_attachments/lib/geometry.rb:28: warning: already initialized constant RE
/usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb:43:in `first': undefined method `[]' for #<Enumerable::Enumerator:0xb73f59dc> (NoMethodError)
        from /var/www/radiant/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:70:in `has_attachment'
        from /var/www/radiant/vendor/extensions/page_attachments/app/models/page_attachment.rb:4
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:496:in `require'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:104:in `require_or_load'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in `load_missing_constant'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in `const_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:465:in `const_missing'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:260:in `load_missing_constant'
        from /usr/local/lib/ruby/gems/1.8/gems/radiant-0.6.9/vendor/rails/activesupport/lib/active_support/dependencies.rb:453:in `const_missing'

Google先生に聞いてみたところ、以下をconfig/environment.rbに記載することで解決。

unless '1.9'.respond_to?(:force_encoding)
  String.class_eval do
    begin
      remove_method :chars
    rescue NameError
      # OK
    end
  end
end

参考

トラックバック - http://blo.g.hatena.ne.jp/rx7/20091207

ドミノ・ピザ【PC向けサイト】

デル株式会社