NoMethodError(nil的未定义方法`text':NilClass)发生了什么?

时间:2012-11-13 21:06:35

标签: ruby-on-rails-3

这个错误出现在我的heroku日志中,我不确定发生了什么。该应用程序运行不正常,并在许多不同的位置打破。奇怪的是,这开始发生在无处。在过去7天内未进行任何更改。周五一切都运行正常,这意味着这个错误在过去4天的某个时间开始发生。

是否存在可能导致此错误的周末可能已更改/更新的任何gem依赖项?

发布是错误

Started POST "/advisors/4fbfb0b5ce5da90001000038/intro" for 64.20.10.252 at 2012-11-13 20:24:54 +0000
2012-11-13T20:24:54+00:00 app[web.1]: Cache read: delayed_job_workers ({:expires_in=>1200 seconds})
2012-11-13T20:24:54+00:00 app[web.1]: Cache generate: delayed_job_workers ({:expires_in=>1200 seconds})
2012-11-13T20:24:54+00:00 app[web.1]:  !    DEPRECATED: Heroku::Client#deprecate is deprecated, please use the heroku-api gem.
2012-11-13T20:24:54+00:00 app[web.1]:  !    DEPRECATED: More information available at https://github.com/heroku/heroku.rb
2012-11-13T20:24:54+00:00 app[web.1]:  !    DEPRECATED: Deprecated method called from /app/vendor/bundle/ruby/1.9.1/gems/heroku-2.31.0/lib/heroku/client.rb:247.
2012-11-13T20:24:57+00:00 app[web.1]: 
2012-11-13T20:24:57+00:00 app[web.1]: NoMethodError (undefined method `text' for nil:NilClass):
2012-11-13T20:24:57+00:00 app[web.1]:   lib/my_company/delayed_job_wrapper.rb:70:in `block in running_workers'
2012-11-13T20:24:57+00:00 app[web.1]:   lib/my_company/delayed_job_wrapper.rb:68:in `running_workers'
2012-11-13T20:24:57+00:00 app[web.1]:   lib/my_company/delayed_job_wrapper.rb:23:in `autostart'
2012-11-13T20:24:57+00:00 app[web.1]:   lib/my_company/delayed_job_wrapper.rb:17:in `feed'
2012-11-13T20:24:57+00:00 app[web.1]:   app/models/user.rb:101:in `block in introduce'
2012-11-13T20:24:57+00:00 app[web.1]:   app/models/user.rb:100:in `each'
2012-11-13T20:24:57+00:00 app[web.1]:   app/models/user.rb:100:in `introduce'
2012-11-13T20:24:57+00:00 app[web.1]:   app/controllers/advisors_controller.rb:66:in `intro'

的Gemfile

source 'http://rubygems.org'

require 'rubygems'

source 'https://code.stripe.com'

gem 'rails', '3.1.3'

gem 'thin'
gem 'newrelic_rpm'

gem "mongo", '1.5.2'
gem "mongoid", '2.4.3'

gem 'memcachier'
gem 'dalli'

gem 'delayed_job'
gem 'delayed_job_mongoid'

gem 'rack-cache'
#gem 'SystemTimer' #Not necessary, but memcache recommends it for performance.
#gem 'memcached-northscale', '0.17.1' #Notice it's memcached, with a D.

gem "heroku"

gem 'json'

#gem 'libxml-ruby'
#gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

gem 'ruby-hmac'
gem 'bcrypt-ruby'

gem 'bson_ext'

gem 'aws-sdk'

gem 'oauth2'

gem 'oauth'

gem 'stripe'

gem 'paperclip'
gem 'mongoid-paperclip'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.1.5'
#  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'fb_graph'

group :development do
  gem 'rspec-rails', '2.7.0'
end

group :test do
  gem "rspec", "2.7.0"
  gem 'turn', '0.8.2', :require => false

  gem "autotest"
  gem "autotest-rails"
end

1 个答案:

答案 0 :(得分:1)

问题是Heroku gem已被弃用,因此我将gemfile中的gem“heroku”替换为“heroku-api”