切换到rvm和rails 3后Rake出现问题

发布于 2024-11-14 12:30:43 字数 1239 浏览 2 评论 0原文

所以问题的关键是我在运行时出现以下错误

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菜鸟,所以这可能很简单。感谢您抽出时间。

So the crux of the problem, is I get the following error when running

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

So obviously I did, gem install ParseTree.
Running gem list -d ParseTree produces:

*** 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

it looks like I'm using the correct rake

which rake

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

Most of the explanations I've read say to run sudo gem install ParseTree, but I don't understand why I should be installing with sudo if I'm managing gems through rvm.

Any ideas? I'm a unix noob, so it might be something simple. Thanks for your time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行雁书 2024-11-21 12:30:43

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

添加该行后,执行捆绑安装

You need to make sure your Gemfile has a gem 'ParseTree' line in it, otherwise Rails won't load it (even if the system has it installed).

After adding the line, do a bundle install.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文