草庐IT

ruby - 为什么 bundler 使用多个 gem 位置?

这发生在Puppet'sbundle。Gemfilespecifiesgem"puppet",:path=>File.dirname(__FILE__),:require=>false但是我安装在$GEM_HOME中的一个gem最终出现在$:中。$bundleexecruby-e'puts$:'.../home/puppy/puppet-git-clone/lib.../usr/lib/ruby/vendor_ruby.../home/puppy/gems/gems/puppet-3.7.5/lib...这本身并不是问题,但显然Ruby将加载Puppet3.7.5而不是我从git存储库

ruby - Ruby 中的 "Gemfile"在哪里?

我经常在互联网上的文档中看到,“把它放在Gemfile中”。我不知道这个“Gemfile”在哪里和什么。如果我安装了gem,那么我已经安装了它。谁需要一个“Gemfile”?Gemfile在哪里或什么,为什么使用它? 最佳答案 Gemfile位于您想要的任何位置-通常位于项目的主目录中,文件名为Gemfile。拥有一个很方便,因为它允许您使用Bundler来管理每个项目需要运行哪些gem和哪些版本。如果您没有使用Bundler(您应该使用它!),那么您可以只安装使用geminstallX遇到的任何gem,并忽略有关向Gemfile添

ruby - 当我的 .gemspec 中包含所有 gem 时,如何避免打包程序警告多个来源?

在我自己的gem中,我有一个基本如下所示的Gemfile:source'https://my.gemserver.com'source'https://rubygems.org'gemspec我的.gemspec将所有依赖项列为add_dependency和add_development_dependency。从Bundler1.8开始,我收到警告:Warning:thisGemfilecontainsmultipleprimarysources.Using`source`morethanoncewithoutablockisasecurityrisk,andmayresultinin

ruby - Errno::EACCES:通过 gitlab 安装 gems 时权限被拒绝

我正在尝试设置gitlab并因此使用sudo从另一个用户帐户安装一些gem,但我经常收到Permissiondenied错误。sudo-ugitlab-Hbundleinstall--deployment--withoutdevelopmenttestpostgres>Using...(alotofsuccessfulgemsthere)>Usingpygments.rb(0.3.2)fromhttps://github.com/gitlabhq/pygments.rb.git(atmaster)>Errno::EACCES:Permissiondenied-pygments.rb-0

ruby - 无法安装 JSON gem

我需要安装json,因为我收到此错误:无法在任何来源中找到json-1.4.6我运行了geminstalljson和bundleinstall但我只能在需要json-1.4.6时安装json-1.5.1我的gemfile中有gem'json','1.4.6',所以我不确定发生了什么...更新我收到这个错误:正在安装json(1.4.6)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1216:in`chmod':不允许操作-/Library/Ruby/Gems/1.

ruby - Gemfile 中可以有多个版本的 gem 吗?

我想要的是这样的:gem'rack','1.3.3','1.2.4'这样当gems需要不同版本的rack时,都被安抚了。这可能吗? 最佳答案 您可以设置允许的gem间隔gem'rack','1.2.4'它将加载所选间隔内最实际的一个。但我认为您不能要求不同的gem版本。如果一个gem将以不同的版本加载,每个类和模块都必须拥有自己的命名空间,以避免覆盖gem的方法。 关于ruby-Gemfile中可以有多个版本的gem吗?,我们在StackOverflow上找到一个类似的问题:

ruby - 我如何在 Heroku 上使用 rdiscount?

我正在尝试将一个小型测试应用程序推送到Heroku。这是应用程序和Gem文件:应用:require'sinatra'require'haml'require'rdiscount'set:markdown,:layout_engine=>:haml,:layout=>:layoutget'/'dohaml:indexendget'/blog'domarkdown:testendgem文件:source:rubygemsgem'sinatra'gem'thin'gem'haml'gem'rdiscount'在推送到Heroku之前,我运行了bundleinstall。但是在尝试安装rdis

ruby - Rvm:无法卸载 bundle 程序 1.1.0

我有一个rails3.0.2项目我想安装,尽管我的大多数新项目都是3.2+我去运行bundleinstall并收到以下消息:Bundlercouldnotfindcompatibleversionsforgem"bundler":InGemfile:rails(=3.0.2)rubydependsonbundler(~>1.0.0)rubyCurrentBundlerversion:bundler(1.1.0)ThisGemfilerequiresadifferentversionofBundler.PerhapsyouneedtoupdateBundlerbyrunning`gemi

ruby-on-rails - nokogiri - 错误 : Failed to build gem native extension

我更新到Lion的开发人员版本,发现我无法再启动Rails应用程序。每当我尝试sudobundleinstall时,我都会收到以下错误:Installingnokogiri(1.4.4)withnativeextensions/Library/Ruby/Site/1.8/rubygems/installer.rb:551:in`build_extensions':ERROR:Failedtobuildgemnativeextension.(Gem::Installer::ExtensionBuildError)/System/Library/Frameworks/Ruby.framew

ruby - Bundle 安装在 ruby​​ 2.0 升级时损坏

刚刚升级到ruby​​2.0/rails4.0并尝试在新的rails项目上运行bundleinstall。每当它遇到尚未安装的东西时,它就会吐出:Installingcoffee-rails(4.0.0.beta1)Errno::ENOENT:Nosuchfileordirectory-/usr/lib/ruby/gems/2.0.0/build_info/coffee-rails-4.0.0.beta1.infoAnerroroccurredwhileinstallingcoffee-rails(4.0.0.beta1),andBundlercannotcontinue.Makesu