Cannot start thin server as a service, RubyGems: could not find thin

I used the following instructions to install and configure the Thin server as a service on Ubuntu 10.04.4 with Rails 3.2.3:

http://articles.slicehost.com/2008/5/6/ubuntu-hardy-thin-web-server-for-ruby

Thin server works fine with application root using thin start

However, when I try to start the service using any of these commands:

service thin start
sudo service thin start
/etc/init.d/thin start
sudo /etc/init.d/thin start

I get the following error:

/home/myuser/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find thin (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
    from /home/myuser/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
    from /home/myuser/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
    from /home/myuser/.rvm/gems/ruby-1.9.3-p125/bin/thin:18:in `<main>'

This does not seem to be a problem with PATH, "which is thin" returns correctly:

home/myuser/.rvm/gems/ruby-1.9.3-p125/bin/thin

I also checked the existence of ** / bin / thin, wherever it is mentioned

I tried reinstalling the gem using "gem uninstall thin", "gem install thin" without success

- ? :

, , ssh, ,

+5
2

, . , rvm, :

#! /bin/sh
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then

  # First try to load from a user install
  source "$HOME/.rvm/scripts/rvm"

elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then

  # Then try to load from a root install
  source "/usr/local/rvm/scripts/rvm"

else

  printf "ERROR: An RVM installation was not found.\n"

fi

rvm use 1.9.3
cd /path/to/your/application/code
bundle exec thin -d

/etc/init.d/thin_service

$ sudo update-rc.d  thin_service defaults

, , sudo start thin_service sudo stop start_thin . , railsgems-bundler rvm wrapper. , rvm

+2

stacktrace rvm, , rvm- . , rvmsudo thin install sudo thin install. rvmsudo thin config .

,

rvm wrapper <your_rvm_ruby_version>@<your_rvm_gemset_in_use> bootup thin

, rvm list rvm gemset . bootup_thin, , rvm, bootup_thin. , , . script

sudo nano /etc/init.d/thin

DAEMON

DAEMON=location_of_bootup_thin 

which bootup_thin. .

sudo service thin start

,

+5

All Articles