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

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, […]

在PATH模式040777中获取警告“不安全的世界可写dir / home / chance”,用于rails和gem

我试过这个,但它没有工作,似乎是为OSX。 我有一个新的Ubuntu 10.10与rvm,rails 3和ruby1.9.2安装。 我有一个新的导轨应用程序,但使用gem或导轨导致以下警告(滞后)。 $ rails -v /home/chance/.rvm/gems/ruby-1.9.2-p180@global/gems/railties-3.0.5/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /home/chance in PATH, mode 040777 /home/chance/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.0.10/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /home/chance in PATH, mode 040777 Rails 3.0.5 $ gem -v /home/chance/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4: warning: Insecure world writable dir /home/chance in PATH, mode 040777 1.6.2 只要事情重要,这里是我的Gemfile: source 'http://rubygems.org' gem 'rails' # Bundle edge […]

在Windows上安装bcrypt-ruby gem

我正试图在Windows Vista上安装bcrypt-ruby 。 到目前为止,我已经能够从安装Visual Studio 2008 Express的MS知识库文章和cl.exe安装nmake.exe。 但是,我现在遇到这个错误: cl -nologo -Wall -I. -IC:/InstantRails/ruby/lib/ruby/1.8/i386-mswin32 -I C:/InstantRails/ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -c -Tcb crypt.c cl : Command line warning D9035 : option 'Og-' has been deprecated and will be removed in a future release cl : Command line warning D9002 : ignoring unknown option '-G6' bcrypt.c […]