【发布时间】:2012-02-17 23:42:34
【问题描述】:
找到这个帖子Include namespace in Rails 3.1 console,但它似乎不起作用。
定义了以下库/任务,它可以从命令行运行:rake namespace_name:task_name。
如何在控制台中调用namespace_name 中的方法method_name,而不调用任务?
rails console
namespace_name::task_name
NameError: undefined local variable or method 'namespace_name' for main:Object
irb namespace_name
NameError: undefined local variable or method 'namespace_name' for main:Object
在 Rails 3.07、Ubuntu 中工作。
【问题讨论】:
-
不是 100% 确定您要做什么,但请考虑改用 rake-sh。
标签: ruby-on-rails ruby ruby-on-rails-3 namespaces rails-console