我正在使用Mongodb.App正在使用ROR应用程序在localhost上正常工作,但是当我在heroku中部署它时,我收到错误。我的一个视图文件命令是:
@h=Portfolio.last.folders
<%= @h%>
投资组合是一个集合,字段文件夹为数组。生产中的Mongodb包含这个。
即使我尝试在heroku rails控制台中做同样的事情我也得到了同样的错误:
TypeError: no implicit conversion of Fixnum into String
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:35:in `+'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:35:in `digest'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:47:in `build_auth_command'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/protocol/commands/authenticate.rb:25:in `initialize'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:488:in `new'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:488:in `login'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:48:in `block in apply_auth'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:47:in `each'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/node.rb:47:in `apply_auth'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/cluster.rb:250:in `with_secondary'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/session/context.rb:104:in `with_node'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/session/context.rb:43:in `query'
from /app/vendor/bundle/ruby/2.0.0/gems/moped-1.4.3/lib/moped/query.rb:115:in `first'
from /app/vendor/bundle/ruby/2.0.0/gems/mongoid-3.0.15/lib/mongoid/contextual/mongo.rb:233:in `last'
from /app/vendor/bundle/ruby/2.0.0/gems/mongoid-3.0.15/lib/mongoid/contextual.rb:18:in `last'
from /app/vendor/bundle/ruby/2.0.0/gems/mongoid-3.0.15/lib/mongoid/finders.rb:129:in `last'
from (irb):2
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
在开发机器中,我可以在控制台中执行此操作。任何猜测为什么这个错误在heroku上。