2012-02-09 2 views
0

Когда я выполнитьрельсов 3 рек маршрутов не работает, нет маршрутов, показанных в качестве выходного

bundle exec rake routes --trace 

выход:

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#each called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:84. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#each called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/source.rb:162. 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /usr/local/rvm/gems/[email protected]/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:84. 
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. 
at /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rdoctask.rb 
** Invoke routes (first_time) 
** Invoke environment (first_time) 
** Invoke threadsafe:disabled (first_time) 
** Execute threadsafe:disabled 
** Execute environment 
** Execute routes 

и вот мой конфиг/routes.rb файл

Rails_app::Application.routes.draw do 

    match '/' => 'pages#show', :id => '1-welcome-page' 
    match  ':controller(/:action(/:id(.:format)))' 

end 

Это мой список драгоценных камней

abstract (1.0.0) 
actionmailer (3.0.3) 
actionpack (3.0.3) 
activemodel (3.0.3) 
activerecord (3.0.3) 
activeresource (3.0.3) 
activesupport (3.0.3) 
arel (2.0.10) 
builder (3.0.0, 2.1.2) 
bundler (1.0.10 ruby) 
cgi_multipart_eof_fix (2.5.0) 
daemons (1.1.0, 1.0.10) 
erubis (2.6.6) 
eventmachine (0.12.10) 
fastthread (1.0.7) 
gem_plugin (0.2.3) 
i18n (0.6.0) 
kgio (2.2.0) 
mail (2.2.19) 
mime-types (1.17.2) 
mongrel (1.2.0.pre2) 
mysql2 (0.2.7) 
polyglot (0.3.3) 
rack (1.2.5) 
rack-mount (0.6.14) 
rack-test (0.5.7) 
rails (3.0.3) 
railties (3.0.3) 
rake (0.9.2.2) 
rmagick (2.13.1) 
thin (1.2.7) 
thor (0.14.6) 
treetop (1.4.10) 
tzinfo (0.3.31) 
unicorn (3.4.0) 
xmpp4r (0.5) 

Кто-нибудь знает, почему нет маршрутов?

ответ

0

Ничего себе, я, наконец, получил маршруты работы. Я думаю, что часть проблемы заключалась в том, что приложение было приложением Rails 2, которое было преобразовано в приложение Rails 3. Во всяком случае то, что я сделал:

1. Made a simple Rails 3 app, and ran 'bundle exec rake routes' and I could see that that worked, so I knew the current set of libraries wasn't the problem. 
2. Then I made the config files the same for both apps. 
3. Also made the 'config/initializer' files the same for both apps. 
4. Also made the 'config/environments/production.rb' file the same for both apps. 
5. And that did the trick! 

После того, как я был простой Rails 3 приложения, которые работали на «грабли маршрутов», я раньше пытался запустить отладчик рейк маршрутов для обоих приложений:

bundle exec rdebug rake routes 

и перешел через LOT кода, чтобы увидеть, где два приложения использовали разные пути, но так как между этими двумя приложениями было так много разницы, я не мог понять, где все идет не так.

В любом случае, я надеюсь, что это поможет кому-то, кто сталкивается с той же проблемой.

0

Казался по этому вопросу getting error while creating rails app? TAHT вы должны обновить ваше пакетирование версии

+0

Я запустил сборщик обновлений gem и понял, что есть «Nothing to update». Я пробовал все предложения по удалению сообщений «Gem.source_index устарел», и никто из них не работал. Но поскольку это сообщение - это просто ПРИМЕЧАНИЕ, я не уверен, что это проблема. –

Смежные вопросы