How to install a specific version of a ruby gem?

使用命令行gem工具,如何安装特定版本的gem? 使用-v标志: $ gem install fog -v 1.8 Use the --version parameter (shortcut -v ): $ gem install rails -v 0.14.1 You can also use version comparators like >= or ~> $ gem install rails -v '~> 0.14.0' Or with newer versions of gem even: $ gem install rails:0.14.4 rubyzip:'< 1' … Successfully installed rails-0.14.4 Successfully installed rub

如何安装特定版本的红宝石?

使用命令行gem工具,如何安装特定版本的gem? 使用-v标志: $ gem install fog -v 1.8 使用--version参数(快捷键-v ): $ gem install rails -v 0.14.1 您也可以使用版本比较器,如>=或~> $ gem install rails -v '~> 0.14.0' 或者更新版本的gem甚至: $ gem install rails:0.14.4 rubyzip:'< 1' … Successfully installed rails-0.14.4 Successfully installed rubyzip-0.9.9 对于Ruby 1.9+使用冒号.. gem in

Installing gem or updating RubyGems fails with permissions error

Trying to install a gem ( gem install mygem ) or update RubyGems ( gem update --system ) fails with this error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. Anyone having idea how to solve this? You don't have write permissions into the /Library/Ruby/Gems/1.8 directory. means exactly that, you do

安装gem或更新RubyGems失败并出现权限错误

尝试安装gem( gem install mygem )或更新RubyGems( gem update --system )失败并出现此错误: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. 任何人有想法如何解决这个问题? 您没有写入/Library/Ruby/Gems/1.8目录的权限。 这意味着,你没有写入权限。 这是Apple安装的Ruby版本,供他们自己使用。 虽然如果你知道

Can Bundler be configured to install gems rdoc?

I use bdoc (with hanna for formatting) as a quick way of looking at the rdoc documentation for the gems installed on my system. However, because bundler does not install rdoc when installing gems, I'm constantly having to generate them manually whenever I start using a new gem, or update an existing one. Does anyone know if there's a way of configuring bundler to get it to install rdoc

Bundler可以配置为安装gems rdoc吗?

我使用bdoc(使用hanna进行格式化),作为查看我的系统上安装的gem的rdoc文档的快速方法。 但是,由于bundler在安装gem时不会安装rdoc,因此每当我开始使用新的gem或更新现有的gem时,我都不得不手动生成它们。 有谁知道是否有一种方法来配置捆绑软件,让它在安装gem时安装rdoc以避免我必须手动执行它? 我在bundler源代码中看不到任何提及,也没有在配置手册中提到。 如果您使用rvm,请尝试“rvm rdocs generate ...” 我的

Am I missing something by not installing ri and rdoc for gems?

I've never seen the point of installing the ri and rdoc for gems and my .gemrc file has --no-ri and --no-rdoc set. Since every gem includes ri and rdoc info, I just wondered if I'm missing something? Is there any advantage to installing the ri and rdoc for a gem? Thanks Chris Summary If you don't install the ri and rdoc, you don't lose anything of great value. I thought

我是否因为没有安装ri和rdoc而错过了宝石?

我从来没有见过安装ri和rdoc的宝石,我的.gemrc文件有--no-ri和--no-rdoc设置。 由于每一个宝石都包含ri和rdoc信息,我只是想知道我是否错过了一些东西? 安装ri和rdoc是否有优势? 谢谢 克里斯 概要 如果你不安装ri和rdoc,你不会失去任何有价值的东西。 我想也许它已经在一些IDE中使用过了(我是Emacs用户),但似乎并非如此。 安装ri文档的重点在于,您可以使用“ri”命令来访问逐个方法的文档。 例如,请尝试:“

How can I install a local gem?

如果我将.gem文件下载到我的计算机中的文件夹中,以后可以使用gem install来安装它吗? Yup, when you do gem install , it will search the current directory first, so if your .gem file is there, it will pick it up. I found it on the gem reference, which you may find handy as well: gem install will install the named gem. It will attempt a local installation (ie a .gem file in the current directory),

我如何安装本地宝石?

