2012-10-28 30 views
1

我想在我的OS X機器上安裝Shapado。最終我想在Heroku上安裝它,所以如果有人有安裝指南,請讓我知道。被調用的ID爲零

我相信所有的依賴都行,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 

編輯從--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 
+0

你可以跟蹤耙任務嗎? 'rake bootstrap --trace RAILS_ENV = development' – alto

+0

謝謝alto,我已經使用跟蹤信息更新了帖子。 – ardochhigh

回答

3
在app /型號

/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

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

你確定有一個ShapadoVersion的token ='free'嗎?我認爲Rails正在抱怨這個問題。

+0

感謝您的信息。這不是我編寫的應用程序。我不確定代碼的作用。我試過這個修復:http://shapado.com/questions/rake-bootstrap-error-called-id-for-nil,它也沒有工作。 – ardochhigh

0

使用這個帖子:http://shapado.com/questions/rake-bootstrap-error-called-id-for-nil 我設法得到它過去耙引導通過執行以下操作:

改了行13 shapado.yml到真正

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。它看起來像一個很好的應用程序,但我找不到很多文檔。

相關問題