1

我正在尝试在我的 OS X 机器上安装 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

编辑 rake 上 --trace 标志的输出

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil,  use object_id
/Users/sean/Dropbox/rails/shapado/app/models/group.rb:641:in `set_shapado_version'

问题代码是这样的:

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

3 回答 3

3

在 app/models/group.rb 更改

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

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

这是相关的合并请求:https ://gitorious.org/shapado/shapado/merge_requests/18

于 2013-02-23T06:10:39.773 回答
1
def set_shapado_version
  self.shapado_version_id = ShapadoVersion.where(:token => 'free').first.id
end

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

于 2012-10-28T10:34:42.700 回答
0

使用这篇文章:http ://shapado.com/questions/rake-bootstrap-error-called-id-for-nil 我通过执行以下 操作设法让它通过了rake 引导:

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

is_shapadocom: 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 方面。它看起来像一个不错的应用程序,但我找不到太多的文档方式。

于 2012-10-28T11:17:21.027 回答