IronRuby On Rails VS. Ruby On Rails(入门)

发布于 2024-08-08 15:42:47 字数 521 浏览 3 评论 0 原文

场景

我是一名拥有几年经验的 C#/ASP.NET/MVC/Silverlight 开发人员。我正在尝试开始我的 Ruby On Rails 学习。我目前正在尝试真正感受 ROR。

我想了解标准

作为一名 .Net 开发人员,您倾向于使用标准 IDE (Visual Studio)、一些标准数据库(SQL Server、Oracle 等)以及设计 Web 2.0 应用程序样式的特定方式(XHTML /CSS、Silverlight 等)

“那么 RUBY ON RAILS 中的标准等效项是什么!?” (IDE、DB、表示层标记)'

另外

我该采取什么路线?我听说过 IronRuby,并且从我读到的内容来看,将其转换为与 Rails 一起使用(IronRuby on Rails)几乎已经完成。或者我是否直接使用 Ruby On Rails!?

有什么好处?

与使用 Ruby On Rails 相比,使用 IronRuby on Rails 对我有何好处?

帮助非常感谢。

The Scenario

I am a C#/ASP.NET/MVC/Silverlight developer with a few years experience. I'm trying to kickstart my Ruby On Rails learning. I'm currently trying to get a real feel for ROR.

I Want To Know Standards

As a .Net developer, you tend to use a standard IDE (Visual Studio), a few standard databases (SQL Server, Oracle etc.), and a particular way in which to style your web 2.0 application (XHTML/CSS, Silverlight etc.)

'So what are the standard equivalents to these in RUBY ON RAILS!? (IDE, DB's, Presentation Layer Markups)'

Also

What route do I take? I've heard about IronRuby and from what i've read thats nearly complete in terms of converting it for use with Rails (IronRuby on Rails). OR Do I just go straight into using Ruby On Rails!?

What Benefits?

How will I be benefited from using IronRuby on Rails over using Ruby On Rails?

Help greatly appreciated thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

欢烬 2024-08-15 15:42:47

IDE

大多数 RoR 开发人员使用简单的文本编辑器(MacOS 上的 Textmate,Windows 上的 Scite) - 主要是因为为 Java/C# 等语言设计的 IDE 的大多数功能(重构、代码完成)无法轻松应用于动态语言(例如红宝石。然而 Netbeans 到目前为止表现良好(另一方面,Aptana Studio - 基于 Eclipse)。

数据库

由于 RoR 做了很多抽象,因此您使用什么 RDBMS 并不重要。 MySQLPostgres< /a> 可能是最好的选择,因为它们是最常用的(因此您可以希望得到持续的支持)。我不会根据性能方面的争论来开始选择,而是根据它们附带的服务/支持来选择。

标记

标准将是 ERB(类似于 ASP 内联脚本)与 (X)HTML 的结合。然而,还有其他标记,例如 HAML 对于某些项目来说可能就足够了。

优点

使用 IronRuby,您可以访问 .NET 框架并与其他 .NET 库进行互操作。您还可以使用静态 C# 编写应用程序的某些部分。根据一些基准,它可能是“比原生 Ruby 更快”,但恕我直言,这并不是一个真正的优势。

目前,我建议您开始使用常规 RubyOnRails - 如果您仍然希望切换,您可能可以稍后切换(一旦 IronRoR 足够稳定)。

IDE

Most RoR developers use a simple text editor (Textmate on MacOS, Scite on Windows) - mostly because most features (Refactoring, Code Completion) of IDEs designed for languages like Java/C# can't be applied that easily on a dynmic language like Ruby. However Netbeans does well so far (on the other hand there is Aptana Studio - based on Eclipse).

Databases

Since RoR does a lot of abstraction it doesn't really matter what RDBMS you use. MySQL and Postgres might be the best choices since they are the most used ones (so you can hope for continuous support). I wouldn't start to chose based on the flamewar about performance, rather on the services/support that come with them.

Markup

The standard would be ERB (similar to ASP inline scripts) combined with (X)HTML. However there are other markups like HAML which might be enough for some projects.

Benefits

Using IronRuby you get access to the .NET framework and interop with other .NET libraries. You might also write some parts of your application in static C#. According to some benchmarks it might be "faster" than native Ruby, not a real advantage though IMHO.

At the moment I would recommend you to get started with regular RubyOnRails - you might be able to switch later on (once IronRoR is stable enough) - if you should still desire to switch.

