开发者

Heroku App Crashes - Reports Error in ActiveSupport gem

开发者 https://www.devze.com 2023-03-18 08:03 出处:网络
I\'m having some hard time running my app on Heroku - The app runs perfect on my local machine. :( The logs report some problem with my ActiveSupport gem. So, i\'ve taken these measures:

I'm having some hard time running my app on Heroku - The app runs perfect on my local machine. :( The logs report some problem with my ActiveSupport gem. So, i've taken these measures:

1) Re-installed ActiveSupport gem 2) Rolled back my Git commit to a previous one which was working fine. 3) Copied my app to a new folder - Created a new Git Repo, did bundle install in new folder, Made Commits, Added Heroku remote origin, pushed app to Heroku - didn't helped.

My Rails Version: 3.0.3 Ruby: 1.8.7

Here is my Heroku Log (Updated)

Surprisingly enough i'm getting 1.9.1 after ./bundle/gems/ruby/1.9.1 whereas the project is using Ruby 1.8.7. Any ideas how i can fix this?

    2011-07-08T00:42:53+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:304:in `rescue in depend_on': No such file to load -- errors_helper (LoadError)
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:299:in `depend_on'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:216:in `require_dependency'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:137:in `block in eager_load!'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/config/environment.rb:5:in `<top (required)>'
2011-07-08T00:42:53+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-07-08T00:42:53+00:00 app[web.1]:   from <internal:lib/rubygems/custom_require>:29:in `require'
2011-07-08T00:42:53+00:00 app[web.1]:   from config.ru:3:in `block (3 levels) in <main&开发者_运维百科gt;'
2011-07-08T00:42:53+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `eval'
2011-07-08T00:42:53+00:00 app[web.1]:   from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in <main>'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `new'
2011-07-08T00:42:53+00:00 app[web.1]:   from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.3/lib/rack/builder.rb:63:in `map'


If you are using Rails 3x, you should be using rubygems 1.9.2, not 1.8.7. Also make sure you have your correct rails version declared in your environment.rb if you are on rails 2x as well as your Gemfile.

So for rails 2x project

environment.rb

RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION

Gemfile

gem 'rails', '2.3.8'

and for rails 3x project

Gemfile

gem 'rails', '3.0.7'

That way heroku knows which rails version to load under which gem sets. You should be able to

git push heroku master

if it is all straightened out


OK, I've fixed this thing. And i feel like throwing myself from the tallest building in the world for this. I've been struggling with this since the last week.

There was a file in my app/helpers directory called errors_helper.rb which was unfortunately named errors_helper.rb.rb

Changing the name extension solved my problem!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号