新手问题 看不到 Ruby 版本 但是服务仍在正常运行

zhenbeiju · 2017年04月22日 · 最后由 zhenbeiju 回复于 2017年04月23日 · 2395 次阅读

大家好, 同事突然联系不到了,需要改个问题,之前的服务也在正常运行 但是我登录到服务器上,用 rvm list 看到的 ruby 版本列表是空的 rvm gemset list 也是空的 ,

deploy@Web01:/var/www/weather_station/current$ rvm list

rvm rubies


# No rvm rubies installed yet. Try 'rvm help install'.

但是我看 ~/.rvm/gems/ 目录下是有 gemset 的名称的

deploy@Web01:~/.rvm/gems$ ls
cache  ruby-2.3.0  ruby-2.3.0@global  ruby-2.3.0@weather_assistant

所以比较奇怪, 我按照这个指令执行也是不行的

deploy@Web01:/var/www/weather_station/current$ /home/deploy/.rvm/bin/rvm 2.3.0@weather_assistant do bundle exec rails c -e production
ruby-2.3.0 is not installed.
To install do: 'rvm install ruby-2.3.0'
Gemset 'weather_assistant' does not exist, 'rvm ruby-2.3.0 do rvm gemset create weather_assistant' first, or append '--create'.

目前可以猜测到使用了 nginx +unicorn
我现在修改了一点代码推送到服务器, 重启 niginx 看起来没有效果 ,但是又无法重启 unicorn ,也不敢重新安装 ruby2.3.0 怕影响线上的代码

目前问题比较紧急,谢谢各位大大了

$(which ruby) --version

ch3n 回复

输入 which ruby 没有信息

deploy@Web01:/var/www/weather_station/current$ which ruby
deploy@Web01:/var/www/weather_station/current$ ruby
The program 'ruby' can be found in the following packages:
 * ruby
 * ruby1.8
Ask your administrator to install one of them

nginx 信息

deploy@Web01:/var/www/weather_station/current$ ps aux |grep nginx
deploy    6261  0.0  0.0  10440  2012 pts/8    S+   16:01   0:00 grep --color=auto nginx
root     56812  0.0  0.0  77640  2944 ?        Ss   14:07   0:00 nginx: master process /usr/sbin/nginx
www-data 56813  0.0  0.0  78296  5644 ?        S    14:07   0:00 nginx: worker process
www-data 56815  0.0  0.0  78296  5644 ?        S    14:07   0:00 nginx: worker process
www-data 56816  0.0  0.0  77976  3644 ?        S    14:07   0:00 nginx: worker process
www-data 56817  0.0  0.0  77976  5708 ?        S    14:07   0:00 nginx: worker process

unicorn 信息

deploy@Web01:/var/www/weather_station/current$ ps aux |grep unicorn
deploy    6363  0.0  0.0  10440  1900 pts/8    S+   16:01   0:00 grep --color=auto unicorn
deploy   22217  0.0  2.3 377536 168968 ?       Sl   Apr18   0:11 unicorn master -c /var/www/weather_station/current/config/unicorn/production.rb -E production -D                                                                                                                                                
deploy   22223  0.0  2.4 452620 176500 ?       Sl   Apr18   0:15 unicorn worker[0] -c /var/www/weather_station/current/config/unicorn/production.rb -E production -D                                                                                                                                             
deploy   22228  0.0  2.4 385668 176024 ?       Sl   Apr18   0:14 unicorn worker[1] -c /var/www/weather_station/current/config/unicorn/production.rb -E production -D                                                                                                                                             
deploy   22233  0.0  2.4 385404 175732 ?       Sl   Apr18   0:15 unicorn worker[2] -c /var/www/weather_station/current/config/unicorn/production.rb -E production -D                                                                                                                                             
deploy   22238  0.0  2.4 384748 175280 ?       Sl   Apr18   0:15 unicorn worker[3] -c /var/www/weather_station/current/config/unicorn/production.rb -E production -D 
Rei [该话题已被删除] 提及了此话题。 04月23日 03:31

因为这个修改比较紧急,
目前需要解决的问题主要有两个,一个是部署新代码,一个是我运行在本地后样式丢失
所以我愿意支付 3000+ 来解决这个问题,今天有效,
谢谢!

6 楼 已删除

有没有可能在容器里面

docker ps 看看

在 ? 请打我电话 13127503557

lithium4010 回复

应该不在 因为可以直接看到 unicorn 的进程

zhenbeiju 回复

docker 的话外面可以看到进程的

lithium4010 回复

没有安装 docker

deploy@Web01:/home/azureuser$ docker ps
The program 'docker' is currently not installed. To run 'docker' please ask your administrator to install the package 'docker'

ps aux |grep ruby

zouyu 回复

谢谢!可以看到有一个 ruby 的进程

需要 登录 后方可回复, 如果你还没有账号请 注册新账号