0

I've got Rails app with Google charts. Everything goes very well on localhost, but on Heroku doesn't. Here is a heroku log:

$ 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=

I'm using gem "google_charts", "~> 1.2.0" and I've got

require 'google_chart'

in boot.rb.

In project controller:

.
.
#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'])

And link to that gem is:

 https://github.com/rudionrails/google_charts

Rails version 3.2.8 with Ruby 1.8.7

So, please, can you tell me, why this works on localhost but not on heroku? Thank you.

medy75
  • 652
  • 11
  • 33
  • I know you said it is working on localhost but isn't it `require googlecharts`? I've used it sometime ago and I'm sure it is `googlecharts` –  Mar 21 '13 at 20:20
  • @Gerep doesn't look that's the case: https://github.com/rudionrails/google_charts – fmendez Mar 21 '13 at 20:23
  • @medy75 What ruby version are you using? I ask because of this previous question: http://stackoverflow.com/questions/3973806/heroku-app-fails-to-start-require-no-such-file-to-load-sinatratestapp-l – fmendez Mar 21 '13 at 20:24
  • @fmendez yes, different gem, sorry =/ But still think is weird to install `google_charts` and require require `google_chart` but I'm new to rails so.... –  Mar 21 '13 at 20:25
  • @fmandez yes, this is gem that I use in my app :-) – medy75 Mar 21 '13 at 20:25
  • @medy75 can you update the question and post the boot.rb? – fmendez Mar 21 '13 at 20:32
  • Updated. Ruby 1.8.7, Rails 3.2.8 – medy75 Mar 21 '13 at 20:43
  • Try this: instead of require 'google_charts' do require './google_charts' – fmendez Mar 21 '13 at 20:45
  • @medy75 out of curiosity, why are you using ruby 1.8.7? and are you specifying that version on the Gemfile ? – fmendez Mar 21 '13 at 20:52
  • In GEMFILE I've got gem "google_charts", "~> 1.2.0". And I'm using 1.8.7 because newest rails magically doesn't work on my 64bit linux :-/ – medy75 Mar 21 '13 at 20:55
  • './google_charts' on localhost works, on Heroku doesn't – medy75 Mar 21 '13 at 20:57

1 Answers1

0

Finally, I used

gem "googlecharts"

which works pretty well.

medy75
  • 652
  • 11
  • 33