ruby-on-rails – 捆绑控制台失败w /未初始化的常量Rails

我使用rails插件新的Foobar –full –mountable命令创建了一个新的Rails引擎.运行捆绑控制台时,我得到未初始化的常量Rails为什么会这样?
Resolving dependencies...
Unfortunately,a Fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:2:in `<module:Foobar>': uninitialized constant Rails (NameError)
    from /Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:1:in `<top (required)>'
    from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `require'
    from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `<top (required)>'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/cli.rb:664:in `console'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/vendor/thor/command.rb:27:in `run'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/vendor/thor.rb:363:in `dispatch'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/vendor/thor/base.rb:438:in `start'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/cli.rb:10:in `start'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/bin/bundle:22:in `block in <top (required)>'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.5.1/bin/bundle:22:in `<top (required)>'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/bin/bundle:23:in `load'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@global/bin/bundle:23:in `<main>'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@foobar/bin/ruby_executable_hooks:15:in `eval'
    from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353@foobar/bin/ruby_executable_hooks:15:in `<main>'

解决方法

在Foobar / lib / foobar / engine.rb文件添加require’rail’对我有用.我从 here得到了答案.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...