我应该将 Ruby 1.9.2 与我的新 Web 应用程序一起使用吗? [英] Should I use Ruby 1.9.2 with my new web app?

查看:36
本文介绍了我应该将 Ruby 1.9.2 与我的新 Web 应用程序一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Rails 3 开始一个新的 Web 应用程序.我对 Web 开发还比较陌生,在使用 Ruby 1.8.7 和 Rails 2.3.5 时,我真的很享受所有可用的互联网资源.有什么建议反对在我的新项目中使用 Ruby 1.9.2?

Starting a new web app with Rails 3. I'm still relatively new to web development and have really enjoyed all the internet resources available to me while working in Ruby 1.8.7 and Rails 2.3.5. Any advice against using Ruby 1.9.2 on my new project?

推荐答案

我已经成功地将我所有的 Rails 项目(除了一个,但我正在处理它)从 Ruby 1.8.7/Rails 2.3.5 转换为 Rails3.0.0 和 Ruby 1.8.7/1.9.2 RC2 两种环境都相当稳定.

I have been successfully converting all my Rails projects (except one, but I'm working on it) from Ruby 1.8.7/Rails 2.3.5 to Rails 3.0.0 and Ruby 1.8.7/1.9.2 RC2 and both environments are pretty stable.

幸运的是,自从我发布 这个问题.

Fortunately, things changed since I posted this question.

导轨

除非您确实有某些因素阻止您这样做,否则我强烈建议您从 Rails 3 开始.将应用程序从 Rails 2 升级到 Rails 3 所需的工作应该会阻止您从 Rails 2 开始.

Unless you really have something that prevents you to do that, I strongly encourage you to start with Rails 3. The effort required to upgrade an application from Rails 2 to Rails 3 should discourage you from starting from Rails 2.

谈到插件和 Gems,许多开发人员开始将他们的库转换为 Rails 3.目前有非常高的兼容性.此外,由于新的 Rails 插件 API,Rails 3 的插件往往比 Rails 2.3 的插件更强大.他们可以加载任务,不再滥用猴子补丁或依赖内部黑客.

Talking about plugins and Gems, many developers are starting to convert their libraries to Rails 3. Currently there's a very high level of compatibility. Furthermore, Rails 3 focused plugins tends to be quite more powerful to the Rails 2.3 ones, thanks to the new Rails plugin API. They can load tasks, they no longer abuse monkey patching or rely on internal hacks.

此外,Rails 3 即将推出.除非您的项目将在 1 周内部署,否则稳定版本可能会在您部署代码之前可用.我这不会发生,考虑到我目前正在生产环境中管理几个 Rails 3 项目,它们非常稳定(Rails 3 RC1,Beta 4 在缓存环境中有一个非常奇怪的错误).

Also, Rails 3 is just around the corner. Unless your project will be deployed in 1 week, the stable version will probably available before you deploy your code. I this would not happe, consider that I'm currently managing a couple of Rails 3 project in a production environment and they are pretty stable (Rails 3 RC1, the Beta 4 has a really weird bug in the caching environment).

Ruby 1.9.2

Ruby 1.9.2 比 Ruby 1.8.7 强大得多.如果这是一个全新的项目,我建议你使用 1.9 分支.

Ruby 1.9.2 is way more powerful than Ruby 1.8.7. If this is a brand new project, I suggest you to use the 1.9 branch.

通常,在 Ruby 1.9 中启动新项目比转换现有项目更容易.

Usually, it's more easy to start a new project in Ruby 1.9 than converting an existing one.

Ruby 1.9.2 更快,甚至比 REE 还要快.大多数常见的 Ruby 1.8.7 Gems 都可以与 Ruby 1.9 一起使用,除了少数几个,例如 RCov.同样,您将需要一个不适用于 Ruby 1.9.2 的库是非常困难的.

Ruby 1.9.2 is faster, even more faster than REE. The most part of the common Ruby 1.8.7 Gems work with Ruby 1.9 except a few ones, such as RCov. Again, it's very hard you're going to need a library which doesn't work with Ruby 1.9.2.

如果发生这种情况,很可能这是一个过时的库,并且 Ruby 生态系统中可能有更好的替代品.

If it happens, chances are this is an outdated library and a better replacement is probably available in the Ruby ecosystem.

如果您找不到替代方案,请记住 Rails 3 提供了使用自定义库的绝佳方式,这要归功于 Bundler.您可以 fork 项目并要求 Bundler 使用您的 fork.您甚至可以将库集成到您的存储库中,并要求 Bundler 从路径加载库.

If you can't find an alternative, remember that Rails 3 provides an excellent way to use custom libraries, thanks to Bundler. You can fork the project and ask Bundler to use your fork. You can even integrate the library in your repos and ask Bundler to load the library from a path.

结论

根据我的个人经验,我对 Ruby 1.9.2 和 Rails 3 非常满意.这是迄今为止我最喜欢的环境,也是我用于新项目的默认环境.

From my personal experience, I've been very happy with Ruby 1.9.2 and Rails 3. This is by far my favorite environment and my default environment for new projects.

如果您不能使用 Ruby 1.9.2,请尝试使用 Ruby 1.8.7.另一方面,我强烈建议您从 Rails 3 开始.

If you can't use Ruby 1.9.2 try with Ruby 1.8.7. On the other side, I strongly encourage you to start with Rails 3.

这篇关于我应该将 Ruby 1.9.2 与我的新 Web 应用程序一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