空城仅有旧梦在 2024-08-15 15:42:47

IDE:

在 Mac 上,标准 IDE 是 Textmate

在 Windows 上,没有完全相同的标准,但我喜欢 Netbeans

数据库:

MySQL 可能是 Rails 最常用的 RDBMS,因此也是最受支持的,但我使用 Postgres,它也得到了很好的支持,并且使用它没有任何问题。

标记

内置的erb工作得很好,并且作为我想它是内置的,这使它成为一个标准。如果您愿意,您可以随时使用其他人。

IronRuby 与 Ruby

IronRuby 的功能可能几乎是完整的,但我敢打赌,某些功能很可能会出现问题,并且您可能很难确定是您的代码还是 IronRuby。我很想使用 vanilla ruby​​ 进行开发,然后再移植到 IronRuby,如果这是部署应用程序的合适方法的话。

另请参阅此问题,了解有关常用插件的信息:Rails 插件

IDEs:

On Macs the standard IDE is Textmate.

On Windows, there isn't a standard in quite the same way, but I like Netbeans.

Databases:

MySQL is probably the RDBMS most used with Rails, and hence the most supported, but I use Postgres, which is also very well supported, and have had no issues with using it.

Markup

The built in erb works perfectly well, and as it is built in I guess that makes it a standard. You can always use others if you want to.

IronRuby vs Ruby

IronRuby may be almost feature-complete, but I bet there is a good chance that some functionality will go awry, and you may have difficulty tracking down whether it is your code, or IronRuby. I'd be tempted to develop in vanilla ruby, and then port to IronRuby later, if that is an appropriate way to deploy your apps.

See also this question for information about commonly used plugins: Rails Plugins

各自安好 2024-08-15 15:42:47

我强烈建议使用常规的 Ruby On Rails - 您不必担心错误是否是由代码问题或您正在使用的平台不兼容引起的。

我的其余建议可能已经无可救药地过时了——自从我在 RoR 上做了很多事情以来已经有几年了,但我相信如果我完全错误的话其他人会提到它。

现在可能有带有 Ruby 插件的 IDE(我可能会寻找一些 Eclipse 插件),但它不像 Microsoft 生态系统那么严格。您正在使用开源工具,这意味着喜欢不同事物的不同开发人员会找到适合他们的解决方案,因此可能不存在这样的“标准”。我非常习惯使用带有 ruby​​ 模式插件的 Emacs,这非常棒,但有一个学习曲线。我认真听取了务实程序员的建议,在这方面非常认真地擅长使用文本编辑器,我很高兴我做到了。

就数据库而言,您也可以使用 MySQL,因为这看起来相当标准,但我相信您可以为许多不同的数据库解决方案找到 ActiveRecord 后端。如果您知道如何使用基本 SQL,并且可以很好地使用 SQL Server 和 Oracle,那么毫无疑问您也能够很好地使用 MySQL。

至于表示层,它实际上是通过 Rails 视图创建的。目的通常是构建符合标准的 html 并使用 CSS 对其进行样式设置。我从《Agile Web Development With Rails》一书中学到了很多东西,作为平台如何整体工作的指南。我知道现在每个人都想从网络上免费学习所有内容,但这本书以一种我认为非常实用的方式将这些内容组合在一起,并且物超所值。

I would strongly recommend using regular Ruby On Rails - you don't want to have to worry about whether your errors are caused by problems in your code or incompatibilities in the platform you're working with.

The rest of my advice may be hopelessly out of date- it's a couple of years since I did much with RoR, but I'm sure others will mention it if I'm entirely incorrect.

