Limitations in running Ruby/Rails on windows

2020-01-24 06:02发布

In the installation documentation to RoR it mentions that there are many limitations to running Ruby on Rails on Windows, and in some cases, whole libraries do not work.

How bad are these limitations, should I always default to Linux to code / run RoR, and is Iron Ruby expected to fix these limitations or are they core to the OS itself?

EDIT Thanks for the answer around installation and running on Linux, but I am really trying to understand the limitations in functionality as referenced in the installation documentation, and non-working libraries - I am trying to find a link to the comment, but it was referenced in an installation read me when I installed the msi package I think

EDIT Thanks for the references to IronRuby lately, it is certainly a project to watch, and as it, obviously, is a .NET language, it will be invaluable if it lives up to the promises. Eventually, however, in my case, I just bit the bullet and installed an Ubuntu server.

<bias> I should've done it years ago </bias>

16条回答
Luminary・发光体
2楼-- · 2020-01-24 06:36

You could just use Cygwin and it's version of Ruby. That gets rid of the arguments about compiled gems not working on Windows - I've managed to compile a lot of gems that way.

查看更多
老娘就宠你
3楼-- · 2020-01-24 06:37

There is a packaged installer available at http://railsinstaller.org/ which is worth checking out.

查看更多
Fickle 薄情
4楼-- · 2020-01-24 06:37

When I last fiddled around with Rails on windows, I used Instant Rails and found it to be a fairly painful process, except for the lack of updates to Instant Rails (which, from the look of the website is still a little bit of a problem, as instant Rails 2.0 uses ROR 2.0, while the newest version is 2.1). You might also look into the answers to this question as it mentions a number of other ways to get RoR running on windows easily.

查看更多
闹够了就滚
5楼-- · 2020-01-24 06:37

You have windows options for getting everything up and installed, such as Instantrails:

However, my personal experience with trying to get colleagues up and running on windows is that it's a pretty painful experience. You should be able to get most (if not everything) running, but be prepared to spend a bit of time mucking round (and getting frustrated).

YMMV

I would probably recommend either Linux or Mac for rails development (but I'm slightly biased against windows, so you may need to take that with a grain of salt).

查看更多
虎瘦雄心在
6楼-- · 2020-01-24 06:39

Here's an overview of the current issues with Rails on Windows:

  • Ruby and Rails are slower on Windows than they are on Unix-like OS's.
  • A few gems and libraries don't work on Windows.
  • Some Unix-isms aren't available on Windows (examples).
  • The community is mostly on either Mac or Linux (This is a particularly hard one to deal with; nobody wants to be alone on one island when the rest of the tribe are partying, having fun and getting along great over on the other island. Community is important. It seems that most Windows developers that start with Rails quickly switch to a Mac or Linux. However, the small community of Windows Ruby users that do persist are extremely friendly, dedicated and knowledgeable - go say hi.)

Note much of the advice that follows is now outdated due to the magnificent efforts of the RubyInstaller team in bringing stability, compatibility and performance to Ruby on Windows. I no longer have to use VirtualBox, which says a lot about how far Ruby on Windows has come.

If you want more technical detail, the following are required reading. :

Choice quote from that last one is:

AkitaOnRails: The most obvious thing is that any Gem with C Extensions without proper binaries for Windows will fail. Trying to execute shell commands will fail and RubyInline as well. What else?

Luis Lavena: Hehe, that's just the tip of the iceberg

Having said all that, I don't find developing with Rails on Windows too painful. Using Ruby is, for the most part, a pleasure. I'd avoid InstantRails because, to be frank, it's just as easy to install Ruby properly using the one-click installer, then doing a gem install rails. If you need Apache and MySQL, WAMP is a good bet, although even these aren't required if you just stick with Mongrel and SQLite.

What I've taken to doing recently is running VirtualBox with an instance of Ubuntu Server that closely mirrors the deployment server. I map a network drive to the Ubuntu Server, then I edit and run my code directly on the VM. It uses hardly any memory (it's currently using ~43MB; contrast that with Firefox, which is using ~230MB) and Rails actually performs better than running it natively on Windows. Plus you can experiment with your virtual server in relative safety. It's a really nice setup, I highly recommend it.

Finally, here are a couple of Ruby/Rails blogs aimed at Windows users:

查看更多
唯我独甜
7楼-- · 2020-01-24 06:40

I found getting a development environment up and running with Instant Rails on Windows was really simple. Especially when using Netbeans or Radrails as the IDE.

Less than a 10 minute job.

What did those who struggled find to be the problem?

查看更多
登录 后发表回答