设为首页 收藏本站
查看: 575|回复: 0

[经验分享] 创建redis集群时出现no such fileto load -- rubygems问题的解决

[复制链接]

尚未签到

发表于 2018-11-7 08:12:09 | 显示全部楼层 |阅读模式
  在创建redis集群时出现下列错误
  [root@redis src]# ./redis-trib.rb create--replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003127.0.0.1:7004 127.0.0.1:7005
  ./redis-trib.rb:24:in `require': no such fileto load -- rubygems (LoadError)
  from./redis-trib.rb:24
  解决方法
  1.安装ruby软件包
  [root@redis ~]#yum -y install ruby
  2.安装rubygems软件包
  [root@redis~]#tar -zxvf rubygems-2.2.2.tar
  [root@redis ~]# cd rubygems-2.2.2
  [root@redis rubygems-2.2.2]# ls
  bin                  History.txt   MIT.txt      test
  CVE-2013-4287.txt    lib           Rakefile     UPGRADING.rdoc
  CVE-2013-4363.txt    LICENSE.txt   README.rdoc  util
  hide_lib_for_update  Manifest.txt  setup.rb
  [root@redis rubygems-2.2.2]# ruby setup.rb
  RubyGems 2.2.2 installed
  Installing ri documentation for rubygems-2.2.2
  /usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
  /usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
  === 2.2.1 / 2014-01-06
  Bug fixes:
  * Platforms in the Gemfile.lock GEM section are now handled correctly.  Bug
  #767 by Diego Viola.
  * RubyGems now displays which gem couldn't be uninstalled from the home
  directory.  Pull request #757 by Michal Papis.
  * Removed unused method Gem::Resolver#find_conflict_state.  Pull request #759
  by Smit Shah.
  * Fixed installing gems from local files without dependencies.  Issue #760 by
  Arash Mousavi, pull request #764 by Tim Moore.
  * Removed TODO about syntax that works in Ruby 1.8.7.  Pull request #765 by
  Benjamin Fleischer.
  * Switched Gem.ruby_api_version to use RbConfig::CONFIG['ruby_version'] which
  has the same value but is overridable by packagers through
  --with-ruby-version= when configuring ruby.  Bug #770 by Jeremy Evans.
  * RubyGems now prefers the bundler API for `gem install` to reduce HTTP
  requests.  (This change was intended for RubyGems 2.2.0 but was missed.)
  This should address bug #762 by Dan Peterson and bug #766 by mipearson.
  * Added Gem::BasicSpecification#source_paths so documentation or analysis
  tools can work properly as require_paths no longer returns extension source
  directories.  Bug #758 Vít Ondruch.
  * Gem.read_binary can read read-only files again.  This caused file://
  repositories to stop working.  Bug #761 by John Anderson.
  * Fixed specification file sorting for Ruby 1.8.7 compatibility.  Pull
  request #763 by James Mead
  === 2.2.0 / 2013-12-26
  Special thanks to Vít Ondruch and Michal Papis for testing and finding bugs in
  RubyGems as it was prepared for the 2.2.0 release.
  Major enhancements:
  * RubyGems can check for gem dependencies files (gem.deps.rb or Gemfile) when
  rubygems executables are started and uses the found dependencies.  This
  means `rake` will work similar to `bundle exec rake`.  To enable this set
  the `RUBYGEMS_GEMDEPS` environment variable to the location of your
  dependencies file.
  See Gem::use_gemdeps for further details.
  * A RubyGems directory may now be shared amongst multiple ruby versions.  Upon
  activation RubyGems will automatically compile missing extensions for the
  current platform when the built objects are missing.  Issue #596 by Michal
  Papis
  By default different platforms do not share gem install locations so this
  must be configured by setting GEM_HOME to a common directory.  Some gems use
  fixed paths for requiring extensions and are not compatible with sharing gem
  directories.
  The default sharing location may be configured by RubyGems packagers through
  Gem.default_ext_dir_for.  Pull Request #744 by Vít Ondruch.
  Minor enhancements:
  * RubyGems checks the 'allowed_push_host' metadata value when pushing a gem to
  prevent an accidental push to a public repository (such as rubygems.org).
  If you have private gems you should set this value in your gem specification
  metadata.  Pull request #603 by Seamus Abshere.
  * `gem list` now shows results for multiple arguments.  Pull request #604 by
  Zach Rabinovich.
  * `gem pristine --extensions` will restore only gems with extensions.  Issue
  #619 by Postmodern.
  * Gem::Specification#files is now sorted.  Pull request #612 by Justin George.
  * For `gem list` and friends, "LOCAL" and "REMOTE" headers are omitted if
  only local or remote gem information is requested with --quiet.  Pull
  request #615 by Michal Papis.
  * Added Gem::Specification#full_require_paths which is like require_paths, but
  returns a fully-qualified results.  Pull request #632 by Vít Ondruch.
  * RubyGems now looks for the https_proxy environment variable for https://
  sources.  RubyGems will fall back to http_proxy if there is no https_proxy.
  Issue #610 by mkristian.
  * RubyGems now creates directories in .gem files.  Issue #631 by marksolaris.
  * RubyGems raises an exception when a specification includes its gem.  Issue
  #623 by notEthan.
  * RubyGems now displays relevant release note information when updating
  RubyGems.  Issue #647 by Trevor Wennblom.
  * Deprecated Gem::Installer::ExtensionBuildError in favor of
  Gem::Ext::BuildError.  The old constant is an alias for the new constant.
  * When extensions are built the gem_make.out file is always written now, even
  on success.  This will help with debugging bad builds that report success.
  * If a specification fails to validate RubyGems shows a link to the
  specification reference guide.  Issue #656 by Markus Heiler.
  * When using `gem install -g`, RubyGems now detects the presence of an
  Isolate, Gemfile or gem.deps.rb file.
  * Added Gem::StubSpecification#stubbed? to help determine if a user should run
  `gem pristine` to speed up gem loading.  Pull request #694 and #701 by Jon
  Leighton.
  * RubyGems now warns when a gem has a pessimistic version dependency that may
  be too strict.
  * RubyGems now warns when a gem has an open-ended dependency.
  * RubyGems now raises an exception when a dependency for a gem is defined
  twice.
  * Marked the license specification attribute as recommended.  Pull request
  #713 by Benjamin Fleischer.
  * RubyGems uses io/console instead of `stty` when available.  Pull request
  #740 by Nobuyoshi Nakada
  * Relaxed Gem.ruby tests for platforms that override where ruby lives.  Pull
  Request #755 by strzibny.
  Bug fixes:
  * RubyGems now returns an error status when any file given to `gem which`
  cannot be found.  Ruby bug #9004 by Eugene Vilensky.
  * Fixed command escaping when building rake extensions.  Pull request #721 by
  Dmitry Ratnikov.
  * Fixed uninstallation of gems when GEM_HOME is a relative directory.  Issue
  #708 by Ryan Davis.
  * Default gems are now ignored by Gem::Validator#alien.  Issue #717 by David
  Bahar.
  * Fixed typos in RubyGems.  Pull requests #723, #725, #731 by Akira Matsuda,
  pull request #736 by Leo Gallucci, pull request #746 by DV Suresh.
  * RubyGems now holds exclusive locks on cached gem files to prevent incorrect
  updates.  Pull Request #737 by Smit Shah
  * Improved speed of `gem install --ignore-dependencies`.  Patch by Terence
  Lee.
  ------------------------------------------------------------------------------
  RubyGems installed the following executables:
  /usr/bin/gem
  Ruby Interactive (ri) documentation was installed. ri is kind of like man
  pages for ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
  If you do not wish to install this documentation in the future, use the
  --no-document flag, or set it as the default in your ~/.gemrc file. See
  'gem help env' for details.
  3.安装redis库
  [root@redis rubygems-2.2.2]# gem install redis
  Fetching: redis-3.0.7.gem (100%)
  Successfully installed redis-3.0.7
  Installing ri documentation for redis-3.0.7
  /usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
  /usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
  Done installing documentation for redis after 3 seconds
  1 gem installed
  4.再次执行创建集群命令
  [root@redis src]# ./redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
  >>> Creating cluster
  Connecting to node 127.0.0.1:7000: OK
  Connecting to node 127.0.0.1:7001: OK
  Connecting to node 127.0.0.1:7002: OK
  Connecting to node 127.0.0.1:7003: OK
  Connecting to node 127.0.0.1:7004: OK
  Connecting to node 127.0.0.1:7005: OK
  >>> Performing hash slots allocation on 6 nodes...
  Using 3 masters:
  127.0.0.1:7000
  127.0.0.1:7001
  127.0.0.1:7002
  Adding replica 127.0.0.1:7003 to 127.0.0.1:7000
  Adding replica 127.0.0.1:7004 to 127.0.0.1:7001
  Adding replica 127.0.0.1:7005 to 127.0.0.1:7002
  M: 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550 127.0.0.1:7000
  slots:0-5460 (5461 slots) master
  M: ea7f2a0322f4b5a378d83d78c9b622267cb4262f 127.0.0.1:7001
  slots:5461-10921 (5461 slots) master
  M: 3d91a7661476445fe03f8b1841f95e16c689f2b9 127.0.0.1:7002
  slots:10922-16383 (5462 slots) master
  S: 39576e3bcadaa3f6c5a6283f5745a206d258625c 127.0.0.1:7003
  replicates 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550
  S: 7061e2adcb9a2ae08133e3fcfc163e8e09faa5f7 127.0.0.1:7004
  replicates ea7f2a0322f4b5a378d83d78c9b622267cb4262f
  S: 717a262f5e52179983df520b3f43d9a31923c3be 127.0.0.1:7005
  replicates 3d91a7661476445fe03f8b1841f95e16c689f2b9
  Can I set the above configuration? (type 'yes' to accept): yes
  >>> Nodes configuration updated
  >>> Sending CLUSTER MEET messages to join the cluster
  Waiting for the cluster to join....
  >>> Performing Cluster Check (using node 127.0.0.1:7000)
  M: 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550 127.0.0.1:7000
  slots:0-5460 (5461 slots) master
  M: ea7f2a0322f4b5a378d83d78c9b622267cb4262f 127.0.0.1:7001
  slots:5461-10921 (5461 slots) master
  M: 3d91a7661476445fe03f8b1841f95e16c689f2b9 127.0.0.1:7002
  slots:10922-16383 (5462 slots) master
  M: 39576e3bcadaa3f6c5a6283f5745a206d258625c 127.0.0.1:7003
  slots: (0 slots) master
  replicates 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550
  M: 7061e2adcb9a2ae08133e3fcfc163e8e09faa5f7 127.0.0.1:7004
  slots: (0 slots) master
  replicates ea7f2a0322f4b5a378d83d78c9b622267cb4262f
  M: 717a262f5e52179983df520b3f43d9a31923c3be 127.0.0.1:7005
  slots: (0 slots) master
  replicates 3d91a7661476445fe03f8b1841f95e16c689f2b9
  [OK] All nodes agree about slots configuration.
  >>> Check for open slots...
  >>> Check slots coverage...
  [OK] All 16384 slots covered.
  问题解决


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-631718-1-1.html 上篇帖子: 安装redis时出现zmalloc.h:50:31: 错误的解决 下篇帖子: Linux redis的安装与配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表