简体   繁体   English

“ rake gems”返​​回无状态的宝石是什么意思?

[英]What does it mean when “rake gems” returns gems with no state?

Here is the command line output: 这是命令行输出:

breefiel@breefield.com [~/rails_apps/recurse]# rake gems
(in /home/breefiel/rails_apps/recurse)
 - [ ] authlogic 
 - [ ] acts_as_archive 
 - [ ] haml 

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

Notice that the gems are not I, F, or R...what does this mean? 请注意,这些宝石不是I,F或R ...这是什么意思? This is just one indicator that my gems aren't being detected. 这只是未检测到我的宝石的一个指示。 When I install them, they are stored in "/home/breefiel/ruby/gems", and I've added the line 当我安装它们时,它们存储在“ / home / breefiel / ruby​​ / gems”中,并且我添加了以下行

Gem.path.push "/home/breefiel/ruby/gems"

To my environment.rb. 对我的环境。 However, "rake gems" is still returning the above output, so I'm not sure. 但是,“ rake gems”仍然返回上述输出,因此我不确定。 Any thoughts? 有什么想法吗?

The code is determined with this line of code: 该代码由以下代码行确定:

code = gem.loaded? ? (gem.frozen? ? (gem.framework_gem? ? "R" : "F") : "I") : " "

The blank code means the gem wasn't loaded. 空白代码表示未加载gem。 Make sure config.gem '...' doesn't have :lib => false because that will stop them from being loaded with Rails. 确保config.gem '...'没有:lib => false因为这将阻止它们被Rails加载。

If that isn't the case, looking in Rails::GemDependency , loaded? 如果不是这种情况,请查看Rails::GemDependency ,是否已loaded? will be set by load or determined by looking for the files (if load isn't called). 将由load设置或通过查找文件确定(如果未调用load )。

I have two suggestions, 我有两个建议

  1. Move your gems into the normal directories and see if that fixes the problem; 将您的gem移到普通目录中,看看是否可以解决问题; or 要么
  2. Manually call load using a ruby console and see if you get any errors that rails is missing. 使用ruby控制台手动调用load并查看是否遇到滑轨缺失的任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM