在 Windows 上使用 Ruby 进行开发

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1013270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 21:22:31  来源:igfitidea点击:

Developing in Ruby on Windows

ruby-on-railswindowsruby

提问by Rob Watson

I'm starting a new job soon where I'm going to be developing in Ruby and Rails on a Windows machine. I haven't used Windows for years, and the likes of Textmate, Git and Bash, are an integral part of the workflow using a Mac.

我即将开始一份新工作,我将在 Windows 机器上使用 Ruby 和 Rails 进行开发。我已经多年没有使用 Windows,Textmate、Git 和 Bash 之类的软件是使用 Mac 工作流程不可或缺的一部分。

So, does anybody have any suggestions or recommendations as to the best tools or work strategies to use? Or pitfalls to avoid?

那么,是否有人对使用的最佳工具或工作策略有任何建议或建议?还是要避免的陷阱?

In particular, of course, I'm interested in the best text editor. (I'm seriously thinking about taking the opportunity to learn Vim or Emacs, or whatever the Windows ports are called, but any other thoughts would be welcome.)

当然,我对最好的文本编辑器特别感兴趣。(我正在认真考虑借此机会学习 Vim 或 Emacs,或任何 Windows 端口的名称,但欢迎任何其他想法。)

Additionally, any ideas of useful plugins, tools or programs would be appreciated.

此外,任何有用的插件、工具或程序的想法将不胜感激。

If you think that I've completely lost my mind, then feel free to tell me too ;-)

如果您认为我已经完全失去理智,那么也请随时告诉我 ;-)

cheers !

干杯!

回答by Robert S.

Ruby and Rails

Ruby 和 Rails

Development Environment

开发环境

IDEs

集成开发环境

Text Editors

文本编辑器

bash Environment

bash 环境

Source Control

源代码管理

Helpful Links

有用的网址

Related Questions

相关问题

回答by Bryan Migliorisi

RubyMineis supposed to be a top notch IDE. JetBrains always makes great products.

RubyMine应该是一流的 IDE。JetBrains 总是能制造出出色的产品。

回答by eKek0

NetBeansor eas IDEs

NetBeanse作为 IDE

回答by Sarah Mei

Here's my incredibly detailed setup guide for Windows Server 2003, which works essentially unchanged on XP Pro and Vista. See this general installation list, and modify the instructions if you get different results. They're meant for people new to programming, so they'll probably be overly explicit for your purposes.

这是我非常详细的Windows Server 2003设置指南,它在 XP Pro 和 Vista 上基本不变。请参阅此通用安装列表,如果得到不同的结果,请修改说明。它们适用于刚接触编程的人,因此对于您的目的而言,它们可能过于明确。

IMO, the one thing you definitely need is a *nix-style shell. This has nothing to do with whether you like dir or ls - you need to be able to run shell scripts or you won't get very far.

IMO,您绝对需要的一件事是 *nix 风格的外壳。这与您喜欢 dir 还是 ls 无关 - 您需要能够运行 shell 脚本,否则您将走不远。

git bash (comes with msysgit) is my beacon in the storm of cmd.exe windows. It's essentially bash on Windows, and lets you run almost any script that you can run on *nix. This includes all the gem command line executables.

git bash(与msysgit一起提供)是我在 cmd.exe 窗口风暴中的灯塔。它本质上是 Windows 上的 bash,让您可以运行几乎所有可以在 *nix 上运行的脚本。这包括所有 gem 命令行可执行文件。

It gets weird in a few places.

在一些地方变得很奇怪。

  • File permissions - there just isn't a great way to map between Windows ACLs and POSIX file permissions. The Cygwin people have devoted years to solving it, but it still doesn't work all the time. git bash's approach is to just not do anything when asked to do a (for example) FileUtils.chmod. That means you may need to create a few more directories by hand, and you do need to be very aware of when something is changing file permissions.
  • 文件权限 - 在 Windows ACL 和 POSIX 文件权限之间进行映射并不是一个好方法。Cygwin 的人已经投入了数年时间来解决它,但它仍然无法始终奏效。git bash 的方法是在被要求执行 (例如) 时不做任何事情FileUtils.chmod。这意味着您可能需要手动创建更多目录,并且您确实需要非常了解何时更改文件权限。

