Tag: rubygems

是否可以直接从git存储库安装gem?

使用bundler,您可以在Gemfile中执行Gemfile : gem ‘my_gem’, :git => ‘git@github:me/my_gem.git’ 这将在该repo中构建gem并安装它。 效果很好。 是否可以使用命令行gem工具做类似的事情? 像这样的东西? gem install my_gem –git=”git@github:me/my_gem.git” 显然这个命令不起作用,但它有类似的东西吗? 我知道我可以克隆repo,运行gem build my_gem.gemspec ,然后运行gem install my_gem-1.2.3.gem 。 但我想知道是否有一个直接的单行,隐藏在幕后的这些中间步骤。

您没有写入/var/lib/gems/1.9.1目录的权限

对于我尝试安装的所有gem,我收到此错误: 错误:执行gem时…(Gem :: FilePermissionError)您没有对/var/lib/gems/1.9.1目录的写权限。 OBS。 我在Ubuntu 14上运行。

Rails没有找到rake-10.5.0

我正在尝试在rails 4.2中安装rake gem。 Th gem似乎安装得很好,但是Rails在尝试运行时失败,说它看不到rake-10.5.0 。 我在Rubymine开发,我得到的错误在下面,我的Gemfile也是如此。 我尝试删除其他post建议的Gemfile.lock ,但无济于事。 安慰: ~/Development/RubymineProjects/Revenant.tech  ls Gemfile Rakefile config lib test Gemfile.lock app config.ru log tmp README.rdoc bin db public vendor ~/Development/RubymineProjects/Revenant.tech  gem install rack Successfully installed rack-1.6.4 Parsing documentation for rack-1.6.4 Done installing documentation for rack after 2 seconds 1 gem installed ~/Development/RubymineProjects/Revenant.tech  bundle update […]

警告:找不到RubyGems 1.2+索引:RubyGems将恢复为降低性能的旧索引

警告:找不到RubyGems 1.2+索引: RubyGems将恢复到降低性能的旧索引。 如果有人能指导我解决这个问题,我会给他们50美元 我已经筋疲力尽谷歌,重新安装了一切。 我想要的只是 gem安装…… 而已

来自Bundler的新鲜Ruby gem – 无法加载我的version.rb文件?

我想制作一个新的Ruby应用程序,所以我决定使用bundle gem foo来做它。 这给了我整体: lib/ foo/ version.rb foo.rb Gemfile Rakefile foo.gemspec README.md 结构体。 现在当我运行ruby foo.rb ,我得到: `require’: cannot load such file — foo/version (LoadError) foo.rb只是默认值: require ‘foo/version’ module Foo end gem可以不靠自己跑吗? 我希望我不必将我的gem包含在一个示例应用程序中,只是为了测试它?

gem和/或Ruby on Rails突然爆发,有谁知道发生了什么?

我有一个曾经工作的Ruby on Rails应用程序。 我在一个月左右没用过它,但是今天尝试使用rails s启动它并得到以下错误 – 事实上,当我尝试rails -h或rails -v甚至gem -h时我收到此错误或sudo gem update –system或任何与gem事情。 NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01. Gem::Specification#default_executable= called from /Library/Ruby/Gems/1.8/specifications/rubygems-update-1.8.2.gemspec:11. Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: “2011-08-25 00:00:00.000000000Z” NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on […]

Gem-idea:当HTTP方法发布,放置或删除时,在before_filter中使用validation码自动保护垃圾邮件

我正在考虑为rails编写一个自动垃圾邮件保护系统(也许我会写一个公共gem)。 我的概念是在application_controller中包含一个辅助方法: class ApplicationController 30.seconds :limit => 50) … end 然后我想在每个控制器中自动包含一个before_filter,如果当前请求是通过post,put或delete-method检查的话。 如果用户的上次发布请求小于:min_time,则应将请求重定向到captcha-input-page(发布的用户数据驻留在隐藏的html字段中)。 # before_filter :check_spam def check_spam if !request.get? && session[:last_manipulation_at] && session[:last_manipulation_at] >= DateTime.now – 30.seconds redirect_to captcha_path # (doesn’t know yet how to handle the post data to # display in hidden fields in the spam-captcha-form) end end 在captcha.haml中 =form_tag -request.params.each do |key, […]

Rails Gemfile默认为’https’ – ‘bundle install’失败

我注意到在生成新的rails项目时,Gemfile现在默认为: source ‘https://rubygems.org’ 代替 source ‘http://rubygems.org’ 现在bundle install失败了。 当它试图运行时,我得到: /Users//.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault 如果我手动将Gemfile更改为http ,那么bundle install可以了。 我的设置是否有错误(我在两个不同的盒子上复制了这个),还是有其他问题我不知道?

无法在Windows 7上安装Rmagick和Imagemagick

当我从gem install rmagick-2.13.1.gem的目录运行gem install rmagick-2.13.1.gem ,我得到一个错误,说它无法构建gem native扩展,在它之下 c:/Ruby192/bin/ruby.exe extconf.rb checking for Ruby version >= 1.8.5 … yes Unable to get Imagemagick version ***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. 据我所知,在http://rmagick.rubyforge.org/install-faq.html#os上阅读常见问题解答的答案时,rmagick应该与ImageMagick Windows Installer捆绑在一起。 答案还提到了rmagick-win32.gem。 我没见过任何地方。 这就是为什么我会假设rmagick-2.13.1.gem是我需要的,因为它是唯一可用的,考虑到常见问题解答引用旧版本的rmagick。 所以,我真的很困惑这该死的问题是什么。 我还看了一下mkmf.log文件,我发现的唯一的东西就是 checking […]

rails安装期间出错

Saads-Mac-Pro:~ SMD$ gem install rails Building native extensions. This could take a while… /Users/SMD/.rvm/rubies/ruby-2.0.0- p247/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:54: warning: Insecure world writable dir /usr in PATH, mode 040777 ERROR: Error installing rails: ERROR: Failed to build gem native extension. /Users/SMD/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries […]