Starting Thinking Sphinx on Joyent SmartOS with svcadm

I followed this tutorial: and the
RailsCast about configuring Nginx and Unicorn, and successfully set up
my first non-Passenger/Apache Rails app last weekend.

Buoyed by this success, I next set about trying to get ThinkingSphinx to
restart when the server starts, and managed to get my server to run away
with 115% server usage. (Oddly, while that was going on, TS was working
just fine.)

As you know, starting TS requires one to cd into the Rails directory,
then issue a rake command: rake ts:start

Using these commands to start and stop, then:

/usr/local/rvm/gems/[email protected]/bin/bundle exec rake ts:start
/usr/local/rvm/gems/[email protected]/bin/bundle exec rake ts:stop

and these environment variables to set the necessary paths:

svccfg -s sphinx setenv PATH
svccfg -s sphinx setenv GEM_PATH
/usr/local/rvm/gems/ruby-1.9.3-p547:/usr/local/rvm/gems/[email protected]

What resulted was a death by a thousand errors; this repeated over and

[ Jun 3 01:10:02 Stopping because service exited with an error. ]
[ Jun 3 01:10:02 Executing start method
("/usr/local/rvm/gems/[email protected]/bin/bundle exec
/usr/local/rvm/gems/ruby-1.9.3-p547/bin/rake ts:start
RAILS_ENV=production"). ]
rake aborted!
ArgumentError: couldn’t find HOME environment – expanding ~' /usr/local/rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks193:15:ineval’
(See full trace by running task with --trace)

Can anyone point me to a recipe for using svcadm to start a Rails helper
like this? Anyone see a glaring error in my approach?

Thanks in advance,


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs