Ruby on Rails在windows上的开发。

时间:2021-06-15 23:33:09

I've been planning on developing a rails project on windows. I've heard that the framework wasn't tested on windows (at least not the testing framework)

我一直计划在windows上开发一个rails项目。我听说这个框架没有在windows上进行测试(至少没有在测试框架上)

does anyone have any real experience with rails on windows? are there any known bugs when running on windows? does the testing framework work on windows?

有人对windows上的rails有真正的经验吗?在windows上运行时,是否存在已知的bug ?测试框架在windows上工作吗?

6 个解决方案

#1


9  

I've been developing a Rails website on Windows & Mac (depending on where I am at the time) for a few months now and, in general, I haven't run into to many problems. Here's what I know:

我已经在Windows和Mac上开发了一个Rails网站(取决于我当时的位置)几个月了,总的来说,我还没有遇到很多问题。这是我所知道的:

The new Ruby 1.9.3 installer for Windows is nice because it comes with RubyGems (which a vague memory tells me was difficult before). That's what I'm using. I haven't been able to get the ruby-debug19 gem to install correctly on windows. So, I just comment that out in my Gemfile on my Windows computer. Other than that, I haven't had any issues.

Windows的新Ruby 1.9.3安装程序很不错,因为它附带了RubyGems(一种模糊的记忆告诉我以前很难)。这就是我使用。我还没能让ruby-debug - g19 gem在windows上正确安装。我在Windows电脑上的Gemfile中注释了这个。除此之外,我没有任何问题。

With that said, however, I love developing on my Mac so much more than I do on Windows. I haven't found an editor that I love for Rails development on Windows (currently using Sublime 2 or Notepad++ with Explorer plugin), using Git is not as nice on Windows, and I just really don't like the Windows Command Prompt (I know there are other options, but still).

话虽如此,我更喜欢在Mac上开发,而不是Windows上。我还没有找到一个我喜欢在Windows上开发Rails的编辑器(目前使用的是Sublime 2或Notepad++和Explorer插件),在Windows上使用Git并不是很好,我只是不喜欢Windows命令提示符(我知道还有其他选项,但仍然)。

#2


6  

I have recently been working with another developer that has been developing on his Windows laptop. He's been using the same tools and Rails 3 codebase as myself (I'm on Mac OS X).

我最近一直在与另一位开发人员合作,他一直在开发Windows笔记本电脑。他一直使用相同的工具和Rails 3代码库(我在Mac OS X上)。

He has had a number of blocking issues that have wasted many hours of his time - for example he hasn't been able to run any of our RSpec tests, and some Rake tasks.

他遇到了许多阻塞问题,这些问题浪费了他很多时间——例如,他不能运行我们的任何RSpec测试,以及一些Rake任务。

Getting the environment setup is a pain, and even when you do, it's stressful because you never know when you are going to hit the next bizarro Windows-only bug. The reality is that Windows is a rare OS among Rubyists, and even if that wasn't so, the Rails framework developers themselves are UNIX-oriented, so there is an order of magnitude less scrutiny given to testing and development on the platform.

设置环境是一件痛苦的事情,即使你这么做了,你也会感到压力,因为你永远不知道什么时候你会遇到下一个只安装了奇怪窗口的bug。实际上,Windows是Rubyists中的一个操作系统,即使不是这样,Rails框架开发人员本身也是面向unix的,所以在平台上的测试和开发上的审查要少得多。

What's more, many of the sweet tools in the Ruby world are command-line and they work better in a real POSIX shell.

此外,Ruby世界中许多甜美的工具都是命令行工具,它们在真正的POSIX shell中工作得更好。

My co-worker has now bought a MacBook, and is enjoying a smoother development experience again.

我的同事现在买了一台MacBook,现在又享受到了更流畅的开发体验。

But you don't need to buy a Mac; You would do just as well with dual-booting into Ubuntu (Or similar) on your existing laptop.

但你不需要买Mac;在你现有的笔记本电脑上,你也可以在Ubuntu(或类似的)上进行双引导。

#3


1  

I prefer developing Rails with the help of Vagrant and some Chef cookbooks to create a virtual machine where I run my Rails code on. This solves the problem with some gems not working on Windows and seems to be faster. Here's a post a wrote how I got this working

我更喜欢在Vagrant和一些Chef cookbooks的帮助下开发Rails,以创建一个可以运行Rails代码的虚拟机。这解决了一些宝石不能在Windows上工作的问题,而且似乎更快。这里有一篇文章a写的是我是如何做到这一点的

#4


0  

I have been developing on Windows using Ruby (currently 1.9.2), Rails (both 2.3.x and 3), Rspec (1.3 and 2), Cucumber, Capybara, selenium-webdriver, sqlite3 for a few years now, and it all works most of the time. The company I work for deploys a Rails app on Linux and Windows along with our other piece of enterprise software.

