Rake提示uninitialized constant Rake::DSL解决办法_Ruby_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > Rake提示uninitialized constant Rake::DSL解决办法

Rake提示uninitialized constant Rake::DSL解决办法

 2012/6/18 16:27:16  hot88zh  程序员俱乐部  我要评论(0)
  • 摘要:环境:Ruby1.9.1/Rails3.0.9/Rake0.9.2在运行rakedb:create的时候提示rakeaborted!uninitializedconstantRake::DSL/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2482:in`const_missing'/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in`<class
  • 标签:解决办法 解决 Ant

环境:Ruby 1.9.1/Rails 3.0.9/Rake 0.9.2

在运行rake db:create的时候提示

rake aborted!
uninitialized constant Rake::DSL
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `<top (required)>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rdoc-3.6.1/lib/rdoc/task.rb:37:in `require'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/rdoc-3.6.1/lib/rdoc/task.rb:37:in `<top (required)>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentation.rake:2:in `require'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/tasks/documentation.rake:2:in `<top (required)>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in `load'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:15:in `block in <top (required)>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in `each'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/tasks.rb:6:in `<top (required)>'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:in `require'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:215:in `initialize_tasks'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:139:in `load_tasks'
/usr/local/ruby/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
/usr/local/sharephoto/Rakefile:7:in `<top (required)>'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/local/ruby/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/local/ruby/bin/rake:31:in `<main>'

?解决方法

打开RakeFile文件,在require 'rake'上面加入

require 'rake/dsl_definition'
?
发表评论
用户名: 匿名