1. 通过RVM(Ruby Version Manager)来安装配置Ruby On Rails
准备工作:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot
安装RVM:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
安装完成后会提示:
andy@ubuntu:~$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Downloading RVM from wayneeseguin branch stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 919k 100 919k 0 0 91469 0 0:00:10 0:00:10 --:--:-- 192k
Installing RVM to /home/andy/.rvm/
Adding rvm PATH line to /home/andy/.bashrc /home/andy/.zshrc.
Adding rvm loading line to /home/andy/.bash_login /home/andy/.zlogin.
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.beginrescueend.com/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'
Installation of RVM in /home/andy/.rvm/ is almost complete:
* To start using RVM you need to run `source /home/andy/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
* Optionally you can run `rvm tools rvm-env ruby bash` which will generate
shebang wrappers for easier selecting ruby in scripts.
# andy,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne
andy@ubuntu:~$ source /home/andy/.rvm/scripts/rvm
andy@ubuntu:~$ rvm tools rvm-env ruby bash
# use shebang: #!/usr/bin/ruby-rvm-env 1.9.3
There is no command/script 'ruby' in system.
Created link '/usr/bin/bash-rvm-env'.
通过下面的命令可以查看RVM是否正常工作:
andy@ubuntu:~$ source .bashrc
andy@ubuntu:~$ type rvm | head -1
rvm is a function
如果正常的话可以看到类似“rvm是函数”这样的内容,下面我们安装ruby以及rail
andy@ubuntu:~/baidu/lxb/apps/redmon$ bundle install
ERROR: Gem bundler is not installed, run `gem install bundler` first.
andy@ubuntu:~/baidu/lxb/apps/redmon$ gem install bundler
The program 'gem' can be found in the following packages:
* rubygems1.8
* rubygems1.9.1
Try: sudo apt-get install <selected package>
andy@ubuntu:~/baidu/lxb/apps/redmon$ sudo apt-get install rubygems1.9.1
[sudo] password for andy:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'ruby1.9.1' instead of 'rubygems1.9.1'
The following packages were automatically installed and are no longer required:
linux-headers-2.6.35-22-generic linux-headers-2.6.35-22
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libreadline5 libruby1.9.1 libyaml-0-2 ruby1.9.1
Suggested packages:
ruby1.9.1-examples ri1.9.1 graphviz
The following NEW packages will be installed:
libreadline5 libruby1.9.1 libyaml-0-2 ruby1.9.1
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,046kB of archives.
After this operation, 13.9MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.ubuntu.com/ubuntu/ maverick/main libreadline5 amd64 5.2-7build1 [147kB]
Get:2 http://archive.ubuntu.com/ubuntu/ maverick/main libyaml-0-2 amd64 0.1.3-1 [55.0kB]
Get:3 http://archive.ubuntu.com/ubuntu/ maverick/universe libruby1.9.1 amd64 1.9.2.0-1 [3,808kB]
Get:4 http://archive.ubuntu.com/ubuntu/ maverick/universe ruby1.9.1 amd64 1.9.2.0-1 [36.5kB]
Fetched 4,046kB in 37s (107kB/s)
Selecting previously deselected package libreadline5.
(Reading database ... 160453 files and directories currently installed.)
Unpacking libreadline5 (from .../libreadline5_5.2-7build1_amd64.deb) ...
Selecting previously deselected package libyaml-0-2.
Unpacking libyaml-0-2 (from .../libyaml-0-2_0.1.3-1_amd64.deb) ...
Selecting previously deselected package libruby1.9.1.
Unpacking libruby1.9.1 (from .../libruby1.9.1_1.9.2.0-1_amd64.deb) ...
Selecting previously deselected package ruby1.9.1.
Unpacking ruby1.9.1 (from .../ruby1.9.1_1.9.2.0-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up libreadline5 (5.2-7build1) ...
Setting up libyaml-0-2 (0.1.3-1) ...
Setting up libruby1.9.1 (1.9.2.0-1) ...
Setting up ruby1.9.1 (1.9.2.0-1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
; 查看安装建议
rvm notes
; 安装一些必要的软件包
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
; 列出可以安装的ruby版本
rvm list known
; 安装ruby,我选择的是版本1.9.3-p0
rvm install 1.9.3-p0
; 设定默认使用的ruby版本
rvm --default use 1.9.3-p0
; 查看版本看是否正确安装
ruby -v
gem -v
; 有必要可以手动更新一下
gem update --system
gem update
; 安装rails
gem install rails
; 查看版本看是否正确安装
rails -v
这样环境就安装好了,下面提一下安装过程中可能遇到的错误信息:
在安装ruby的时候会安装yaml,可能会在make的时候出现如下的错误信息:
Compiling yaml in /home/debugcool/.rvm/src/yaml-0.1.4.
ERROR: Error running 'make ', please read /home/debugcool/.rvm/log/ruby-1.9.3-p0/yaml/make.log
这是应为缺少yaml库的缘故,可以通过:
sudo apt-get install libyaml-0-2 libyaml-dev
执行这个命令来安装yaml库解决这个问题,如果还是报错,请看b错误信息
查看 /home/debugcool/.rvm/log/ruby-1.9.3-p0/yaml/make.log 日志信息:
src/Makefile.am:2: Libtool library used but `LIBTOOL' is undefined
src/Makefile.am:2: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
缺少libtool库,可以通过:
sudo apt-get install libtool
执行这个命令来安装libtool库解决这个问题
2. 安装redmon监控redis
下载redmon源码:
git clone https://github.com/steelThread/redmon.git
安装运行:
bundle install
ruby sample/app.rb
注:如果前面不是通过RVM进行ruby、rails安装配置,而是通过源码编译、apt-get等方式安装,可能会遇到各种找不到相关gem等诡异的错误,我也是在各种百度、google无果之后才通过RVM来安装的。
运行之后可以打开在浏览器中打开http://localhost:4567来查看redis web监控页面。
redmon默认是监控本机的6379端口的redis服务器,这个是可以修改的,在redmon目录的lib目录下,可以查看redmon.rb的源码:
module Redmon
extend self
attr_reader :opts
@opts = {
:redis_url => 'redis://127.0.0.1:6379',
:namespace => 'redmon',
:web_interface => ['0.0.0.0', 4567],
:worker => true,
:poll_interval => 10
}
修改上面代码中redis_url内容即可监控自己执行的redis服务器。
分享到:
相关推荐
观看您的Redis服务器实时运行(具有可配置的池秒)。 使用熟悉的cli界面与redis进行交互。 动态更新您的服务器配置。 安装 Redmon可作为RubyGem获得: gem install redmon 用法 $ redmon -h Usage: bin/redmon ...
创建cachecloud项目用户:因为cachecloud项目的部分功能(redis启动、服务器监控)是通过ssh完成的,所以这里的用户和密码要和项目中的相对应,具体详见第三节。(b). 创建cachecloud项目的工作目录、数据目录、配置...
开源项目-SkyRocknRoll-redmon.zip,Redis url for http endpoint monitoring tool. Supports sentinel (HA) also.
微小的node.js模块,用于使用Redis缓存对象。 安装 $ npm install redmon-cache ##目的是创建redmon-cache以便在分布式环境(例如微服务应用程序)中轻松地缓存对象。 我主要用它来缓存从MongoDB检索的文档,这些...
四篇论文 :yolov3 、Redmon_You_Only_Look_CVPR_2016_paper、alexnet,Levi_Age_and_Gender_2015_CVPR_paper
redmon端口监视器1.7,一个特殊的打印机端口重定向 程序。
Redmon J , Divvala S , Girshick R , et al. You Only Look Once: Unified, Real Time Object Detection[C].The IEEE Conference on Computer Vision and Pattern Recognition (CVPR).2016 ,01.
在深度学习和计算机视觉领域,YOLO(You Only Look Once)模型的出现标志着实时对象检测技术的一大进步。YOLO的论文及其中文翻译版本为研究者和开发者提供了深入了解其独特架构和实现原理的机会。...
此仓库包含用于通过C的套接字API接收图像,在OpenCV DNN中对YOLOv3进行推理以及在Web服务器中打印推理结果的代码。 该代码可在Linux上运行。 默认情况下,对COCO数据集进行训练。 感谢YOLO的Joseph Redmon : 。 您...
获取大部分系统中环境变量,包括管理员、当前用户名、系统路径、操作系统参数、处理器参数等
YOLOV3论文高清, YOLO目标识别领域最具潜力的深度学习算法
YOLO_quantize是专为嵌入式设备设计的,可以平稳地运行YOLOv1(由YOLO的父亲Joseph Redmon)。 目前,已在ZCU102 SoC器件上进行了验证。 该回购协议仍在开发中。 这是开发功能: 支持x86和ARM设备的构建选项,例如...
1、添加端口:打开刚安装完的PS打印机(Generic PostScript Printer)的属性窗口,在“端口”标签下添加端口,选择中间的重定向端口(Redirected Port),点击"新端口"后输入端口的名字,比如"RedPort"。 2、配置端口:...
YOLOv8是YOLO(You Only Look Once)系列目标检测算法的最新版本,由Joseph Redmon和Ali Farhadi于2016年首次提出。YOLO是一种实时目标检测算法,其核心思想是将目标检测任务转化为一个回归问题,并通过一个单一的...
YOLO之父Joseph Redmon在今年年初宣布退出计算机视觉的研究的时候,很多人都以为目标检测神器YOLO系列就此终结。 然而在4月23日,继任者YOLO V4却悄无声息地来了。Alexey Bochkovskiy发表了一篇名为YOLOV4: Optimal...
这是CVPR会议2016有关图像分割、物体检测的论文,后续还会更新别的领域。
YOLO(You Only Look Once)是一种基于深度学习的物体检测算法,由Joseph Redmon等人于2015年提出。相比于传统的物体检测算法,YOLO具有更快的速度和更高的准确率,被广泛应用于计算机视觉领域。 YOLO的核心思想是...
该算法最早由Joseph Redmon于2016年提出,其设计理念是通过单个神经网络模型同时进行目标检测和分类,相对于传统目标检测方法,YOLO具有更高的实时性和准确性。 主要特点: 实时性: YOLO的设计目标之一是实时目标...
一个开源的虚拟打印机基于redmon等成熟库
YOLO(You Only Look Once)系列算法是一系列流行的目标检测算法,由Joseph Redmon等人于2015年首次提出。YOLO算法的核心思想是将目标检测任务转化为一个单一的回归问题,通过单次前向传递网络即可同时预测图像中多...