2013-01-05 97 views
0

我正在嘗試運行this app,該服務器上一次提交時間大約在一年前。花了一段時間試圖讓所有的寶石和寶石依賴項安裝(包括註釋掉寶石),我可以得到綠燈「捆綁完成」的消息。然而,正在運行的服務器的時候,我碰到下面的錯誤日誌:無法使Rails 3.2服務器運行

Rails 3.2.9 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/zallanx/rails_projects/smartr/config/environment.rb:5) 
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/zallanx/rails_projects/smartr/config/environment.rb:5) 
Exiting 
/Users/zallanx/rails_projects/smartr/config/environments/development.rb:26:in `block in <top (required)>': uninitialized constant Sass::Plugin (NameError) 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:24:in `class_eval' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:24:in `configure' 
    from /Users/zallanx/rails_projects/smartr/config/environments/development.rb:1:in `<top (required)>' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/engine.rb:571:in `block in <class:Engine>' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing' 
    from /Users/zallanx/rails_projects/smartr/config/environment.rb:5:in `<top (required)>' 
    from /Users/zallanx/rails_projects/smartr/config.ru:2:in `block in <main>' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' 
    from /Users/zallanx/rails_projects/smartr/config.ru:1:in `new' 
    from /Users/zallanx/rails_projects/smartr/config.ru:1:in `<main>' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/server.rb:200:in `app' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/commands/server.rb:46:in `app' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/rack-1.4.1/lib/rack/server.rb:252:in `start' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/commands/server.rb:70:in `start' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/commands.rb:55:in `block in <top (required)>' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/commands.rb:50:in `tap' 
    from /Users/zallanx/.rvm/gems/[email protected]/gems/railties-3.2.9/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:9:in `require' 
    from script/rails:9:in `<main>' 

是舊的Rails 2.3的插件扔我了嗎?這是我在Hartl的Rails教程之後的第一個「真實世界」項目,很不幸,我沒有很多處理這類錯誤的經驗。該應用程序的Gemfile名爲smartr,其格式爲linked。謝謝!!

回答

1

Here是一篇文章可以幫助您經營舊appllications溫特的Rails 4.請仔細閱讀這部分沒有更多的供應商/插件,它介紹如何解決你的一個問題。

有關sass-plugin的第二個問題可以通過在development.rb中註釋26字符串來解決。它必須寫在Rails 3應用程序的其他地方。

+0

非常感謝您指出資源!當我運行Rails 3.2時,我認爲這篇文章肯定會有所幫助。我也在'development.rb'中註釋了'Sass :: Plugin.options [:debug_info] = false',但它仍然顯示錯誤'/Users/zallanx/rails_projects/smartr/config/environments/development.rb:26 :在'頂部(必填)>'塊中:未初始化的常量Sass :: Plugin(NameError)'..再次感謝!我希望自己更新到一個Rails 3.2或4應用程序..但是有點不知所措從現在開始:) – daspianist

1

當我在供應商文件夾中有一些2.x插件時,我得到了類似的錯誤。我刪除它們後,錯誤消失了。

+0

這聽起來很有希望 - 我真的沒有很多經驗處理供應商文件夾中的項目..我將如何禁用或卸載它們?我看到有一個'uninstall.rb'文件,但它是空的。謝謝! – daspianist

+0

@daspianist只是'rm -r'他們 – chadoh

1

Sass在gemfile中,但它的版本不受限制。由於該項目一年未修改,因此該項目可能會期望舊版Sass。你應該嘗試研究在Gemfile中降級sass並且做bundle update看看會發生什麼。另外,Rails 3.2並沒有在一年前,所以我不會在Rails 3.2上運行這個應用程序。

1

它看起來像一個名爲Sass :: Plugin的東西是丟失或不正確加載您的應用程序。

檢查,如果上述插件存在

HTH

+0

感謝您的建議。你是否認爲在3.0.9版本的Rails 3.2(甚至是Rails 4)上開發一個項目能夠緩慢升級一年前(由其他人)構建的Rails應用程序,這將是值得的任務?謝謝 – daspianist

+1

它取決於:),我認爲它不依賴於技術方面,而是商業(多少值得努力)。但是做這樣的項目會給你一個巨大的體驗,我認爲這是一件好事情。但我相信這會很艱難,但我個人認爲它值得:) – sameera207