Tag: bundler

错误:“致命:我在使用bundle install时不处理协议“git`

我的GemFile中有以下行: gem ‘rails’, :git => ‘git://github.com/rails/rails.git’ 我收到以下错误: Fetching git://github.com/rails/rails.git fatal: I don’t handle protocol ”git’ Git error: command `git clone ‘git://github.com/rails/rails.git’… 但是当我运行gem install ‘rails’它运行正常。 基本上在运行clone命令时,bundler会在git://地址周围添加单引号,从而引发错误。 我在Windows上工作。 任何想法为什么我收到此错误? 干杯

如何在Rails 5.0.0上修复bundle install“nio4r error”

确切的错误是: An error occurred while installing nio4r (1.2.1), and bundler cannot continue. Make sure that ‘gem install nio4r -v ‘1.2.1” succeeds before bundling. 这是一个痕迹: Fetching gem metadata from https://rubygems.org/ Fetching version metadata from https://rubygems.org/ Fetching dependency metadata from https://rubygems.org/ Using rake 12.0.0 Using concurrent-ruby 1.0.5 Using i18n 0.8.1 Using minitest 5.10.1 Using thread_safe 0.3.6 Using […]

如何跟踪和检查捆绑的Ruby gem中的依赖项

Bundler将自动为指定的gem安装任何依赖项,但是它不会输出哪些依赖项映射到标准输出中的哪些gem。 当其中一个依赖项未能通过安装时,该信息很有用。 有没有办法将Bundler设置得更详细,并在安装时通知有关依赖项? 我使用的是Bundler 1.0.2

告诉Bundler从特定gem的安装中排除某些gem

在gemfile中,有什么方法可以告诉Bundler: gem ‘twitter-bootstrap-rails’, :exclude therubyracer 我需要安装twitter-bootstrap-rails但是它会自动拉therubyracer ,因此bundle install失败并且bootstrap不包含在项目中,因为这是一台Windows机器。 我安装了execjs无济于事。 我试图在生产中列出therubyracer ,并bundle install –without production – 没有bundle install –without production ,也无济于事。 “ windows上的therubyracer gem ”也是这个问题,但没有任何建议改变了我得到的错误。 我的旧线程是“ 当我做”捆绑更新“时,我从gem中得到一个错误而不是我的gemfile。如何忽略这种依赖? ”。

我可以在gemfile中强制gem的依赖吗?

如果有两个gem, A和B A1.0.0取决于B1.0.0 。 在我的Gemfile中: gem ‘A’, ‘~> 1.0.0’ 然后运行bundle 。 它将生成一个Gemfile.lock,如: A (1.0.0) B (1.0.0) 但如果我想强制A使用B1.0.1 ,那么最佳做法是什么? 此外,如果B1.0.1不是发布而是github标签?

安装“nio4r”时使用rails 5.0.0:无法构建gem原生扩展

这是日志: http : //pastebin.com/CAgur9xd Installing nio4r 1.2.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. C:/RailsInstaller/Ruby2.2.0/bin/ruby.exe -r ./siteconf20160720-8272-c88sgk.rb extconf.rb –with-cflags=-std=c99 checking for unistd.h… *** 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 […]

尝试在Heroku上部署应用程序时出现错误“未定义方法”load_defaults“”

我是ruby和rails编程的新手,所以我一直在关注railstutorial.org在线书籍,并遇到了一个我几个小时都无法解决的障碍: 在Bash中运行“git push heroku master”后,我得到以下内容: Counting objects: 90, done. Delta compression using up to 4 threads. Compressing objects: 100% (76/76), done. Writing objects: 100% (90/90), 21.30 KiB | 0 bytes/s, done. Total 90 (delta 5), reused 0 (delta 0) remote: Compressing source files… done. remote: Building source: remote: remote: ! Warning: Multiple default buildpacks reported […]

使用Bundler从Github安装gem

我正在尝试使用这里的说明来安装带有bundler的预发布版本的gem。 “bundle install”输出将gem列为已安装,但“gem list”无法找到它。 我的Gemfile: source :gemcutter gem ‘sinatra’, ‘1.1.0’, :git => ‘http://github.com/sinatra/sinatra.git’ gem ‘RedCloth’, ‘4.2.3’ 这是我的其余示例代码的要点 。 有没有人让这个场景奏效? 注意:我也在使用RVM(在OS X上)。 bundle show会将gem(和依赖项)列为现有的,但我无法正确解析它们。 谢谢。

使用bundler时,如何在Gemfile中使用gem?

当一般使用带有项目的bundle和Rails时,你只能访问Gemfile中定义的gem。 虽然这是有道理的,但它可能是有限的。 当我想使用团队的其他成员不使用的某个RSpec格式化程序时,我发现它主要限制了它。 除非它在Gemfile中,否则无法访问。 任何方式或我必须将其添加到Gemfile? 更新:我的问题不是Bundler而是Spork。 在没有Spork的情况下运行RSpec时,我没有使用任何格式化程序的问题。 更新#2:看起来使用Bundler仍然是导致问题的原因。 使用Spork和不使用Spork之间的区别在于,在没有Spork的情况下运行RSpec时,它会在加载项目并进入Bundler“sandbox”之前加载格式化程序。 使用Bundler: $ bundle exec irb >> require ‘fivemat’ LoadError: cannot load such file — fivemat from (irb):1:in `require’ from (irb):1 from /Users/arikfr/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `’ 没有Bundler: $ irb >> require ‘fivemat’ => true

Bundler / Gemfile如何配置为在开发期间使用不同的gem源?

我有一个Sinatra应用程序需要另一个我在本地开发的gem。 我在配置Bundler以在开发过程中使用我的本地gem代码时遇到了麻烦,但我在生产中使用了我的gem代码。 理想情况下我可以这样做,但Bundler不允许你指定两次相同的gem: # Doesn’t work: group :development do gem ‘awesome’, :path => “~/code/awesome” end group :production do gem ‘awesome’, :path => “vendor/gems/awesome-0.0.1” end 与此同时,我每次部署时都会手动出售gem并更新Gemfile中的gem源,这非常麻烦。 我的工作流程如下: 在开发过程中指向我的本地gem( gem ‘awesome’, :path => “~/code/awesome” ) 准备好部署时,将gem解压缩到vendor/gems 更新Gemfile以指向vendored gem(gem’awesome gem ‘awesome’, :path => “vendor/gems/awesome-0.0.1” ) 运行bundle install (更新Gemfile.lock) 部署代码 返回第1步。 太麻烦了! 我想做一些更简洁的事情,而不仅仅是编写Rake任务来自动化我当前的设置。 这种情况的最佳工作流程是什么?