如果我将.gem文件下载到我的计算机中的文件夹中,以后可以使用gem install来安装它吗? 是的,当你做gem install ,它会首先搜索当前目录,所以如果你的.gem文件在那里,它会选择它。 我在宝石参考中找到了它,您可能也会发现它很方便: gem install会安装命名的gem。 它会尝试本地安装(即当前目录中的.gem文件),如果失败,它将尝试下载并安装所需的最新版本的gem。 另外,您可以使用gem install --local path_to_gem/f

Disable rdoc and ri generation by default for rubygems 1.8.x

There are a lot of answers for this question that work under older versions of rubygems, but what is the recommended procedure for Rubygems 1.8.x? I have an /etc/gemrc file that looks like this: gem: --no-rdoc --no-ri These options seem to be ignored during any gem install . Update: After doing some more digging, it seems the problem is related to rvm which partitions not just the various

默认情况下,为rubygems 1.8.x禁用rdoc和ri生成

这个问题有很多答案可以在老版本的rubygems下工作,但Rubygems 1.8.x推荐的过程是什么? 我有一个如下所示的/etc/gemrc文件: gem: --no-rdoc --no-ri 在任何gem install过程中,这些选项似乎都被忽略。 更新: 在做了更多的挖掘之后,似乎问题与rvm相关, rvm不仅对各种版本的ruby进行分区,还对其相关的配置文件进行分区。 要检查配置文件的位置,请使用irb : require 'rubygems' Gem::ConfigFile::SYSTEM_WIDE_CONFI

Trying to understand the Ruby .chr and .ord methods

I've been working with the Ruby chr and ord methods recently and there are a few things I don't understand. My current project involves converting individual characters to and from ordinal values. As I understand it, if I have a string with an individual character like "A" and I call ord on it I get its position on the ASCII table which is 65. Calling the inverse, 65.chr give

试图了解Ruby .chr和.ord方法

最近我一直在使用Ruby chr和ord方法,并且有一些我不明白的东西。 我目前的项目涉及将单个字符转换为序数值。 据我了解,如果我有像“A”的个性字符串,我称之为ord就可以了,我得到的ASCII表,该表65.调用倒数的位置, 65.chr给我的字符值“A “,所以这告诉我Ruby有一个集合在有序字符值的地方,它可以使用这个集合给我一个特定字符的位置,或者一个特定位置的字符。 我可能是错的,请纠正我,如果我。 现在我也明白Ruby的默

Can't install eventmachine on mac osx snow leopard

I've searched for this issue and kept finding resources related to PC. Every time I try to install the eventmachine gem I get this error: Building native extensions. This could take a while... ERROR: Error installing eventmachine: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb checking for rb_trap_immediate in ruby.h,rubysig.h... * extconf.rb failed * Could

无法在mac osx snow leopard上安装eventmachine

我已经搜索这个问题,并不断寻找与PC相关的资源。 每次我尝试安装eventmachine gem时,都会收到此错误消息: 构建原生扩展。 这可能需要一段时间...错误:安装eventmachine时出错:错误:无法构建gem本机扩展。 / usr / local / bin / ruby​​ extconf.rb检查ruby.h中的rb_trap_immediate,rubysig.h ... * extconf.rb失败*由于某种原因无法创建Makefile,可能缺少必要的库和/或头文件。 检查mkmf.log文件以获取更多详细信

ruby install error on Ubuntu

I have the following error during sqlite3-ruby install: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel' *** extconf.rb failed *** Could not create Makef

ruby在Ubuntu上安装错误

在sqlite3-ruby安装过程中出现以下错误: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel' *** extconf.rb failed *** Could not create Makefile due to some r

Failing to install activerecord

I am trying to follow the basic "Create a blog in 20 minutes" Rails screencast but have hit a stumbling block already. When I try to rake db:migrate I get errors about the gem activerecord-jdbcmysql-adapter not being installed. When I try to install it, I am told it doesn't exist. If I try to simply gem install mysql I get all sorts of madness appearing. I am running this on

未能安装activerecord

我试图遵循基本的“在20分钟内创建一个博客”Rails screencast,但已经遇到了绊脚石。 当我尝试耙db:migrate时,我得到关于未安装gem activerecord-jdbcmysql-adapter的错误。 当我尝试安装它时,我被告知它不存在。 如果我试图简单地安装MySQL,我会得到各种各样的疯狂。 我在Mac OS X 10.6.2上运行它,并且我的安装都是通过gem完成的。 我的基本设置工作(Hello world!)。 这里是错误日志: $ rake db:migrate(