尝试加载 gem 'yard' 时出错
There was an error while trying to load the gem 'yard'
我正在使用 sidekiq upstart 作业,但是 运行 sudo service sidekiq restart
出现以下错误
There was an error while trying to load the gem 'yard'.
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/home/ubuntu/myapp/config/application.rb:8:in `<top (required)>'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:231:in `require'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:231:in `boot_system'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:49:in `run'
/home/ubuntu/.rvm/gems/ruby-2.2.1@global/gems/sidekiq-3.2.5/bin/sidekiq:8:in `<top (required)>'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/bin/sidekiq:23:in `load'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/bin/sidekiq:23:in `<main>'
以下是暴发户工作
/etc/init/sidekiq.conf
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then manage sidekiq with:
# sudo start sidekiq index=0
# sudo stop sidekiq index=0
# sudo status sidekiq index=0
#
# Hack Upstart's reload command to 'quiet' Sidekiq:
#
# sudo reload sidekiq index=0
#
# or use the service command:
# sudo service sidekiq {start,stop,restart,status}
#
description "Sidekiq Background Worker"
# This script is not meant to start on bootup, workers.conf
# will start all sidekiq instances explicitly when it starts.
start on runlevel [2345]
stop on runlevel [06]
# change to match your deployment user
setuid ubuntu
setgid ubuntu
#respawn
#respawn limit 3 30
# TERM is sent by sidekiqctl when stopping sidekiq. Without declaring these as
# normal exit codes, it just respawns.
normal exit 0 TERM
# Older versions of Upstart might not support the reload command and need
# this commented out.
reload signal USR1
# Upstart waits 5 seconds by default to kill the a process. Increase timeout to
# give sidekiq process enough time to exit.
kill timeout 15
#instance $index
script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<'EOT'
# Pick your poison :) Or none if you're using a system wide installed Ruby.
source /home/ubuntu/.bash_profile
source /home/ubuntu/.rvm/scripts/rvm
source /home/ubuntu/.bashrc
# Logs out to /var/log/upstart/sidekiq.log by default
cd /home/ubuntu/myapp/
exec bundle exec sidekiq -C config/sidekiq.yml -e production
EOT
end script
如何让它工作。我还安装了 gem yard
但仍然出现相同的错误。
您还没有在 Gemfile 中列出 yard
并完成了 bundle
。
我遇到了问题,$HOME
变量未被视为已在 upstart 作业中定义。因此 gem 的 yard.rb
文件中的 ~
登录没有扩展到实际路径。比我在 upstart 中明确定义变量并让它工作。
我正在使用 sidekiq upstart 作业,但是 运行 sudo service sidekiq restart
出现以下错误
There was an error while trying to load the gem 'yard'.
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/home/ubuntu/.rvm/gems/ruby-2.2.1@myapp/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/home/ubuntu/myapp/config/application.rb:8:in `<top (required)>'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:231:in `require'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:231:in `boot_system'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:49:in `run'
/home/ubuntu/.rvm/gems/ruby-2.2.1@global/gems/sidekiq-3.2.5/bin/sidekiq:8:in `<top (required)>'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/bin/sidekiq:23:in `load'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/bin/sidekiq:23:in `<main>'
以下是暴发户工作
/etc/init/sidekiq.conf
# /etc/init/sidekiq.conf - Sidekiq config
# This example config should work with Ubuntu 12.04+. It
# allows you to manage multiple Sidekiq instances with
# Upstart, Ubuntu's native service management tool.
#
# See workers.conf for how to manage all Sidekiq instances at once.
#
# Save this config as /etc/init/sidekiq.conf then manage sidekiq with:
# sudo start sidekiq index=0
# sudo stop sidekiq index=0
# sudo status sidekiq index=0
#
# Hack Upstart's reload command to 'quiet' Sidekiq:
#
# sudo reload sidekiq index=0
#
# or use the service command:
# sudo service sidekiq {start,stop,restart,status}
#
description "Sidekiq Background Worker"
# This script is not meant to start on bootup, workers.conf
# will start all sidekiq instances explicitly when it starts.
start on runlevel [2345]
stop on runlevel [06]
# change to match your deployment user
setuid ubuntu
setgid ubuntu
#respawn
#respawn limit 3 30
# TERM is sent by sidekiqctl when stopping sidekiq. Without declaring these as
# normal exit codes, it just respawns.
normal exit 0 TERM
# Older versions of Upstart might not support the reload command and need
# this commented out.
reload signal USR1
# Upstart waits 5 seconds by default to kill the a process. Increase timeout to
# give sidekiq process enough time to exit.
kill timeout 15
#instance $index
script
# this script runs in /bin/sh by default
# respawn as bash so we can source in rbenv
exec /bin/bash <<'EOT'
# Pick your poison :) Or none if you're using a system wide installed Ruby.
source /home/ubuntu/.bash_profile
source /home/ubuntu/.rvm/scripts/rvm
source /home/ubuntu/.bashrc
# Logs out to /var/log/upstart/sidekiq.log by default
cd /home/ubuntu/myapp/
exec bundle exec sidekiq -C config/sidekiq.yml -e production
EOT
end script
如何让它工作。我还安装了 gem yard
但仍然出现相同的错误。
您还没有在 Gemfile 中列出 yard
并完成了 bundle
。
我遇到了问题,$HOME
变量未被视为已在 upstart 作业中定义。因此 gem 的 yard.rb
文件中的 ~
登录没有扩展到实际路径。比我在 upstart 中明确定义变量并让它工作。