在需要activerecord后需要失败Ruby

时间:2016-07-22 07:37:24

标签: ruby activerecord

我不能要求' mongo'和' redis'在我要求' active_record'之后。 是否有人遇到过这类问题以及如何解决?

# irb
irb(main):001:0> require 'mongo'
=> true
irb(main):002:0> require 'active_record'
=> true
irb(main):003:0> exit
# irb
irb(main):001:0> require 'active_record'
=> true
irb(main):002:0> require 'mongo'
oadError: cannot load such file -- mongo
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from (irb):2
    from /usr/local/bin/irb:11:in `<main>'
irb(main):003:0>

要求&#39; mongo&#39;工作正常。首先要求&#39; active_record&#39;之后,在倒车时发生错误

更新

当我使用index.alauda.cn/library/ruby:2.2.3index.alauda.cn/library/ruby:2.2.0正常工作而没有此问题时,问题就出现了。

0 个答案:

没有答案