rubygems

How to install Nokogiri on Ruby 2.7.0

て烟熏妆下的殇ゞ 提交于 2020-05-29 06:53:42
问题 I recently upgraded to Ruby v2.7.0. When I tried to install Nokogiri I got the following error: ERROR: Error installing nokogiri: The last version of nokogiri (>= 0) to support your Ruby & RubyGems was 1.10.9. Try installing it with `gem install nokogiri -v 1.10.9` nokogiri requires Ruby version >= 2.3, < 2.7.dev. The current ruby versi on is 2.7.0.0. I tried to install this gem with gem install nokogiri -v 1.10.9 but I got the same error. How can I install Nokogiri now that I am using Ruby

How to require file from `gem` which are not under `lib` directory?

﹥>﹥吖頭↗ 提交于 2020-05-28 20:05:21
问题 I want to write spec for my rubocop custom cop. This gem has handy helpers defined here. I want to require it. How to achieve what? I've tried to use Gem.find_files , and this gives me ability to require any file in that gem, but only under lib directory. For example: # this requires ...gems/rubocop-0.29.1/lib/rubocop/formatter/formatter_set.rb require Gem.find_files('rubocop/formatter/formatter_set.rb').first # but I need ...gems/rubocop-0.29.1/spec/support/cop_helper.rb The following

Ruby newbie: undefined method `with_indifferent_access'

夙愿已清 提交于 2020-05-25 17:07:51
问题 I am a new Ruby programmer, and a co-worker of mine to help me get started wrote the following code which ran fine in his environment. However, when I try to run it in my own environment, I ge the follow error: undefined method 'with_indifferent_access' for #<Hash:0x1012392c0> (NoMethodError) The method in question appears twice in the code: require 'rubygems' gem 'activerecord' gem 'activesupport' gem 'sailthru-client' require 'active_support' require 'active_record' require 'sailthru' #

Installing pg 1.1.3 with native extensions fails

梦想与她 提交于 2020-05-16 05:08:40
问题 I am trying to run a bundle install on a rails app. The installation fails on the step: Installing pg 1.1.3 with native extensions Here is the complete error log: current directory: /Users/velinapetrova/.rvm/gems/ruby-2.5.1/gems/pg-1.1.3/ext /Users/velinapetrova/.rvm/rubies/ruby-2.5.1/bin/ruby -r ./siteconf20181118-57661-1vdieox.rb extconf.rb ——with-pg-config=/usr/local/Cellar/postgresql/10.5/bin/pg_config checking for pg_config... yes Using config values from /usr/local/bin/pg_config

When/why to use --env-shebang with ruby gems?

别等时光非礼了梦想. 提交于 2020-05-15 04:08:46
问题 Ikenna Okpala recommended this .gemrc (I modified it slightly): --- :verbose: true :bulk_threshold: 1000 install: --no-ri --no-rdoc --env-shebang :sources: - http://gems.rubyforge.org/ :benchmark: false :backtrace: false update: --no-ri --no-rdoc --env-shebang :update_sources: true I had not noticed the --env-shebang before. I looked up the documentation for --env-shebang at http://guides.rubygems.org/command-reference/: Install/Update Options: ... -E, -​-[no-]env-shebang - Rewrite the

When/why to use --env-shebang with ruby gems?

旧街凉风 提交于 2020-05-15 04:07:33
问题 Ikenna Okpala recommended this .gemrc (I modified it slightly): --- :verbose: true :bulk_threshold: 1000 install: --no-ri --no-rdoc --env-shebang :sources: - http://gems.rubyforge.org/ :benchmark: false :backtrace: false update: --no-ri --no-rdoc --env-shebang :update_sources: true I had not noticed the --env-shebang before. I looked up the documentation for --env-shebang at http://guides.rubygems.org/command-reference/: Install/Update Options: ... -E, -​-[no-]env-shebang - Rewrite the

Broken ruby on Mac when dealing with cocoapods

别来无恙 提交于 2020-05-14 01:59:29
问题 I'm trying to install a Cocoapods plugin and my Mac's gem and Ruby seem completely broken. Here's my output for 'pod install': [project] pod install master ✗ ✭ NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/fuzzy_match-2.0.4.gemspec:17. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be

Broken ruby on Mac when dealing with cocoapods

吃可爱长大的小学妹 提交于 2020-05-14 01:59:11
问题 I'm trying to install a Cocoapods plugin and my Mac's gem and Ruby seem completely broken. Here's my output for 'pod install': [project] pod install master ✗ ✭ NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Library/Ruby/Gems/2.3.0/specifications/fuzzy_match-2.0.4.gemspec:17. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be

Redis笔记 -- 在 Centos7.4单机中部署Redis集群(二)

有些话、适合烂在心里 提交于 2020-05-07 18:52:13
0x00--背景和目的 在单台PC服务器上部署Redis集群,通过不同的TCP端口启动多实例,模拟多台独立PC组成集群。 0x01--环境描述: 1 Centos版本 :CentOS Linux release 7.4 . 1708 (Core) 2 Redis版本 :Redis 4.0 . 10 ( 00000000 / 0 ) 64 bit 3 安装方式 :源码安装 0x02--编辑Redis实例配置文件 在根目录下新建/redis_cluster目录,用于存放多实例配置文件,这里使用6个TCP端口,编写6029--6034共计6个配置文件,使用折6个配置文件启动实例,并搭建Redis集群。 1 port 6029 ##端口号,用于模拟不同主机不同实例,6029,6030,6031,6032,6033,6034 2 bind 10.118 . 128.223 ##实例IP地址,默认为127.0.0.1,根据实际情况修改,集群节点间需要保证IP地址能相互通讯,网络层面需要放开相应端口的访问权限 3 daemonize yes ##允许Redis后台运行 4 pidfile /redis_cluster/ redis_6029.pid ##pidfile 文件,每个实例一个,分别对应6029.6030.6031,6032,6033,6034 5 cluster- enabled

Redis-3.2.0集群配置(redis cluster)

守給你的承諾、 提交于 2020-05-03 21:09:52
目录 目录 1 1. 前言 2 2. 部署计划 2 3. 目录结构 2 4. 编译安装 3 5. 修改系统参数 3 5.1. 修改最大可打开文件数 3 5.2. TCP监听队列大小 4 5.3. OOM相关:vm.overcommit_memory 4 5.4. /sys/kernel/mm/transparent_hugepage/enabled 4 6. 配置redis 4 7. 启动redis实例 6 8. 创建和启动redis cluster前的准备工作 6 8.1. 安装ruby 7 8.2. 安装rubygems 7 8.3. 安装redis-3.0.0.gem 7 9. redis-trib.rb 7 10. 创建和启动redis集群 8 10.1. 复制redis-trib.rb 8 10.2. 创建redis cluster 9 10.3. ps aux|grep redis 10 11. redis cluster client 11 11.1. 命令行工具redis-cli 11 11.2. 从slaves读数据 11 11.3. jedis(java cluster client) 11 11.4. r3c(C++ cluster client) 12 12. 新增节点 12 12.1. 添加一个新主(master)节点 12 12.2. 添加一个新从