如何避免'没有这样的文件加载 - map_by_method'脚本/控制台与bundler? [英] How to avoid 'no such file to load -- map_by_method' script/console with bundler?

查看:157
本文介绍了如何避免'没有这样的文件加载 - map_by_method'脚本/控制台与bundler?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 bundler 运行 rails 2.3.10 。我使用 rvm ,在全局gemsets通常我把宝石有用的irb。默认情况下,我有这些:map_by_method,what_methods,ap,net-http-spy,hirb,looksee,pp,wirble。

I am running rails 2.3.10 with bundler. I use rvm, in global gemsets usually I put the gems useful for the irb. By default I had these there: map_by_method, what_methods, ap, net-http-spy, hirb, looksee, pp, wirble.

当我开始irb,宝石需要是可以为它,和事情看起来他们应该。但是,当我启动脚本/控制台,它不能到达当前rvm gemset中的gem只有在 Gemfile 中定义的那些。我收到消息没有这样的文件加载 - map_by_method 。显然我不想把那些irb特定的文件放在我的 Gemfile

When I start irb, the gems it needs are avalaible for it, and the things look as they should. However, when I start script/console, it cannot reach the gems in the current rvm gemset only those which are defined in Gemfile. I get message no such file to load -- map_by_method. Obviously I do not want to put those irb specific files to my Gemfile.

确保脚本/控制台还使用bundler外部的gem?

Do you know some way, how to convince script/console to use also gems outside bundler?

推荐答案

bundler将永远不会使用Gemfile中未定义的任何gem 。如果这些gem是用于开发的,只需要考虑将它们添加到Gemfile中,名为:development

bundler will never use any gem that is not defined in the Gemfile. If those gems are for development use only consider adding them to the Gemfile in a group called :development

这篇关于如何避免'没有这样的文件加载 - map_by_method'脚本/控制台与bundler?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