Ruby + Passenger 5 分钟 入门
本文的目的是尽可能浅显的介绍Ruby + Passenger的使用。如果想深入了解Passenger,可参考后续相关章节。
本人通过有无Passenger启动Rubyf服务来入门Passenger
Ruby + Passenger 实验
无Passenger启动服务
准备Ruby程序
# 此项目是本人在github上提交的Ruby demo程序 git clone https://github.com/testcara/ROR_Blog.git
安装Gem包
# check the Gemfile and install the Gems # enter the dir cd ROR_Blog # confirm whether it is has the 'passenger' cat Gemfile | grep -r -i 'passenger' # install packages without production mode bundle install --without production
直接启动服务
# start the service rails s # then open the http://localhost:3000 to check the main page of the application
验证进程
# check the ruby related process ps aux | grep ruby # we will see there is only one ruby process ‘rails’
确认log
# check the log files under the 'log' dir ll log # then we can see there is no passenger*.log
Passenger启动服务
- 编辑Gemfile添加Passenger
# add passenger to Gemfile echo 'gem "passenger", require: "phusion_passenger/rack_handler"' >> Gemfile
- 安装Gems, 包含Passenger
# confirm the passenger existing in the 'passenger' cat Gemfile | grep 'passenger' # install Gemfiles including the 'passenger' bundle install --without production
- 启动passenger
# kill the 'rails s' to free the 3000 port # start passenger service passenger start
- 验证进程
# check the ruby related process ps aux | grep ruby # then we would see one ruby process 'passenger'
- 确认log
# check the log files under the 'log' dir ll log # then we can see there is one passenger*.log
以上可见,
通过Passenger启动Ruby程序是非常简单的。Ruby on Rails框架提供了内嵌的服务器工具。这些服务器工具可以和rails server命令进行交互。rails server不是一个应用服务器, 仅仅是启动应用和应用服务器的wrapper。如果Gemfile中指定了Passenger,则rails server会启动Passenger而不是默认服务器,如果没有Passenger,则会启动默认应用服务区。
通常在生产环境中,我们不会直接使用rails s起启动服务,而使用Passenger等应用服务器的原因。
Ruby + Passenger 5 分钟 入门相关推荐
- python 三分钟入门_Cython 三分钟入门教程
作者:perrygeo 译者:赖勇浩(http://laiyonghao.com) 原文:http://www.perrygeo.net/wordpress/?p=116 我最喜欢的是Python,它 ...
- 技术19期:1分钟入门数据治理!必看!【技术篇】
1分钟入门数据治理!必看![技术篇] 前言: 在进行大数据开发过程中,数据调研和开发规范都是必不可少的.数据调研便于理清数据源之间的关系,梳理出哪些数据是符合当下的业务场景以及确定所要用到的加工口径等 ...
- 可下载:60分钟入门PyTorch(中文翻译全集)
来源:机器学习初学者本文约9500字,建议阅读20分钟官网教程翻译:60分钟入门PyTorch(全集) 前言 原文翻译自:Deep Learning with PyTorch: A 60 Minute ...
- 30分钟入门Java8之默认方法和静态接口方法
2019独角兽企业重金招聘Python工程师标准>>> 30分钟入门Java8之默认方法和静态接口方法 作者:@JohnTsai 本文为作者原创,转载请注明出处:http://www ...
- 高级篇:独立开发者 5 分钟入门 ASO
这是接上一篇初级篇:独立开发者 5 分钟入门 App 营销的后续,如果有没看上一篇文章的,建议先看上一篇,再回来继续看. "营销" 这个概念自始至终会贯穿我们的专栏,以后会展开说其 ...
- 转载:正则表达式30分钟入门教程
正则表达式30分钟入门教程 版本:v2.21 (2007-8-3) 作者:deerchao 来源:unibetter大学生社区 转载请注明来源 目录 本文目标 如何使用本教程 正则表达式到底是什么? ...
- hive hql文档_30分钟入门 Hive SQL(HQL 入门篇)
Hive SQL 几乎是每一位互联网分析师的必备技能,相信每一位面试过大厂的童鞋都有被面试官问到 Hive 优化问题的经历.所以掌握扎实的 HQL 基础尤为重要,既能帮分析师在日常工作中"如 ...
- 【深度学习】翻译:60分钟入门PyTorch(四)——训练一个分类器
前言 原文翻译自:Deep Learning with PyTorch: A 60 Minute Blitz 翻译:林不清(https://www.zhihu.com/people/lu-guo-92 ...
- 【深度学习】翻译:60分钟入门PyTorch(三)——神经网络
前言 原文翻译自:Deep Learning with PyTorch: A 60 Minute Blitz 翻译:林不清(https://www.zhihu.com/people/lu-guo-92 ...
- (翻译)60分钟入门深度学习工具-PyTorch
60分钟入门深度学习工具-PyTorch 作者:Soumith Chintala 原文翻译自: https://pytorch.org/tutorials/beginner/deep_learning ...
最新文章
- Chrome 浏览器跨域和安全访问问题 使用 chrome的命令行标记:disable-web-security 参数联调线上数据...
- STL常用的拷贝和替换算法
- ajax绑定事件页面重复提交,Ajax局部更新导致JS事件重复触发问题的解决方法
- 2017.3.13 木棍分割 思考记录
- Hibernate常见错误
- scp实现mac与linux服务器之间文件传输
- PowerDesigner一些小技巧
- 因特尔显卡自定义分辨率_为什么从最新的英特尔显卡控制面板中移除了自定义分辨率?...
- 问卷星中问卷设计的一些设置----笔记
- @NotNull 和 @NotEmpty 和@NotBlank 区别
- 机器人系统仿真(七)——xacro语法详解
- Win11未识别的网络无internet怎么办?
- [BZOJ4199][NOI2015]品酒大会-后缀数组
- 【解决方案】连锁店巡店难?开发成本高?TSINGSEE青犀视频打造一站式连锁店视频上云/安防监控/AI智能分析解决方案
- 基于时域表示的序列数据分类方法(一)——基于距离度量的序列数据分类方法
- 安得广厦千万间,大赚天下寒士俱欢颜
- 【转载】Android 面试总结
- 随手记-记录一些技术点
- vivo S12 Pro评测:一首在冷暖交融之间流转的华丽舞曲
- 微信小程序在 wxml 文件中使用 Array.includes 方法