开始红宝石Peter Cooper 1.9第7章要求加载错误

当我需要另一个文件时,我收到以下错误 . 我正在运行ruby ver . 2.0.0,虽然本书使用1.9 . 我想知道这是版本兼容的问题,还是宝石问题?

文件中的代码:require'tring_extensions'puts“这是一个测试”.vowels.join('_')

我运行它时出现错误信息 . /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- string_extensions (LoadError)from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require ' from vowel_test.rb:1:in `'

RubyGems环境:

  • RUBYGEMS版本:2.1.11

  • RUBY VERSION:2.0.0(2014-05-08 patchlevel 481)[universal.x86_64-darwin14]

  • 安装目录:/Library/Ruby/Gems/2.0.0

  • RUBY EXECUTABLE:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

  • EXECUTABLE DIRECTORY:/ usr / bin

  • SPEC CACHE目录:/Users/abdul/.gem/specs

  • RUBYGEMS PLATFORMS:

  • 红宝石

  • universal-darwin-14

  • GEM路径:

  • /Library/Ruby/Gems/2.0.0

  • /Users/abdul/.gem/ruby/2.0.0

  • /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0

  • 创业板配置:

  • :update_sources => true

  • :verbose => true

  • :backtrace => false

  • :bulk_threshold => 1000

  • 远程来源:

  • https://rubygems.org/

  • SHELL PATH:

  • / usr / local / bin

  • / usr / bin

  • / bin

  • / usr / sbin

  • / sbin

  • / usr / local / git / bin

  • /Users/abdul/.rvm/bin

回答(0)