For example, when I installed the Heroku gem on Windows, it tried to set the permissions of my Heroku credentials file, which has my Heroku password in plaintext, to u+r go-rwx. You'd definitely want to change the ACLs on that file if you're on a shared machine.

例如,当我在 Windows 上安装 Heroku gem 时,它试图将我的 Heroku 凭据文件的权限设置为u+r go-rwx. 如果您在共享机器上,您肯定希望更改该文件上的 ACL。

  • Scripts vs. .bat files - I wanted to change git's default editor from vi to SCiTE (not that I don't like vi; this was for a new-user workshop and I didn't want to explain editing modes). I had to create a .bat file that was actually a shell script. See the full explanation here:
  • 脚本与 .bat 文件 - 我想将 git 的默认编辑器从 vi 更改为 SCiTE(并不是我不喜欢 vi;这是为新用户研讨会准备的,我不想解释编辑模式)。我必须创建一个 .bat 文件,它实际上是一个 shell 脚本。请参阅此处的完整说明:

How can I set up an editor to work with Git on Windows

如何设置编辑器以在 Windows 上使用 Git

回答by Sarah Mei

Maybe bring a LiveCD to work with you every morning..

也许每天早上带一张 LiveCD 与您一起工作。

you can even put it on a usb flash drive, if you use a small enough distro/big enough drive...

如果您使用足够小的发行版/足够大的驱动器,您甚至可以将它放在 USB 闪存驱动器上...

回答by rajesh pillai

I am using Netbeans, which is a good overall editor (at least for me).

我正在使用 Netbeans,这是一个很好的整体编辑器(至少对我而言)。

For simple projects I use JEdit.

对于简单的项目,我使用 JEdit。

You can find the link at NetBeans IDE

您可以在NetBeans IDE 中找到该链接

You can find JEdit at JEdit

你可以在JEdi​​t找到JEdi​​t

回答by Sinan ünür

git is available on Windows: http://code.google.com/p/msysgit/or http://kerneltrap.org/Linux/Git_on_Windows

git 在 Windows 上可用:http: //code.google.com/p/msysgit/http://kerneltrap.org/Linux/Git_on_Windows

Basically, you need to decide whether you are going to go the Cygwinroute or the MingWroute. Both will provide you with Bash as well.

基本上,您需要决定是走Cygwin路线还是MingW路线。两者都将为您提供 Bash。

GVimworks great. I use the native port rather than the Cygwin version.

GVim很好用。我使用本地端口而不是 Cygwin 版本。

回答by Kev

If your development life is switching to Windows then you may want your employer to invest in this:

如果您的开发生涯正在转向 Windows,那么您可能希望您的雇主在以下方面进行投资:

Ruby In Steel by SapphireSteel Software

SapphireSteel Software 的 Ruby In Steel

I've used it in the past when I started tinkering with Ruby on Rails, quite nice and reasonably mature now. Also it's built on Visual Studio which I still think is one of the premier development environments around.

我过去在开始修补 Ruby on Rails 时使用过它,现在非常好且相当成熟。此外,它建立在 Visual Studio 之上,我仍然认为它是主要的开发环境之一。

回答by Barry Gallagher

The two best RoR IDE's I've used are NetBeansand Aptana Studio. However, for the most part I stick with Notepad++and its various plugins (Explorerand HTML tagsbeing two important ones).

我使用过的两个最好的 RoR IDE 是NetBeansAptana Studio。但是,在大多数情况下,我坚持使用Notepad++及其各种插件(ExplorerHTML 标签是两个重要的插件)。

回答by buddy

Cygwin as command line tool

Cygwin 作为命令行工具