![](/img/trans.png)
[英]Problems with Rake When Using a Git Clone of a Rails Project with RVM
[英]Problems with Rake after switching to rvm and rails 3
所以問題的症結是我在運行時遇到以下錯誤
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
看起來我正在使用正確的耙子
which rake
/home/grantismo/.rvm/gems/ruby-1.9.2-p180/bin/rake
我讀過的大多數解釋都說要運行sudo gem install ParseTree
,但我不明白如果我通過 rvm 管理 gem,為什么我應該使用 sudo 安裝。
有任何想法嗎? 我是 unix 菜鳥,所以它可能很簡單。 謝謝你的時間。
你需要確保你的Gemfile
中有一個gem 'ParseTree'
行,否則 Rails 不會加載它(即使系統安裝了它)。
添加該行后,執行bundle install
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.