Rails 是否有另一个位置正在寻找我的 irbrc 配置?
我的 .irbrc 位于我的 ~/.irbrc 中。
我注意到当我在 Rails 3.x 应用程序上运行“rails console”时,它说它正在寻找 gem。
Gems missing: no such file to load -- ap
但如果我在 Rails 2.x 应用程序上运行“irb”或“脚本/控制台”,一切都会按预期运行。
Rails 3 是否有另一个位置寻找 irbrc 配置?
我不确定此信息是否适用,但我正在我的盒子上运行 RVM (Ubuntu)
I have my .irbrc located in my ~/.irbrc.
I noticed that when I run 'rails console' on a Rails 3.x application, it says that its looking for a gem.
Gems missing: no such file to load -- ap
but if I run just 'irb' or 'script/console' on a rails 2.x app, everything works as it should be.
Is there another location Rails 3 looks for irbrc config?
I'm not sure if this information is applicable, but I'm running RVM on my box (Ubuntu)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚想通了。我想我将其粘贴在这里是为了其他也有同样问题的人。
根据 http://matthewhutchinson .net/2010/9/19/rails-3-bash-aliases-and-irbrc-configs/page/2
您需要将系统 gem 添加到 Rails 3 应用程序的 Gemfile 中(Bundler 问题) 。
我做了上面的事情并且有效。
更新
似乎https://gist.github.com/2643079是迄今为止我发现的最优雅的解决方案。它的效果也很好。
I've just figured it out. I thought I paste it here for others who had the same problem as well.
According to http://matthewhutchinson.net/2010/9/19/rails-3-bash-aliases-and-irbrc-configs/page/2
You'll need to add your system gems into the Gemfile for Rails 3 applications (Bundler issue).
I did the above and it works.
Update
It seems like https://gist.github.com/2643079 is the most elegant solution I've found so far. It works pretty well too.
这是因为bundler,方法是禁用系统gem。有很多建议的方法可以解决这个问题,但没有一个是完美的(请参阅此票 关于捆绑器的一些建议)。
This is because of bundler and the way is disables system gems. There's a bunch of suggested ways to deal with this, none of them perfect (see this ticket on bundler for some suggestions).