trinidad init services JRubyDaemon: no such file to load -- trinidad

259 views
Skip to first unread message

Peter Ehrlich

unread,
Dec 29, 2012, 3:09:55 PM12/29/12
to rails-t...@googlegroups.com
Hi

Just set up a fresh Rails app-- RVM, Capistrano, Nginx, Trinidad; similar to Ryan Bates' Railscast on the subject.  Now trying to use trinidad init services to have trinidad run as a service.  It's not working:

↳  service trinidad_MyApp start
Starting trinidad daemon...
sudo -u root /usr/bin/jsvc -home /usr/lib/jvm/java-7-openjdk/jre -wait 20 -pidfile /root/MyApp/shared/pids/trinidad.pid -procname jsvc-trinidad -jvm server -outfile /root/MyApp/shared/log/trinidad.log -errfile &1 -cp /usr/local/rvm/gems/jruby-1.7.1/gems/trinidad_init_services-1.2.2/trinidad-libs/jruby-jsvc.jar:/usr/local/rvm/gems/jruby-1.7.1/gems/trinidad_init_services-1.2.2/trinidad-libs/commons-daemon.jar:/usr/local/rvm/rubies/jruby-1.7.1/lib/jruby.jar -Djruby.shell=/bin/sh -Djffi.boot.library.path=/usr/local/rvm/rubies/jruby-1.7.1/lib/native/arm-Linux:/usr/local/rvm/rubies/jruby-1.7.1/lib/native/i386-Linux:/usr/local/rvm/rubies/jruby-1.7.1/lib/native/x86_64-Linux -Djruby.home=/usr/local/rvm/rubies/jruby-1.7.1 -Djruby.lib=/usr/local/rvm/rubies/jruby-1.7.1/lib -Djruby.script=jruby -Djruby.daemon.module.name=Trinidad -Djruby.compat.version=RUBY1_9 -Xmx500m -Xss2048k -Xbootclasspath/a:/usr/local/rvm/rubies/jruby-1.7.1/lib/jruby.jar -Dfile.encoding=UTF-8 com.msp.jsvc.JRubyDaemon /usr/local/rvm/gems/jruby-1.7.1/gems/trinidad_init_services-1.2.2/lib/trinidad/daemon.rb -d /root/MyApp/current -e production
Daemon exited with status: 1. Check pidfile and log

In the log file:

↳  cat /root/MyApp/current/log/trinidad.log 
JRubyDaemon: Script raised an error: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- trinidad
org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- trinidad
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
at RUBY.require(/usr/local/rvm/rubies/jruby-1.7.1/lib/ruby/shared/rubygems/custom_require.rb:36)
at usr.local.rvm.gems.jruby_minus_1_dot_7_dot_1.gems.trinidad_init_services_minus_1_dot_2_dot_2.lib.trinidad.daemon.(root)(/usr/local/rvm/gems/jruby-1.7.1/gems/trinidad_init_services-1.2.2/lib/trinidad/daemon.rb:2)
Cannot load daemon
Service exit with a return value of 3

We assume that this may have something to do with RVM and bundler/gem install paths.

Thanks.

Tim Olsen

unread,
Jan 2, 2013, 10:25:44 AM1/2/13
to rails-t...@googlegroups.com
I agree that this is probably due to rvm and/or bundler/gem install paths.  I see you are starting trinidad as root.  First figure out the rvm or bundler command to get paths set up properly (maybe rvmsudo and/or bundle exec) as root.

Tim





--
Has recibido este mensaje porque estás suscrito al grupo "Rails Trinidad" de Grupos de Google.
Para ver este debate en la Web, visita https://groups.google.com/d/msg/rails-trinidad/-/ljlRP7VdMfYJ.
Para publicar una entrada en este grupo, envía un correo electrónico a rails-t...@googlegroups.com.
Para anular tu suscripción a este grupo, envía un correo electrónico a rails-trinida...@googlegroups.com
Para tener acceso a más opciones, visita el grupo en http://groups.google.com/group/rails-trinidad?hl=es.

Oleg Kovalenko

unread,
Jul 22, 2013, 2:49:30 PM7/22/13
to rails-t...@googlegroups.com
Faced with the same problem.

Need to populate env variables (see https://rvm.io/integration/cron#environment).

1 Generate env variables file (for example: ruby version 1.9.2-p290, gemset projectX):
$ rvm env --path -- 1.9.2-p290@projectX # will produce something like /path/to/env/variables/file/ruby-1.9.2-p290@projectX

2 Add line (written below) to generated /etc/init.d/trinidad at top, right after RUBY_SCRIPT=...
source /path/to/env/variables/file/ruby-1.9.2-p290@projectX

and don't forget to set owner of trinidad.pid to user running trinidad.

Субота, 29 грудня 2012 р. 22:09:55 UTC+2 користувач Peter Ehrlich написав:
Reply all
Reply to author
Forward
0 new messages