我一直在Windows上使用Ruby(目前是1.9.2)、Rails(都是2.3)进行开发。x和3),Rspec(1.3和2),Cucumber, Capybara, selenium-webdriver, sqlite3已经有好几年了,大多数时候都是这样。我工作的公司在Linux和Windows上部署了一个Rails应用程序,以及我们的另一个企业软件。

That being said, I do run into weird issues a lot. I'm now trying to blog about them so that they're googlable and, eventually, I'm trying to learn how to fix them. Ruby Windows support has improvements to be made, for sure, but no one will bother fixing them if no one is using Ruby on Windows!

话虽如此,我确实遇到过很多奇怪的问题。我现在正试图写博客来讨论这些问题,这样它们就可以用谷歌搜索到,最终,我还在努力学习如何解决这些问题。当然,Ruby Windows支持还需要改进,但是如果没有人在Windows上使用Ruby,没有人会去修复它们!

Definitely use the RubyInstaller. Luis Lavena, one of the main contributors, is really nice and responsive on the RubyInstaller mailing list and twitter.

当然使用RubyInstaller这些年。Luis Lavena是主要的贡献者之一,他在RubyInstaller邮件列表和twitter上表现得非常好,反应迅速。

#5


0  

I would not use Ruby on Rails on Windows for a production website, but it is commonly used for development, in particular by designers that need to work with RoR teams. We developed and use internally with our designer guy Rubystack, which is a free, all-in-one installer that setups a Rails development environment in just a few minutes.

我不会在生产网站的Windows上使用Ruby on Rails,但它通常用于开发,特别是需要与RoR团队合作的设计师。我们在内部开发并使用了我们的设计师guy Rubystack,它是一个免费的、全能的安装程序,在短短几分钟内就能安装Rails开发环境。

#6


0  

I've tried 5 different ways to setup Rails development environment on Windows.

我尝试了5种不同的方法来在Windows上设置Rails开发环境。

These includes virtualized Linux environments, Windows subsystem for Linux and alternative Ruby interpreter like JRuby. Rails on Ruby MRI works relatively well, but certainly there are gems that build native extensions that cannot be compiled on Windows. Depending on which gems your project requires, you might have a easier time.

其中包括虚拟化的Linux环境、Linux的Windows子系统和JRuby之类的替代Ruby解释器。Ruby MRI上的Rails运行得相对较好,但是肯定有一些gem构建了不能在Windows上编译的本地扩展。根据项目需要的宝石,您可能会有更轻松的时间。

I've got a short comparative write up here http://cs.mcgill.ca/~mxia3/2018/02/18/Five-different-Rails-development-environment-on-Windows-10-and-their-pros-and-cons/

我在这里有一个简短的比较文章http://cs.mcgill.ca/~mxia3/2018/02/18/五种不同的rails -development-environment- windows -10及其pro&cons /

#1


9  

I've been developing a Rails website on Windows & Mac (depending on where I am at the time) for a few months now and, in general, I haven't run into to many problems. Here's what I know:

我已经在Windows和Mac上开发了一个Rails网站(取决于我当时的位置)几个月了,总的来说,我还没有遇到很多问题。这是我所知道的:

The new Ruby 1.9.3 installer for Windows is nice because it comes with RubyGems (which a vague memory tells me was difficult before). That's what I'm using. I haven't been able to get the ruby-debug19 gem to install correctly on windows. So, I just comment that out in my Gemfile on my Windows computer. Other than that, I haven't had any issues.

Windows的新Ruby 1.9.3安装程序很不错,因为它附带了RubyGems(一种模糊的记忆告诉我以前很难)。这就是我使用。我还没能让ruby-debug - g19 gem在windows上正确安装。我在Windows电脑上的Gemfile中注释了这个。除此之外,我没有任何问题。

With that said, however, I love developing on my Mac so much more than I do on Windows. I haven't found an editor that I love for Rails development on Windows (currently using Sublime 2 or Notepad++ with Explorer plugin), using Git is not as nice on Windows, and I just really don't like the Windows Command Prompt (I know there are other options, but still).

话虽如此,我更喜欢在Mac上开发,而不是Windows上。我还没有找到一个我喜欢在Windows上开发Rails的编辑器(目前使用的是Sublime 2或Notepad++和Explorer插件),在Windows上使用Git并不是很好,我只是不喜欢Windows命令提示符(我知道还有其他选项,但仍然)。

#2


6  

I have recently been working with another developer that has been developing on his Windows laptop. He's been using the same tools and Rails 3 codebase as myself (I'm on Mac OS X).

我最近一直在与另一位开发人员合作,他一直在开发Windows笔记本电脑。他一直使用相同的工具和Rails 3代码库(我在Mac OS X上)。

He has had a number of blocking issues that have wasted many hours of his time - for example he hasn't been able to run any of our RSpec tests, and some Rake tasks.

他遇到了许多阻塞问题,这些问题浪费了他很多时间——例如,他不能运行我们的任何RSpec测试,以及一些Rake任务。

