无法通过远程计算机重新启动精简 [英] Cannot restart thin via remote machine
问题描述
我使用Thin来服务位于测试机器上的导轨应用程序。我希望能够停止/从我的本地机器开始瘦,但以下不起作用:
ssh luc @ test_machine'/home/luc/.rvm/gems/ruby-1.9.3-p125/bin/thin -v'
我收到以下错误消息:
/home/luc/.rvm/rubies/ruby-1.9。 3-p125 / lib / ruby / site_ruby / 1.9.1 / rubygems / dependency.rb:247:in`to_specs':在[bigdecimal-1.1.0,io-console-0.3]之间无法找到稀疏(> = 0) ,json-1.5.4,minitest-2.5.1,rake-0.9.2.2,rdoc-3.9.4](Gem :: LoadError)
from /home/luc/.rvm/rubies/ruby-1.9。 3-p125 / lib / ruby / site_ruby / 1.9.1 / rubygems / dependency.rb:256:来自/home/luc/.rvm/rubies/ruby-1.9.3-p125/lib的`to_spec'
/ruby/site_ruby/1.9.1/rubygems.rb:1230:in`gem'
from /home/luc/.rvm/gems/ruby-1.9.3-p125/bin/thin:18:in` < main>'
当我有分数时,为什么只列出6个宝石?
当我在ssh连接到测试服务器时:
哪个瘦
给了我正确的路径:
/home/luc/.rvm/gems/ruby-1.9.3-p125/bin/thin(问题用正确路径更新)
更新
我创建了一个基本的test.sh脚本在服务器上:
#!/ bin / bash
#使用ruby / gem更新路径
export PATH = $ PATH:/home/luc/.rvm/rubies/ruby-1.9.3-p125/bin:/home/luc/.rvm/gems/ruby-1.9.3-p125/bin/
thin -v
exit 0
我从本地机器调用它
ssh luc @ test_machine'/home/luc/test.sh'
但仍然是找不到细错误。
UPDATE 2
这可能与使用的rubies / gemset该脚本通过ssh运行。我已添加
rvm list
rvm gemset list
在test.sh文件中,输出结果是:
rvm rubies
* ruby-1.9.3-p125 [x86_64]
#=> - 当前
#= * - 当前&&默认
#* - 默认
系统的gemsets(位于/home/luc/.rvm/gems/system)
*
似乎我安装的宝石不存在......不知道要通过ssh调用来说明使用的rubies / gemset版本尽管如此。
我用另一种方式管理这个。我没有试图从远程计算机重新启动服务器,而是安装了gemrerun(https://github.com/alexch/rerun),以便在更改某些代码时自动完成瘦服务器的重新启动。
重新运行 - 瘦开始
真的很好
I use Thin to serve the rails application located on a test machine. I'd like to be able to stop/start thin from my local machine but the following does not work:
ssh luc@test_machine '/home/luc/.rvm/gems/ruby-1.9.3-p125/bin/thin -v'
I got the following error message:
/home/luc/.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/luc/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /home/luc/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems.rb:1230:in `gem'
from /home/luc/.rvm/gems/ruby-1.9.3-p125/bin/thin:18:in `<main>'
Why does it list only 6 gems when I have scores ?
When I'm connected in ssh onto the test server:
which thin
gives me the right path:
/home/luc/.rvm/gems/ruby-1.9.3-p125/bin/thin (question updated with correct path)
UPDATE
I have created a basic test.sh script on the server:
#!/bin/bash
# Update path with ruby / gem
export PATH=$PATH:/home/luc/.rvm/rubies/ruby-1.9.3-p125/bin:/home/luc/.rvm/gems/ruby-1.9.3-p125/bin/
thin -v
exit 0
I call it from my local machine
ssh luc@test_machine '/home/luc/test.sh'
But still the same "could not find thin" error.
UPDATE 2
This might be linked to the rubies / gemset used when the script is run through ssh. I have added
rvm list
rvm gemset list
in the test.sh file and the output I have is:
rvm rubies
* ruby-1.9.3-p125 [ x86_64 ]
# => - current
# =* - current && default
# * - default
gemsets for system (found in /home/luc/.rvm/gems/system)
*
It seems that the gems I have installed are not there... Don't know to spefify the rubies/gemset version to use through a ssh call though.
I managed this using another way. Instead of trying to restart the server from a remote machine, I installed the gem "rerun" (https://github.com/alexch/rerun) so the restart of the thin server is done automatically when some code is changed.
rerun -- thin start
does the trick really well
这篇关于无法通过远程计算机重新启动精简的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!