Ruby on rails 呼叫id为零

Ruby on rails 呼叫id为零,ruby-on-rails,mongodb,shapado,Ruby On Rails,Mongodb,Shapado,我正在尝试在我的OSX机器上安装Shapado。最终我想在Heroku上安装它,所以如果有人有安装指南,请告诉我 我相信依赖关系都很好,mongodb正在运行。我在运行时出错: $rake bootstrap RAILS_ENV=development rake aborted! Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id Seans-

我正在尝试在我的OSX机器上安装Shapado。最终我想在Heroku上安装它,所以如果有人有安装指南,请告诉我

我相信依赖关系都很好,mongodb正在运行。我在运行时出错:

$rake bootstrap RAILS_ENV=development

rake aborted!
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id


Seans-MacBook-Pro:shapado sean$ rake bootstrap RAILS_ENV=development
/Users/sean/.rvm/gems/ruby-1.9.3-p194/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:22:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
Loaded
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/sean/Dropbox/rails/shapado/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/sean/Dropbox/rails/shapado/Rakefile:7)
Missing GeoIP data. Please run '/Users/sean/Dropbox/rails/shapado/script/update_geoip'
>> Setting up Twitter provider
>> Setting up Facebook provider
>> Setting up Identica provider
>> Setting up Github provider
>> Setting up LinkedIn provider
rake aborted!
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

Tasks: TOP => bootstrap => setup:default_group
(See full trace by running task with --trace)
Seans-MacBook-Pro:shapado sean$ rake bootstrap RAILS_ENV=development
/Users/sean/.rvm/gems/ruby-1.9.3-p194/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:22:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
Loaded
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/sean/Dropbox/rails/shapado/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/sean/Dropbox/rails/shapado/Rakefile:7)
Missing GeoIP data. Please run '/Users/sean/Dropbox/rails/shapado/script/update_geoip'
>> Setting up Twitter provider
>> Setting up Facebook provider
>> Setting up Identica provider
>> Setting up Github provider
>> Setting up LinkedIn provider
rake aborted!
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
问题代码如下:

def set_shapado_version
  self.shapado_version_id = ShapadoVersion.where(:token => 'free').first.id
end
你确定有一个ShapadoVersion,其中token='free'?我认为Rails正在抱怨这个问题

你确定有一个ShapadoVersion,其中token='free'?我认为Rails正在抱怨这个问题

使用此帖子: 我通过以下操作成功地通过了rake引导:

将shapado.yml中的第13行更改为true

在config/payments.yml中添加了以下内容

secret: vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE
添加了以下代码。原始行被注释。可能不是最好的方法

def self.reload!
  #return unless AppConfig.is_shapadocom
  unless AppConfig.is_shapadocom
    ShapadoVersion.new(token: "free", price: 0).save!
    return
  end
  .
  .
  .
如果有人知道Shapado,请查阅我的个人资料并与我联系。我对分享经验很感兴趣,尤其是在推动Heroku方面。这看起来是一个不错的应用程序,但我在文档方面找不到太多东西。

使用本文: 我通过以下操作成功地通过了rake引导:

将shapado.yml中的第13行更改为true

在config/payments.yml中添加了以下内容

secret: vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE
添加了以下代码。原始行被注释。可能不是最好的方法

def self.reload!
  #return unless AppConfig.is_shapadocom
  unless AppConfig.is_shapadocom
    ShapadoVersion.new(token: "free", price: 0).save!
    return
  end
  .
  .
  .

如果有人知道Shapado,请查阅我的个人资料并与我联系。我对分享经验很感兴趣,尤其是在推动Heroku方面。它看起来是一个不错的应用程序,但我在app/models/group.rb change中找不到太多文档。

def set_shapado_version
  self.shapado_version_id = ShapadoVersion.where(:token => 'free').first.id
end


以下是相关的合并请求:

在app/models/group.rb change中

def set_shapado_version
  self.shapado_version_id = ShapadoVersion.where(:token => 'free').first.id
end


下面是相关的合并请求:

您可以跟踪rake任务吗?rake bootstrap-trace RAILS\u ENV=developmentThank alto,我已经用跟踪信息更新了帖子。你能跟踪rake任务吗?rake bootstrap-trace RAILS\u ENV=developmentThank alto,我已经用跟踪信息更新了帖子。谢谢你的帖子。这不是我编写的应用程序。我不确定代码的作用。我试过这个方法,但也没用。谢谢你的帖子。这不是我编写的应用程序。我不确定代码的作用。我试过这个方法,但也没用。
def set_shapado_version
  self.shapado_version_id = ShapadoVersion.where(:token => 'free').first.try(:id)
end