切换到rvm和rails 3后Rake出现问题
所以问题的关键是我在运行时出现以下错误
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要确保您的
Gemfile
中有一个gem 'ParseTree'
行,否则 Rails 不会加载它(即使系统已安装它)。添加该行后,执行
捆绑安装
。You need to make sure your
Gemfile
has agem '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
.