There probably are IDEs with plug-ins for Ruby now ( I'd be looking for some Eclipse plug-ins maybe ) but it's not as regimented as the Microsoft ecosystem. You're working with open-source tools which means that different developers who like different things find solutions that work for them, so there may not be a "standard" as such. I got very accustomed to using Emacs with the ruby-mode plugin which is pretty awesome but there is a learning curve. I took the Pragmatic Programmer's advice to get good at using a text editor pretty seriously on that front and I'm glad that I did.

In terms of databases you may as well use MySQL as that seems pretty standard but I believe you can find an ActiveRecord back-end for a lot of different DB solutions. If you know how to use basic SQL and you get on alright with SQL Server and Oracle you'll be able to get on fine with MySQL though, no question.

With regard to the presentation layer, that's really created through Rails views. The aim is usually to build standards-compliant html and use CSS to style it. I learned a lot from the Agile Web Development With Rails book as a guide to how the platform works as a whole. I know everyone wants to learn everything from the web for free these days, but that book fitted things together in a way I found very practical and represented excellent value for money.

み零 2024-08-15 15:42:47

如果您喜欢 Visual Studio 生态系统,请查看 Ruby In Steel蓝宝石钢。它是付费软件,尽管有是免费的个人版本

If you like the Visual Studio ecosystem, check out Ruby In Steel from SapphireSteel. It's payware, although there is a free personal edition

栩栩如生 2024-08-15 15:42:47

关于 Ruby 或 IronRuby - 使用 IronRuby 的好处仅在于它与 .Net 对象的无缝互操作性。

如果您计划使用 RoR 应用程序中的 .Net 代码,请使用 IronRuby。否则,就选择 Ruby。

顺便说一句,如果您计划使用 IIS,IronRuby on Rails 也会在其上更自然地运行。

Regarding Ruby or IronRuby - the benefit you will get from using IronRuby is only by its seamless interoperability with .Net objects.

If you're planning on using your .Net code from your RoR app, use IronRuby. Otherwise, go for Ruby.

By the way, if you're planning on using IIS, IronRuby on Rails will run more naturally on top of it as well.

帅气尐潴 2024-08-15 15:42:47

摘自: http://blogs.msdn.com/b/ericnel/archive/2010/03/25/5-steps-to-getting-started-with-ironruby.aspx

IronRuby 是 .NET 的 Ruby 编程语言 的开源实现,严重依赖于< a href="http://dlr.codeplex.com/" rel="nofollow">Microsoft 的动态语言运行时。该项目的第一目标是成为真正的 Ruby 实现,这意味着它运行现有的 Ruby 代码。查看关于在 IronRuby 中使用 Ruby 标准库和第 3 方库的此摘要。 IronRuby 与 .NET 紧密集成,因此任何 .NET 类型都可以从 IronRuby 使用,并且 IronRuby 运行时可以嵌入到任何 .NET 应用程序中。

本文后面的内容:

第 2 步 – 安装 IronRuby 友好编辑器

您需要安装一个编辑器才能使用 IronRuby,因为 Visual Studio 内没有对 IronRuby 的设计器支持。有很多编辑器可供选择,但我建议您选择:

  • SciTE(下载 MSI):这是一个轻量级文本编辑器,非常简单启动并运行。 SciTE 了解 Ruby 语法,并允许您使用一个小的 更改配置文件。

  • SharpDevelop 3.2 (下载 MSI):这是一个适用于 C#、VB、Boo 和现在的 IronRuby 的开源开发环境。 IronRuby 支持是新的,但它确实包括集成调试。您可能还想查看 SharpDevelop

注意:版本 1.1.1(发布日期:2010 年 10 月 21 日)起, Visual Studio 2010 具有对 IronRuby 的一流支持(本机、rails f/w 等等)。

Extracted from: http://blogs.msdn.com/b/ericnel/archive/2010/03/25/5-steps-to-getting-started-with-ironruby.aspx

IronRuby is a Open Source implementation of the Ruby programming language for .NET, heavily relying on Microsoft's Dynamic Language Runtime. The project's #1 goal is to be a true Ruby implementation, meaning it runs existing Ruby code. Check out this summary of using the Ruby standard library and 3rd party libraries in IronRuby. IronRuby has tight integration with .NET, so any .NET types can be used from IronRuby and the IronRuby runtime can be embedded into any .NET application.

later in this article:

Step 2 – Install an IronRuby friendly editor

You will need to Install an editor to work with IronRuby as there is no designer support for IronRuby inside Visual Studio. There are many editors to choose from but I would recommend you either went with:

  • SciTE (Download the MSI): This is a lightweight text editor which is simple to get up and running. SciTE understands Ruby syntax and allows you to easily run IronRuby code within the editor with a small change to the config file.

  • SharpDevelop 3.2 (Download the MSI): This is an open source development environment for C#, VB, Boo and now IronRuby. IronRuby support is new but it does include integrated debugging. You might also want to check out the main site for SharpDevelop.

Note: as of version 1.1.1 (released: Oct 21, 2010), Visual Studio 2010 has the first-class support for IronRuby (native, rails f/w and much more).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文