删除了解压的 gems 文件夹,现在出现错误
我打开宝石包装,然后用“rm”手动删除它们。现在我无法让它使用系统 gem,并且我所做的一切都会出错。
我已经解压了 Shoulda 并冻结了 Rails,后来认为没有必要,并删除了 Shoulda 文件夹和所有 action_/active_ 文件夹(我重置为 HEAD 并放弃了更改)。我想不出哪里会有仍然反映解包/冻结的更改...
现在,当我尝试运行 rake 时,我得到:
no such file to load -- app_name/config/../vendor/rails/railties/lib/initializer
有没有办法让它恢复使用系统 gem?我不明白为什么它不只是按照优先级来加载系统宝石(如果供应商/插件/中的宝石不存在)。
任何见解都会很棒。
I unpacked gems and then removed them manually with "rm". Now I can't get it to use system gems and I get errors with everything I do.
I had unpacked shoulda and froze rails, then later decided it wasn't necessary and deleted the shoulda folder and all the action_/active_ folders (I reset to HEAD and discarded the changes). I can't think of where there would have been a change that's still reflecting an unpack/freeze...
Now when I try to run rake I get:
no such file to load -- app_name/config/../vendor/rails/railties/lib/initializer
Is there a way to get it back to using the system gems? I don't see why it doesn't just go by precedence and load the system gems if ones in vendor/plugins/ aren't present.
Any insight would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,找到了解决这个问题的方法:
我刚刚创建了一个新的 Rails 应用程序,将它作为 gem 依赖项,然后解压 gem 并冻结 Rails。然后我只是将文件夹供应商/宝石/和供应商/rails/复制到我的实际应用程序中,一切正常。现在我这次只需要使用实际的 Rails 命令(例如 rakerails:unfreeze)。
Ah, figured out a way around this problem:
I just created a new rails app, gave it shoulda as a gem dependency, then unpacked the gems and froze rails. Then I just copied the folders vendor/gems/ and vendor/rails/ over to my actual app, and everything works. Now I just have to use actual rails commands this time (like rake rails:unfreeze).