Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant error when run rake sunspot:solr:xxx in 1.3.0.rc* #87

Closed
yhslai opened this issue Sep 15, 2011 · 8 comments
Closed
Assignees
Labels

Comments

@yhslai
Copy link

yhslai commented Sep 15, 2011

I installed sunspot_rails 1.3.0.rc2, but I can't even start the solr server.

It's my rake sunspot:solr:start --trace:



** Invoke sunspot:solr:stop (first_time)
** Invoke environment (first_time)
** Execute environment
Warning: No memcahded
** Execute sunspot:solr:stop
rake aborted!
uninitialized constant Sunspot::Rails::Server
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/sunspot_rails-1.3.0.rc2/lib/sunspot/rails/tasks.rb:23:in `block (3 levels) in '
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/raincole/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/bin/rake:32:in `'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/raincole/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `'
Tasks: TOP => sunspot:solr:stop

I also tried 1.3.0.rc3, 1.3.0.rc4 but the results are the same. The problem was solve immediately after I turned back to 1.2.1 version.

@fabn
Copy link
Contributor

fabn commented Sep 17, 2011

I'm also having this issue with rc4

@fabn
Copy link
Contributor

fabn commented Sep 17, 2011

Partially solved by installing the sunspot_solr gem, however rake tasks doesn't work anymore. Had to use sunspot-solr start command.

With that I'm able to index and search for models, however can't run the reindex task because of this error:

> rake sunspot:reindex
Skipping progress bar - no such file to load -- progress_bar

I've used Model.find_each { |m| m.index }, but I think this not efficient while still useful for a quick try.

@alindeman
Copy link
Contributor

Thanks for the report. I'll look into this soon. Let me know if you come across any more details.

alindeman added a commit to alindeman/sunspot that referenced this issue Sep 18, 2011
@alindeman
Copy link
Contributor

Believe I've fixed this, but can you folks test it?

Change your Gemfile for sunspot_rails to this:

gem 'sunspot_rails', :git => 'git://github.com/alindeman/sunspot.git', :branch => 'solr_rake_tasks'

Run bundle update sunspot_rails and let me know if the tasks work? If so, I'll merge!

@ghost ghost assigned alindeman Sep 18, 2011
@alindeman
Copy link
Contributor

@fabn, can you file a separate issue about sunspot:reindex?

@alindeman
Copy link
Contributor

Going to merge this in and close. Please reopen if it continues being an issue.

@fabn
Copy link
Contributor

fabn commented Sep 23, 2011

Sorry for being late. Your commit has solved the issue in my case, thanks.

Just a notice, now when using rake sunspot:solr:start the pid file sunspot-solr.pid is created in the root directory of my rails project. Shouldn't it be in tmp/pids?

Furthermore I've noticed that the progress_bar issue was solved in this commit so it's not an issue anymore, even if the message is not so clear. Maybe something like this would be better:

You don't have the progress_bar gem in your bundle, add it with "gem 'progress_bar'" in your Gemfile, to show progress in realtime
Indexing in progress...

@alindeman
Copy link
Contributor

I haven't fully reviewed the code to move sunspot_solr to a gem. I'll look into the *.pid issue.

Totally agree on the progress_bar message: fixed in bbb0d7b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants