你如何在没有 ruby​​gems 的情况下启动 ruby​​ 1.9 [英] how do you start ruby 1.9 without rubygems

查看:48
本文介绍了你如何在没有 ruby​​gems 的情况下启动 ruby​​ 1.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的应用能够使用任何已安装的 gem.是否有 ruby​​ 1.9 启动参数或以编程方式执行此操作的方法?

I want my app to not be able to use any installed gems. Is there a ruby 1.9 startup parameter or way of doing this programmatically?

推荐答案

ruby --disable-gems

是 MRI (1.9) 命令行参数.它可以防止将 gem 安装目录添加到默认加载路径".(Ruby 编程语言,第 391 页)

is the MRI (1.9) commandline parameter. "It prevents the addition of gem installation directories to the default load path". (The Ruby Programming Language, p. 391)

编辑 25-10-2012:Ruby 核心在评论中与 @rogerdpack 具有相同的想法,并添加了更详细的 ruby --help 参数.Ruby 修订版!

Edit 25-10-2012: Ruby core had the same idea as @rogerdpack in the comments and added the more verbose ruby --help parameter. Ruby revision!

这篇关于你如何在没有 ruby​​gems 的情况下启动 ruby​​ 1.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