0

Google チャートを備えた Rails アプリがあります。localhost ではすべてうまくいきますが、Heroku ではそうではありません。ここにherokuログがあります:

$ heroku logs
2013-03-16T13:37:16+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T13:37:16+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T13:47:42+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T13:47:43+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 35505`
2013-03-16T13:47:45+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T13:47:45+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T13:47:45+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T13:47:45+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T13:47:47+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T13:47:47+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T13:57:51+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T13:57:53+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 14631`
2013-03-16T13:57:57+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T13:57:57+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T13:57:57+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T13:57:57+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T13:57:58+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T13:57:58+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:07:55+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T14:07:58+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 40304`
2013-03-16T14:08:00+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T14:08:00+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T14:08:00+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T14:08:00+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T14:08:01+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T14:08:01+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:18:01+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T14:18:03+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 46534`
2013-03-16T14:18:05+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T14:18:05+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T14:18:05+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T14:18:05+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T14:18:07+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:18:07+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T14:28:11+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T14:28:12+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 12019`
2013-03-16T14:28:16+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T14:28:16+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T14:28:16+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T14:28:16+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T14:28:17+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T14:28:17+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:38:18+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T14:38:20+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 26652`
2013-03-16T14:38:22+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T14:38:22+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T14:38:22+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T14:38:22+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T14:38:23+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T14:38:23+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:48:53+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T14:48:55+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 22351`
2013-03-16T14:48:57+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T14:48:57+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T14:48:57+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T14:48:57+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T14:48:58+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T14:48:58+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:58:59+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T14:59:01+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 25792`
2013-03-16T14:59:04+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T14:59:04+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T14:59:04+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T14:59:04+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T14:59:06+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T14:59:06+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T15:09:13+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T15:09:14+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 37918`
2013-03-16T15:09:16+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T15:09:16+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T15:09:16+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T15:09:16+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T15:09:17+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T15:09:17+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-16T15:19:51+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 32881`
2013-03-16T15:19:54+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-16T15:19:54+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-16T15:19:54+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-16T15:19:54+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-16T15:19:55+00:00 heroku[web.1]: Process exited with status 1
2013-03-16T15:30:16+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-16T15:32:31+00:00 heroku[web.1]: State changed from starting to down
2013-03-21T19:57:52+00:00 heroku[web.1]: Unidling
2013-03-21T19:57:52+00:00 heroku[web.1]: State changed from down to starting
2013-03-21T19:57:54+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 20966`
2013-03-21T19:57:56+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-21T19:57:56+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-21T19:57:56+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-21T19:57:56+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-21T19:57:57+00:00 heroku[web.1]: Process exited with status 1
2013-03-21T19:57:57+00:00 heroku[web.1]: State changed from crashed to starting
2013-03-21T19:57:57+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-21T19:57:59+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 58819`
2013-03-21T19:58:01+00:00 app[web.1]: /app/config/boot.rb:2:in `require': no such file to load -- google_chart (LoadError)
2013-03-21T19:58:01+00:00 app[web.1]:   from /app/config/boot.rb:2:in `<top (required)>'
2013-03-21T19:58:01+00:00 app[web.1]:   from script/rails:5:in `require'
2013-03-21T19:58:01+00:00 app[web.1]:   from script/rails:5:in `<main>'
2013-03-21T19:58:02+00:00 heroku[web.1]: Process exited with status 1
2013-03-21T19:58:02+00:00 heroku[web.1]: State changed from starting to crashed
2013-03-21T19:58:04+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=cvut-project-manager.herokuapp.com fwd="5.102.48.3" dyno= queue= wait= connect= service= status=503 bytes=
2013-03-21T19:58:06+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=cvut-project-manager.herokuapp.com fwd="5.102.48.3" dyno= queue= wait= connect= service= status=503 bytes=

私はgem "google_charts", "~> 1.2.0"を使用しています。

require 'google_chart'

boot.rbで。

プロジェクト コントローラーで:

.
.
#some minor logic
.
.
GoogleChart::PieChart.new('320x200', "Burndown pie chart",false) do |pc| 
  pc.data "Remain", @remain_points.to_i
  pc.data "Done", @done_points.to_i
  @chart =  pc.to_url
end
respond_to do |format|
  format.html # show.html.erb
  format.json { render :json => @project }
end
end

boot.rb:

require 'rubygems'
require 'google_chart'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

その宝石へのリンクは次のとおりです。

 https://github.com/rudionrails/google_charts

Rails バージョン 3.2.8Ruby 1.8.7

では、なぜこれが localhost では機能するのに heroku では機能しないのか教えてください。ありがとうございました。

4

1 に答える 1

0

最後に、私が使用した

gem "googlecharts"

これはかなりうまく機能します。

于 2013-05-04T15:06:20.013 に答える