Getting the environment setup is a pain, and even when you do, it's stressful because you never know when you are going to hit the next bizarro Windows-only bug. The reality is that Windows is a rare OS among Rubyists, and even if that wasn't so, the Rails framework developers themselves are UNIX-oriented, so there is an order of magnitude less scrutiny given to testing and development on the platform.

设置环境是一件痛苦的事情,即使你这么做了,你也会感到压力,因为你永远不知道什么时候你会遇到下一个只安装了奇怪窗口的bug。实际上,Windows是Rubyists中的一个操作系统,即使不是这样,Rails框架开发人员本身也是面向unix的,所以在平台上的测试和开发上的审查要少得多。

What's more, many of the sweet tools in the Ruby world are command-line and they work better in a real POSIX shell.

此外,Ruby世界中许多甜美的工具都是命令行工具,它们在真正的POSIX shell中工作得更好。

My co-worker has now bought a MacBook, and is enjoying a smoother development experience again.

我的同事现在买了一台MacBook,现在又享受到了更流畅的开发体验。

But you don't need to buy a Mac; You would do just as well with dual-booting into Ubuntu (Or similar) on your existing laptop.

但你不需要买Mac;在你现有的笔记本电脑上,你也可以在Ubuntu(或类似的)上进行双引导。

#3


1  

I prefer developing Rails with the help of Vagrant and some Chef cookbooks to create a virtual machine where I run my Rails code on. This solves the problem with some gems not working on Windows and seems to be faster. Here's a post a wrote how I got this working

我更喜欢在Vagrant和一些Chef cookbooks的帮助下开发Rails,以创建一个可以运行Rails代码的虚拟机。这解决了一些宝石不能在Windows上工作的问题,而且似乎更快。这里有一篇文章a写的是我是如何做到这一点的

#4


0  

I have been developing on Windows using Ruby (currently 1.9.2), Rails (both 2.3.x and 3), Rspec (1.3 and 2), Cucumber, Capybara, selenium-webdriver, sqlite3 for a few years now, and it all works most of the time. The company I work for deploys a Rails app on Linux and Windows along with our other piece of enterprise software.

我一直在Windows上使用Ruby(目前是1.9.2)、Rails(都是2.3)进行开发。x和3),Rspec(1.3和2),Cucumber, Capybara, selenium-webdriver, sqlite3已经有好几年了,大多数时候都是这样。我工作的公司在Linux和Windows上部署了一个Rails应用程序,以及我们的另一个企业软件。

That being said, I do run into weird issues a lot. I'm now trying to blog about them so that they're googlable and, eventually, I'm trying to learn how to fix them. Ruby Windows support has improvements to be made, for sure, but no one will bother fixing them if no one is using Ruby on Windows!

话虽如此,我确实遇到过很多奇怪的问题。我现在正试图写博客来讨论这些问题,这样它们就可以用谷歌搜索到,最终,我还在努力学习如何解决这些问题。当然,Ruby Windows支持还需要改进,但是如果没有人在Windows上使用Ruby,没有人会去修复它们!

Definitely use the RubyInstaller. Luis Lavena, one of the main contributors, is really nice and responsive on the RubyInstaller mailing list and twitter.

当然使用RubyInstaller这些年。Luis Lavena是主要的贡献者之一,他在RubyInstaller邮件列表和twitter上表现得非常好,反应迅速。

#5


0  

I would not use Ruby on Rails on Windows for a production website, but it is commonly used for development, in particular by designers that need to work with RoR teams. We developed and use internally with our designer guy Rubystack, which is a free, all-in-one installer that setups a Rails development environment in just a few minutes.

我不会在生产网站的Windows上使用Ruby on Rails,但它通常用于开发,特别是需要与RoR团队合作的设计师。我们在内部开发并使用了我们的设计师guy Rubystack,它是一个免费的、全能的安装程序,在短短几分钟内就能安装Rails开发环境。

#6


0  

I've tried 5 different ways to setup Rails development environment on Windows.

我尝试了5种不同的方法来在Windows上设置Rails开发环境。

These includes virtualized Linux environments, Windows subsystem for Linux and alternative Ruby interpreter like JRuby. Rails on Ruby MRI works relatively well, but certainly there are gems that build native extensions that cannot be compiled on Windows. Depending on which gems your project requires, you might have a easier time.

其中包括虚拟化的Linux环境、Linux的Windows子系统和JRuby之类的替代Ruby解释器。Ruby MRI上的Rails运行得相对较好,但是肯定有一些gem构建了不能在Windows上编译的本地扩展。根据项目需要的宝石,您可能会有更轻松的时间。

I've got a short comparative write up here http://cs.mcgill.ca/~mxia3/2018/02/18/Five-different-Rails-development-environment-on-Windows-10-and-their-pros-and-cons/

我在这里有一个简短的比较文章http://cs.mcgill.ca/~mxia3/2018/02/18/五种不同的rails -development-environment- windows -10及其pro&cons /