Search code examples
solrjrubyjrubyonrailssunspotsunspot-rails

sunspot with jruby


Hi can sunspot be used with jruby, also here is my app details

jruby-1.6.1
rails 3.0.7 

when i install all the gems and run rake sunspot:solr:start it gives me the following error 

Gem::LoadError: Could not find RubyGem sunspot (>= 0)

  report_activate_error at /Users/dpatel/.rvm/rubies/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems.rb:861
               activate at /Users/dpatel/.rvm/rubies/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems.rb:255
                    gem at /Users/dpatel/.rvm/rubies/jruby-1.6.1/lib/ruby/site_ruby/1.8/rubygems.rb:1215
                 (root) at /Users/dpatel/.rvm/gems/jruby-1.6.1@solr/bin/sunspot-solr:18

However when I run rake sunspot:solr:run, it works fine.

Also, when i search using Model.search, it works fine, but I when I fire up solr webapp on the browser and search something, it does not work.

Can anyone tell me what is happening, new to sunspot.

-Thanks


Solution

  • Hi i kinda figured it out, i am on jruby and fork is not allowed on jruby, and rake sunspot:solr:start tries to fork and thrown out an error but rake sunspot:solr:run starts solr in the foreground and works fine, a little painful but all is well :-)

    -D