【问题标题】:Problems with Rake after switching to rvm and rails 3切换到 rvm 和 rails 3 后 Rake 出现问题
【发布时间】:2011-06-06 00:03:08
【问题描述】:

所以问题的症结,是我在运行的时候出现如下错误

rake -T

WARNING: Global access to Rake DSL methods is deprecated.  Please Include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method SeenicServer::Application#task called at /home/grantismo/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
rake aborted!
no such file to load -- parse_tree

显然我做到了,gem install ParseTree。 运行gem list -d ParseTree 产生:

*** LOCAL GEMS ***

ParseTree (3.0.7)
    Author: Ryan Davis
    Rubyforge: http://rubyforge.org/projects/parsetree
    Homepage: http://rubyforge.org/projects/parsetree/
    Installed at: /home/grantismo/.rvm/gems/ruby-1.9.2-p180

    ParseTree is a C extension (using RubyInline) that extracts the
    parse tree for an entire class or a specific method and returns it
    as a s-expression (aka sexp) using ruby's arrays, strings, symbols,
    and integers

看来我使用了正确的 rake

which rake

/home/grantismo/.rvm/gems/ruby-1.9.2-p180/bin/rake

我读过的大多数解释都说要运行sudo gem install ParseTree,但我不明白如果我通过 rvm 管理 gem,为什么我应该使用 sudo 安装。

有什么想法吗?我是一个unix noob,所以它可能很简单。感谢您的宝贵时间。

【问题讨论】:

    标签: ruby-on-rails rake rvm


    【解决方案1】:

    您需要确保您的Gemfile 中包含gem 'ParseTree' 行,否则Rails 不会加载它(即使系统已安装它)。

    添加行后,执行bundle install

    【讨论】:

    • 谢谢,我完全忘记了捆绑。
    猜你喜欢
    • 2012-11-29
    • 2021-04-09
    • 1970-01-01
    • 2012-04-20
    • 1970-01-01
    • 2017-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多