简体   繁体   English

从版本3降级到2时Ruby on Rails无法渲染视图

[英]Ruby on Rails not rendering views when downgrading from version 3 to 2

I am in the middle of putting up my Ruby on Rails app to a live server but have to downgrade from version 3 to 2 because that is all my shared hosting provider supports. 我正在将Ruby on Rails应用程序安装到实时服务器中,但是必须将版本从3降级到2,因为这是我共享的托管服务提供商所支持的全部功能。 I was able to adapt my models, controllers and routes without much problem. 我能够毫无问题地调整我的模型,控制器和路线。 The problem I am having is with the views rendering. 我遇到的问题是视图渲染。

I went through the process of creating a default layout for each controller as Rails 2 requires. 我按照Rails 2的要求完成了为每个控制器创建默认布局的过程。 When I run the app on the server, it starts just fine and the smokescreen index.html is visible but if I delete that and try to see the real app, all I get are broken links and files that are unable to load according to the browser. 当我在服务器上运行该应用程序时,它就可以正常启动,并且可以看到Smokescreen index.html,但是如果删除该视图并尝试查看真实的应用程序,我得到的只是断开的链接和无法根据文件加载的文件。浏览器。

I am sure this is an issue due to the downgrade. 由于降级,我确定这是一个问题。 Any ideas on what I am doing wrong? 关于我在做什么错的任何想法吗?

Doing a downgrade from Rails 3 to Rails 2 seems to me like a crazy thing to do for many reasons: 在我看来,从Rails 3降级到Rails 2似乎很疯狂,原因很多:

1) Rails 4 is already released. 1)Rails 4已经发布。 You should be looking to upgrade instead of downgrading. 您应该寻找升级而不是降级。

2) There are many hosts out there that offer amazing services and even some free. 2)有很多提供出色服务的主机,甚至有一些免费的。 Heroku is a great place to start if you don't want to manage your own server. 如果您不想管理自己的服务器,Heroku是一个不错的起点。

3) Rails 3 was almost a complete rewrite of the way Rails worked. 3)Rails 3几乎完全重写了Rails的工作方式。 This includes the addition of the Assets Pipeline which is a blessing in terms of development. 这包括增加资产管道,这对发展是有利的。

With that said, if you're still looking to downgrade, I would try to revert the steps found in many Upgrading Rails 2 to Rails 3 tutorials out there. 话虽如此,如果您仍要降级,我将尝试还原许多《 将Rails 2升级到Rails 3》教程中的步骤。

They are a bit long and many steps required to put here but a simple google search will yield many great resources. 它们有点长,需要很多步骤才能放到这里,但是简单的Google搜索将产生很多很棒的资源。 Here's a Railscasts http://railscasts.com/episodes/226-upgrading-to-rails-3-part-2 这是Railscasts http://railscasts.com/episodes/226-upgrading-to-rails-3-part-2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM