我正在尝试在Heroku上安装WebSolr。我选择了每月20美元的套餐。我按照插件页面上的说明操作:
我在我的Gemfile中添加了以下内容:
gem 'sunspot_rails', '~> 1.3.0'
在heroku配置中,我也有一个合适的URL:
WEBSOLR_URL: http://index.websolr.com/solr/xxxyyyzzz
当启动服务器时,我在本地和heroku日志中得到相同的错误:
/Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/sunspot_rails-1.3.3/lib/sunspot/rails/configuration.rb:297:in `join': no implicit conversion of nil into String (TypeError)
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/sunspot_rails-1.3.3/lib/sunspot/rails/configuration.rb:297:in `user_configuration'
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/sunspot_rails-1.3.3/lib/sunspot/rails/configuration.rb:281:in `user_configuration_from_key'
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/sunspot_rails-1.3.3/lib/sunspot/rails/configuration.rb:256:in `disabled?'
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/sunspot_rails-1.3.3/lib/sunspot/rails.rb:30:in `build_session'
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/sunspot_rails-1.3.3/lib/sunspot/rails/init.rb:1:in `<top (required)>'
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
from /Users/patricegagnon/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
…
服务器拒绝启动,我不能再访问我的任何控制器。到目前为止,我还没有做任何其他事情。有人知道为什么这个通用Solr集成会破坏我的服务器启动吗?
如果你正在使用Sunspot 1.3,因为你也在运行Rails 2。x,则需要运行script/generate sunspot
。如果您正在使用Rails 3或4,则应该更新到更新的Sunspot。最新版本为2.1.