Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
862 views
in Technique[技术] by (71.8m points)

ruby on rails - What is this Routing Error and rake routes error?

I am new to Ruby on Rails. After fiddling around with it for a week I decided to give it ago, bought a book. Reinstalled it all. And now when I thought I fixed it, I get an error saying:

Routing Error

No route matches "/index"

So I did

rake routes

And that resulted in the error list below.

/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/version.rb:4:
warning: already initialized constant MAJOR
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/version.rb:5:
warning: already initialized constant MINOR
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/version.rb:6:
warning: already initialized constant BUILD
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/version.rb:3:
warning: already initialized constant NUMBERS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/version.rb:9:
warning: already initialized constant VERSION
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake.rb:26:
warning: already initialized constant RAKEVERSION
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/early_time.rb:17:
warning: already initialized constant EARLY
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/alt_system.rb:32:
warning: already initialized constant WINDOWS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:28:
warning: already initialized constant DEFAULT_RAKEFILES WARNING:
Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already
exists
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task_arguments.rb:73:
warning: already initialized constant EMPTY_TASK_ARGS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/invocation_chain.rb:49:
warning: already initialized constant EMPTY
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_utils.rb:10:
warning: already initialized constant RUBY
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_utils.rb:84:
warning: already initialized constant LN_SUPPORTED
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/dsl_definition.rb:143:
warning: already initialized constant Commands
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:44:
warning: already initialized constant ARRAY_METHODS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:47:
warning: already initialized constant MUST_DEFINE
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:51:
warning: already initialized constant MUST_NOT_DEFINE
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:55:
warning: already initialized constant SPECIAL_RETURN
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:61:
warning: already initialized constant DELEGATING_METHODS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:364:
warning: already initialized constant DEFAULT_IGNORE_PATTERNS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/file_list.rb:370:
warning: already initialized constant DEFAULT_IGNORE_PROCS
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake.rb:64:
warning: already initialized constant FileList
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake.rb:65:
warning: already initialized constant RakeFileUtils rake aborted!
stack level too deep
/Users/dennisbuizert/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/rake_module.rb:25
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to install an older version of rake.

gem install rake -v=0.8.7

You might get a warning message when using rake.

WARNING: Global access to Rake DSL methods is deprecated. Please include ... Rake::DSL into classes and modules which use the Rake DSL methods.

You can just add "include Rake::DSL" to the Rakefile before the applications load_tasks were called.

I found a post to fix that issue. Global access to Rake DSL methods is deprecated


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...