在创建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]# lsbin History.txt MIT.txt testCVE-2013-4287.txt lib Rakefile UPGRADING.rdocCVE-2013-4363.txt LICENSE.txt README.rdoc utilhide_lib_for_update Manifest.txt setup.rb[root@redis rubygems-2.2.2]# ruby setup.rbRubyGems 2.2.2 installedInstalling 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 PapisBy 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/gemRuby 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_methodIf 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.7Installing 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 blockDone installing documentation for redis after 3 seconds1 gem installed4.再次执行创建集群命令
[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 clusterConnecting to node 127.0.0.1:7000: OKConnecting to node 127.0.0.1:7001: OKConnecting to node 127.0.0.1:7002: OKConnecting to node 127.0.0.1:7003: OKConnecting to node 127.0.0.1:7004: OKConnecting to node 127.0.0.1:7005: OK>>> Performing hash slots allocation on 6 nodes...Using 3 masters:127.0.0.1:7000127.0.0.1:7001127.0.0.1:7002Adding replica 127.0.0.1:7003 to 127.0.0.1:7000Adding replica 127.0.0.1:7004 to 127.0.0.1:7001Adding replica 127.0.0.1:7005 to 127.0.0.1:7002M: 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550 127.0.0.1:7000 slots:0-5460 (5461 slots) masterM: ea7f2a0322f4b5a378d83d78c9b622267cb4262f 127.0.0.1:7001 slots:5461-10921 (5461 slots) masterM: 3d91a7661476445fe03f8b1841f95e16c689f2b9 127.0.0.1:7002 slots:10922-16383 (5462 slots) masterS: 39576e3bcadaa3f6c5a6283f5745a206d258625c 127.0.0.1:7003 replicates 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550S: 7061e2adcb9a2ae08133e3fcfc163e8e09faa5f7 127.0.0.1:7004 replicates ea7f2a0322f4b5a378d83d78c9b622267cb4262fS: 717a262f5e52179983df520b3f43d9a31923c3be 127.0.0.1:7005 replicates 3d91a7661476445fe03f8b1841f95e16c689f2b9Can I set the above configuration? (type 'yes' to accept): yes>>> Nodes configuration updated>>> Sending CLUSTER MEET messages to join the clusterWaiting 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) masterM: ea7f2a0322f4b5a378d83d78c9b622267cb4262f 127.0.0.1:7001 slots:5461-10921 (5461 slots) masterM: 3d91a7661476445fe03f8b1841f95e16c689f2b9 127.0.0.1:7002 slots:10922-16383 (5462 slots) masterM: 39576e3bcadaa3f6c5a6283f5745a206d258625c 127.0.0.1:7003 slots: (0 slots) master replicates 91dfd20bbb4060b81e1d6694bdf8f87ad45d3550M: 7061e2adcb9a2ae08133e3fcfc163e8e09faa5f7 127.0.0.1:7004 slots: (0 slots) master replicates ea7f2a0322f4b5a378d83d78c9b622267cb4262fM: 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.问题解决