1

私の PC では正常に動作する heroku アプリがありますが、Heroku で実行すると問題が発生します。

内部サーバーエラー

#<Icalendar::Calendar:0x00000000fe2c98> の未定義メソッド `bytesize'
WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20) Blooming-shore-6714.herokuapp.com:80 で

コマンド curl -v -H "Content-type: text/plain" --data-binary @invite.ics http://blooming-shore-6714.herokuapp.com/ics2eventを使用してデータを送信します

ファイル @invite.ics は、あなたが横たわっている任意の ics ファイルである可能性があります。

ファイルインスタンスの代わりに stringio インスタンスで icalendar の parse() を使用しようとすると、エラーが発生します (と思います)。ドキュメントを読むと、StringIO のインスタンスはファイルと互換性があるはずです。

参考までに、これが私の web.rb ファイルです。

require 'sinatra'
require 'rubygems'
require 'icalendar'

get '/' do
  "new version"
end

get '/test' do
  "You've found me!"
end

post '/ics2event' do
  request.body.string

  invite = StringIO.new(request.body.string)

  cals = Icalendar.parse(invite)

  for each in cals do
    for eachEvent in each.events do
      eachEvent.summary
      eachEvent.description
      eachEvent.location
      eachEvent.status
      eachEvent.dtstart
      eachEvent.dtend
      eachEvent.organizer
      for eachAttendee in eachEvent.attendees do
        eachAttendee.to
      end
    end
  end

end

問題は、どうすればそれをなくすことができるかということです。

4

0 に答える 0