Articles of gem

在本地文件夹中安装gem

我在我使用的共享机器上拥有有限的权限,所以我不能像以前那样安装gem。 例如: $ gem install request-log-analyzer ERROR: While executing gem … (Gem::FilePermissionError) You don't have write permissions into the /usr/lib/ruby/gems/1.8 directory. 是否可以在本地安装gem? (如果重要的话,我试图安装这个gem 。) 我在Stack Overflow上看到很多关于使用Bundler或者gemfiles的文章,但是我没有为Ruby on Rails项目安装这个gem – 我只是想单独使用它。 我正在运行Linux,不知道哪个味道。

错误sudo:gem:command not found

我试图在CentOS上安装rubyrep,并执行sudo gem install rubyrep ,出现错误sudo: gem: command not found 。 Sudo和Gem都是安装和运行的,只是没有组合起来。 我的设置: [rubyrep]# which sudo /usr/bin/sudo [rubyrep]# which gem /usr/local/rvm/rubies/ruby-2.1.2/bin/gem [rubyrep]# which ruby /usr/local/rvm/rubies/ruby-2.1.2/bin/ruby [rubyrep]# $PATH -bash: /usr/local/rvm/gems/ruby-2.1.2/bin:/usr/local/rvm/gems/ruby-2.1.2@global/bin:/usr/local/rvm/rubies/ruby-2.1.2/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: No such file or directory

如何卸载在Windows上的所有ruby?

如何卸载Windows上的所有ruby? 单命令可以吗?

在Windows 7上打开Ruby的SSL错误

我在Windows 7正常操作系统上运行。 Ruby,SSL和Windows不喜欢彼此,所以像这些简单的命令不适合我,这给我一个真正的头痛。 我尝试过获得RVM,更新我的环境variables,几乎所有的东西。 我不知道解决scheme是什么。 有没有解决scheme来安装Ruby 1.9.3的OpenSSL gem? require 'mechanize' agent = Mechanize.new page = agent.get('https://any-ssl-site-here.com') puts page

JSON Gem不会安装(Windows)

每当我尝试更新或安装JSONgem,我得到一个构build错误。 这些是输出文件中的结果: c:/Ruby193/bin/ruby.exe extconf.rb creating Makefile make generating parser-i386-mingw32.def compiling parser.c In file included from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1360, from c:/Ruby193/include/ruby-1.9.1/ruby.h:32, from ../fbuffer/fbuffer.h:6, from parser.rl:1: c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:41: error: redefinition of 'struct timespec' c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:48: error: redefinition of 'struct timezone' make: *** [parser.o] Error 1 我开始学习Rails,在继续之前我想弄明白这一点。 这是生成的默认Gemfile: source 'http://rubygems.org' gem 'rails', '3.1.3' # Bundle edge Rails instead: # gem 'rails', :git […]

安装json gem时出错:“json”原生gem需要安装构build工具

当我试图安装这个gem声称,我需要有一个开发板安装,虽然我相信我确实有它。 这也表明,我需要更新我的系统variables,我已经直接链接到ruby的devkit文件。 我已经看到堆栈溢出的其他问题,他们没有解决我的问题。 这里是完整的错误信息: C:\Users\Mahamoud>gem install json ERROR: Error installing json: The 'json' native gem requires installed build tools. Please update your PATH to include build tools or download the DevKit from 'http://rubyinstaller.org/downloads' and follow the instructions at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit' 我试着卸载并重新安装ruby,仍然没有结果。 我有我的开发工具包位于C:\ Ruby193 \斌

Bundler:安装特定的.gem文件

有没有办法告诉Bundler安装一个特定的.gem文件,我躺在附近? 我有一个ParseTree的编译版本,我必须使用(该死的你,Windows!),但不想扩展gem文件,以便为“gem”要求添加:path =>'…'属性。

无法在Windows上安装pg gem

我有2个Ruby版本:1.8.7和1.9.2和PostgreSQL 8.3。 我不能在任何安装PGgem。 得到这个错误: C:/Development/Ruby187/bin/ruby.exe extconf.rb checking for pg_config… yes not recorded checking for libpq-fe.h… no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: […]

如何在安装gem时包含x86-mingw32二进制文件

在Windows 7上,使用ruby 2.1.6:我尝试安装gtk3:gem install gtk3 C:\>gem install gtk3 Fetching: pkg-config-1.1.6.gem (100%) Successfully installed pkg-config-1.1.6 Fetching: cairo-1.14.1-x86-mingw32.gem (100%) Successfully installed cairo-1.14.1-x86-mingw32 Fetching: glib2-2.2.5-x86-mingw32.gem (100%) Successfully installed glib2-2.2.5-x86-mingw32 Fetching: gobject-introspection-2.2.5-x86-mingw32.gem (100%) Successfully installed gobject-introspection-2.2.5-x86-mingw32 Fetching: gio2-2.2.5-x86-mingw32.gem (100%) Successfully installed gio2-2.2.5-x86-mingw32 Fetching: atk-2.2.5-x86-mingw32.gem (100%) Successfully installed atk-2.2.5-x86-mingw32 Fetching: pango-2.2.5-x86-mingw32.gem (100%) Successfully installed pango-2.2.5-x86-mingw32 Fetching: gdk_pixbuf2-2.2.5-x86-mingw32.gem (100%) Successfully installed […]

sqlite3-ruby gem:无法构buildgem原生扩展

更新:看看这个后续问题: 在Windows上的gem更新 – 是否坏了? 在Windows上,当我这样做: gem install sqlite3-ruby 我得到以下错误: Building native extensions. This could take a while… ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. c:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby –platform Win32 checking for fdatasync() in rt.lib… no checking for sqlite3.h… no nmake 'nmake' is not recognized as an internal or external command, […]