Flying Sphinx 2 in development environment

mateusz.dominiak's Avatar

mateusz.dominiak

08 Jun, 2018 01:26 PM

I recently upgraded to:
gem 'thinking-sphinx', '~> 4.0'
gem 'flying-sphinx', '~> 2.0'

from flying-sphinx 1.2.0.

If I understand correctly, flying sphinx is now overriding/intercepting thinking sphinx commands. I no longer can start the daemon for local development. I'm having the following error:

bundle exec rails ts:start --trace
** Invoke ts:start (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute ts:start
rails aborted!
TypeError: no implicit conversion of nil into String
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/ey-hmac-2.2.0/lib/ey-hmac/adapter.rb:41:in `digest'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/ey-hmac-2.2.0/lib/ey-hmac/adapter.rb:41:in `signature'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/ey-hmac-2.2.0/lib/ey-hmac/adapter.rb:49:in `authorization'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/ey-hmac-2.2.0/lib/ey-hmac/adapter/faraday.rb:61:in `sign!'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/ey-hmac-2.2.0/lib/ey-hmac.rb:53:in `sign!'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/flying-sphinx-2.1.1/lib/flying_sphinx/request/hmac.rb:11:in `call'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/faraday-0.11.0/lib/faraday/request/url_encoded.rb:15:in `call'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/faraday-0.11.0/lib/faraday/rack_builder.rb:139:in `build_response'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/faraday-0.11.0/lib/faraday/connection.rb:377:in `run_request'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/faraday-0.11.0/lib/faraday/connection.rb:140:in `get'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/flying-sphinx-2.1.1/lib/flying_sphinx/api.rb:22:in `get'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/flying-sphinx-2.1.1/lib/flying_sphinx/commands/running.rb:5:in `call'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/flying-sphinx-2.1.1/lib/flying_sphinx/commands/base.rb:21:in `call_with_handling'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/commands/base.rb:7:in `call'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/commander.rb:7:in `call'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/interfaces/base.rb:9:in `command'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/interfaces/daemon.rb:5:in `start'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/thinking-sphinx-4.0.0/lib/thinking_sphinx/tasks.rb:28:in `block (2 levels) in <top (required)>'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:248:in `block in execute'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `each'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:243:in `execute'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/airbrake-6.1.2/lib/airbrake/rake.rb:19:in `execute'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:180:in `invoke_with_call_chain'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/task.rb:173:in `invoke'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:152:in `invoke_task'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/rake/rake_command.rb:21:in `block in perform'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/command.rb:46:in `invoke'
/Users/matt/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => ts:start

What's the recommended way to run ts:* tasks in development with flying-sphinx 2 in Gemfile?

  1. Support Staff 1 Posted by Pat Allan on 08 Jun, 2018 01:33 PM

    Pat Allan's Avatar

    Ah, that's definitely a bug! I'll work on a fix, hopefully in the next few hours. But prior to that, if you limit flying-sphinx to your production environment, then it won't load locally and the rake tasks should be fine.

  2. Support Staff 2 Posted by Pat Allan on 08 Jun, 2018 03:33 PM

    Pat Allan's Avatar

    Okay, I've just pushed a fix, which you can use via git in your Gemfile:

    gem "flying-sphinx", "~> 2.1",
      :git    => "https://github.com/flying-sphinx/flying-sphinx.git",
      :branch => "develop",
      :ref    => "bec5bf23cf"
    

    I'll aim to get a proper gem release out in the next day or so.

  3. 3 Posted by mateusz.dominia... on 08 Jun, 2018 05:12 PM

    mateusz.dominiak's Avatar

    Thanks so much! I'll try it out.

  4. Support Staff 4 Posted by Pat Allan on 09 Jun, 2018 06:03 AM

    Pat Allan's Avatar

    And just published the gem release that includes this fix: v2.1.2.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac