Tag: gemfile

由于“mysql2”gem,我无法运行“bundle update”

我在Gemfile中有这个: gem ‘mysql2’ 但是当我运行bundle update时 ,我收到以下错误消息: An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue. Make sure that `gem install mysql2 -v ‘0.3.16’` succeeds before bundling. 我试着把它移到生产部分,像这样: group :production do gem ‘mysql2’ end 但是在运行bundle更新后 ,结果是一样的。 此部分仅在生产模式下处理,还是不处理? 如何摆脱localhost上的此错误消息? 编辑:整个错误消息: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/radek/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb checking for ruby/thread.h… *** extconf.rb […]

在Gemfile中设置ruby版本

我可以在Gemfile设置ruby版本,如下所示: ruby ‘2.0.0’ 但是,如果我想要一个特定的版本为2.0.0-p353怎么2.0.0-p353 ? 当我将它添加到Gemfile ,我得到: Your Ruby version is 2.0.0, but your `Gemfile` specified 2.0.0-p353 是否可以设置特定版本?

安装debugger-linecache(1.1.1)时发生错误,Bundler无法继续

知道如何解决这个问题吗? Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/durrantm/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for vm_core.h… no checking for vm_core.h… no Makefile creation failed ************************************************************************** No source for ruby-1.9.3-p194 provided with debugger-ruby_core_source gem. **************************************************************************

什么时候需要在rails Gemfile中使用require?

在我的gemfile中,我有类似的东西: gem ‘net-sftp’, ‘2.1.1’, :require => ‘net/sftp’ gem ‘backup’, ‘3.0.27’ gem ‘watu_table_builder’, :require => ‘table_builder’ gem ‘browser’, ‘0.1.6’ 在Gemfile中你需要一个需求吗? 我还发现了类似:require => false 。 救命?

是否可以覆盖gemfile进行本地开发?

我们的git存储库中当前有一个Gemfile 。 但是,我在我的环境中只使用本地的gem(我的团队不使用它)。 为了使用它,我必须将它添加到我们的Gemfile ,但每次我检查我们的master / dev主分支时,我必须删除它,因为与跟踪的gemfile冲突。 我想要的是像Gemfile.local这样的东西,它将inheritance从Gemfile导入的gem,但也允许在那里导入新gem以仅在我的机器上使用。 在.gitignore中将忽略此文件。 这有可能吗?

为什么Gemfile语义版本控制运算符(〜>)会产生一个数字不一致的结果?

gemspec语义版本操作符〜(又名twiddle-wakka ,又名悲观操作符)允许对gem版本进行约束,但允许进行一些升级。 我经常看到它可以被解读为: “~> 3.1” => “Any version 3.x, but at least 3.1” “~> 3.1.1” => “Any version 3.1.x, but at least 3.1.1” 但是有一个数字,这条规则就会破裂: “~> 3” => “Any version x, but at least 3” *NOT TRUE!* “~> 3” => “Any version 3.x” *True. But why?* 如果我想要“任何版本3.x”,我可以使用“〜> 3.0”,这是一致的。 就目前而言,一个数字的这种操作变化是不一致的,没有记录。 此外,如果我想说“任何高于或等于3的版本”(所以3.x,4.x等……)我很想使用“> =”运算符,我们被告知这是邪恶的 。 这种行为有原因吗? 编辑: 我将这个给大卫找到rubygems中的罪魁祸首文件。 有一个“function”无声地将“3”扩展为“3.0”( […]

Gemfile中gem的顺序是否有所不同?

您列出gem的顺序是否重要? 这两个块是等价的吗? gem ‘carrierwave’ gem ‘rmagick’ 和 gem ‘rmagick’ gem ‘carrierwave’

您的软件包已锁定到rake(12.0.0),但在Gemfile中列出的任何源中都找不到该版本。

启动rails服务器时收到以下错误消息: 您的软件包已锁定到rake(12.0.0),但在Gemfile中列出的任何源中都找不到该版本。 如果您没有更改源,则表示rake(12.0.0)的作者已将其删除。 您需要将捆绑包更新为尚未删除的不同版本的rake(12.0.0)才能安装。 我在gemfile中指定了gem’rake gem ‘rake’, ‘12.0.0’ .0.0 gem ‘rake’, ‘12.0.0’但是没有修复它。 我尝试了bundle update rake ,删除了Gemfile.lock并使用bundle exec bundle install生成它。 我还在我的命令中添加了`bundle exec1,它什么也没做。 我的Gemfile.lock已经指定了rake版本12.0.0,并且没有安装其他版本。 请参阅我的gemfile: http ://pastebin.com/L4tVFWz9 和rakefile: http ://pastebin.com/K7p2ajsE 我尝试了已经激活的rake版本中建议的解决方案,而不是Gemfile要求的防止rake命令

我可以在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 […]