2014-09-05 89 views
-1

我正在做Rails 2.3到3.2升級。在此期間,我改變了很多東西。 現在我在打開網頁應用程序的主頁時看不到任何HTML。我已經使用after_filter驗證過我的控制器是否返回HTML,但Rails不會在響應代碼中返回該HTML。 我試着在調試日誌級別運行應用程序,但在日誌中沒有看到任何相關信息。Rails服務器不返回響應

有人可以幫我解決這個問題嗎?

編輯:我試着在ActionDispacther,ActiveSupport,Rack文件上記錄日誌,但沒有得到任何有關服務器錯誤的線索。

+3

信息太少。 – 2014-09-06 14:06:06

+0

@mohit請顯示您的查看文件嗎? – uday 2014-09-06 15:00:22

+0

'curl -v http:// localhost:3000'的結果是什麼? – 2014-09-06 18:41:04

回答

1

確保您的資產正在投放!有些東西會導致你的應用程序到302,所以也許路由或資產正在這樣做。

我知道你可能已經看到了這一點,但做了如下清單:

來源:http://www.rails-upgrade-checklist.com/#3.0

獲取到Rails 3.0

[ ] git checkout -b oh-noes-here-we-goes 
[ ] Use the Rails 3.0 upgrade tool RailsCast to overwrite your current application 
[ ] Get your Gemfile in order, attempting to load rails console as you go 
[ ] Update your ActiveRecord queries to the new syntax 
[ ] Loading rails console is a huge deal: Have a {chocolate,whiskey,beers} 
[ ] Let's run that test suite. If you're test unit: yay! If you're rspec, upgrade! (probably best to delete spec/helper and rails g rspec:install 
[ ] run your javascript tests (hahahahaha omg I know right?!?!!!) 
[ ] If your pages load, that means you have a somewhat functioning rails 3.0 application. Commit your changes and get it on heroku for your staff/helpers/friends&family to go to 
[ ] Let's talk about Authentication. Don't continue to run acts_as_authenticatable or auth_modules just because its there. My recommendation: replace with devise and send your users a link to reset their password. This is controversial, as your users will know something's up… but: something IS up, you're not as secure as you need to be 
[ ] Update your mailers to the new syntax (and add tests to cover this case) 

獲取到Rails 3.2

[ ] upgrade your gem file to 3.2.13 
[ ] Add these gems to your Gemfile under a new "assets group" 
[ ] Move your public/images to app/assets/images 
[ ] Move your public/stylesheets to app/assets/stylesheets 
[ ] Move your public/javascripts to app/assets/javascripts 
[ ] Go through your stylesheets and look for urls(); if local, replace with image-url() (Sass) 
[ ] Remove any layouts that individually call stylesheets and javascripts 
[ ] See if your pages start to break open and swallow you whole 
[ ] Remove jQuery 
[ ] move your JavaScript libs (underscore, etc) to vendor/assets 
[ ] build your application.scss and application.js --- don't put code in these files, just require other files (or load the entire tree) 
[ ] find the problems when you're loading every CSS and JS on every page --- it's very common and you might need to change your application to be nicer 
[ ] Use RailsDiff to identify additional required configuration changes 
[ ] commit and push to heroku. do a little dance if it loads. ask for feedback 

別人有另一個問題,並使用R苦惱的寶石升級:

How to upgrade Rails app from 2.3.5 to 3.2.x?

如果一切都失敗了,結賬rbates:

http://railscasts.com/episodes/282-upgrading-to-rails-3-1

相關問題