Ruby linux or windows

ruby development environment

is it better to develop ruby on rails in a) windows b) linux or c) mac. why ? edited : the reason why i am asking this is that i heard that developing ruby on rails in windows is not as stable/good compared when you used ruby on rails in mac. (not sure though if that is true or not). plus the fact that David Heinemeier Hansson (creator of Ruby on Rails) seems to be using Mac, so initial impressions seems to be Ruby on Rails applications and Mac goes well together.

I think it’s just a matter of preference and habit. If you used to be a windows-centric person and just getting started with RoR or whatever languages you’re interested, it is best to stick with old environment (that is windows). You’ll have less platform specific command to learn because you aren’t just dealing with the language itself but also with a new environment (OSs). The same goes for other platforms.

12 Answers 12

I strongly advise you don’t develop on Windows. Why? First, there are a lot of things that break on Windows with every upgrade and the majority of gem or plugin creators don’t use windows so they don’t care about windows and don’t run tests on it(there are several big name people who have flat out said that windows is NOT their problem it’s yours). You’ll find the *nix vs Windows problems will bite you in the ass again and again. Pathnames slashes, minor differences in ssh implementations, console and font problems, rubygems, capistrano, etc.

What will end up happening after a while is that you will always have this voice in the back of your head every time you have to debug something saying «Is this a problem only on Windows?» and that little voice is a cost to you..using up some of your battery every single day.

Macs are more expensive in terms of upfront dollars (which sadly I don’t have) and linux platforms are more expensive terms of spending a day or two trying to get your wireless to work but those are upfront one time costs. The nagging insecurity of using Windows for Rails development is an ongoing cost. At least until the community starts rejecting things that are not truly cross platform.

As an example look at cucumber. For some reason a test framework is dependent on a particular console configuration not available in windows. So to use it in Windows you have to change the font in your console and change the code page in your console. Otherwise the letter «a» disappears from all the output. Why? Because it works fine for *nix systems and gives you pretty colours (I think this is a huge flaw and very very poor design choice even if you ignore windows).

You’ll also feel like the guy who farted in the elevator every time you bring up a windows issue.

I say all this as some who has to use windows for his development platform at the moment. Hey, what’s that smell?

[late edit: Ruby is also about 3 times slower on windows. This will impact your willingness run your tests all the time and hurt your TDD feedback cycle]

Читайте также:  Astra linux мониторинг сети

Источник

is it ok to use windows platform to develop RUBY project ? or should i use Linux instead?

I am developing a website using RUBY ON RAILS ; JSON for communication API’s and MONGODB as the nosql database. So can i go ahead win windows platform or do i need to go with Linux ? If yes .. then which one ? Please suggest the best platform for my project.

Just for your information: Ruby is not an acronym. It’s simply the name of a precious gem. Rails isn’t an acronym either, and neither is MongoDB. (Well, the DB part is.)

4 Answers 4

I have developed with Rails on Windows, Mac and Linux so I think I have a pretty broad perspective on this.

Windows is doable; but the platform will fight you every step of the way. Linux and OSX are equivalent in terms of setting up a development environment, Linux is a bit easier to get started while OSX has an advantage of a better toolset. I prefer OSX, Linux and Windows in that order.

RVM alone is a pretty compelling reason to use a Unix-based OS.

@Matt apt is why I said Linux was easier to get started 🙂 Although homebrew isn’t that scary. I think I only needed it to install mysql and git.

@Matt RVM levels the playing field considerably between OSX and Linux when it comes to installing Ruby.

@Matt yeah, I think OSX has an overall better selection of good editors like Textmate, as well as things like Tower, Sequel or Mongohub.

You need to keep in mind that windows will always be a second class citizen in the ruby (and most of open source) world. It stems from a few things, first is the lack of fork on windows, and the fundamental role it plays in unix apps. Because of that, most of the good app servers don’t work at all on windows (passenger/nginx, unicorn, thin, etc). Second big issue is that ruby gems may rely on c libraries that are un available, or difficult to install on windows. Lastly, due to the lack of rubyists using windows, pretty much everything is not terribly well tested on the platform.

As a general rule of thumb, windows is great for windows development, anything else you should be using linux or osx. Some platforms have better support for it then others, but across the board, things will be done for unix first with windows as an afterthought.

However, you may have a bit of trouble. Most of the documentation out there assumes a Unix (Mac OS X, Linux, etc.) system, so you’ll have to translate instructions (compilation, paths, etc.).

You should run the same OS on your development (i.e. testing by developers) server(s) as you run in production. Failing to do this will result in bugs which only occur in production.

However, you can run Windows if you like, simply run the target OS in a VM; you can still use a Windows editor etc, to edit the source code. You can use a Windows SCM system, a Windows-based bug tracking system etc, it doesn’t really matter.

Just run your test server on the right OS and it will all be fine.

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Читайте также:  What is secure shell in linux

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.17.43537

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Use windows or linux to start work with Ruby On Rails?

I’m new to Ruby On Rails and I want to know which is better to use for work with it. Windows or Linux. I’ve never worked with Linux before but I heard It’s better to work with it. Is it necessary for someone like me to install linux or I can use windows and the results will be same with linux?

5 Answers 5

If your current dev machine is running Windows, and you don’t have access to a Linux environment right now, don’t let that stop you from getting started with Rails. Definitely, definitely, definitely install the DevKit first thing (if it’s not included in RubyInstaller yet). See https://github.com/oneclick/rubyinstaller/wiki/Development-Kit for that.

If you get deep into Rails development, or even start doing it for a living, you will inevitably drift towards using Linux on your dev machine. The problem is not Rails, but the many binary gems which are difficult or impossible to install on Windows.

The most popular Ruby library for manipulating images (ie. generating thumbnails) is RMagick, but trying to install it on Windows is enough to make a strong man cry. Paperclip is very nice for dealing with images and other attachments, but it is also a problem. Then there is a popular JSON parsing library which is also problematic on Windows. Unicorn (a popular Rails server) won’t run at all on Windows, and Thin (my favorite) may also give you headaches. And so on, and so on.

You can get pretty far with Rails development on Windows these days, but at times you will find yourself having to test code on a remote server, rather than locally, and it can waste a lot of time.

+1 for actually listing gems which are problematic, not just saying Windows is terrible (as many are apt to say). One note though, I have been using Thin on Windows for over a year without any issues. Also, I would recommend using RailsInstaller, which includes DevKit and everything needed for Rails (and yes, RubyInstaller does not currently include DevKit).

@phoffer, that’s very good info: please add it to the answer if you like. I also use Thin on Windows, but at least a couple times, when installing on new dev machines, I’ve seen the dreaded mkmf.rb error message. The problem is installation, not running it once you have it set up right. @Dougui, there’s no purpose in pointing fingers; I’m just stating the facts as they are right now.

@WeaponX a lot of things changed since 2012. I think it’s easier now. I know you can install Ubuntu on Windows. Maybe it’s the simplest option.

Yes, this thread is an old thread but I am here to express how awfully you will encounter problems on windows platform while using Ruby on Rails. It may be ‘OK’ to build normal application however, as soon as you start scratching the surface of sqlite3 , ASCII Characters , Internationalisation for an application , . Your hair will start to fall off, I mean literally . Whereas if you stick with Mac or Linux (Ubuntu), You will feel invincible, take pride on projects, progress further without having to configure yourself manually with setting of (gems’) native extensions library and it is horrendous.

Читайте также:  Как линукс установить через флешку

In Summary, to make it work on windows is just nightmare. Whatever you have done it is entirely your decision. I hope everything is fine.

Linux, without hesitation. You will find a lot of problems if you want to develop on windows with ruby on rails. I already tried with windows, at my beginning, and it’s very difficult. Since I am with Linux, it works! It’s hard in the beginning but it’s very powerful.

  • Linux is very powerful;
  • The majority of the documentation is on a UNIX environment;
  • This requires less configuration;
  • You will have fewer bugs;
  • Every tools are optimized for UNIX systems;

Rails development has come a long way on a Windows machine. Though, I agree that when I learned Rails a couple years ago on Windows, I spent more time configuring than coding, currently it is a very smooth process from blank slate to fully running Rails environment.

. until you get deeper into Rails development and start using gems from different sources. Then you discover the hell-on-earth which is otherwise known as «installing RMagick on Windows». Then you spend nights of agony and tears trying to install eventmachine . Then you want to try Unicorn, but discover it is UNIX-only. Then.

. Big sigh. I hate to say it, but it’s things like RMagick which give open source a bad name. You wouldn’t believe some of the crazy bugs I have had to track down in applications using RMagick.

It mostly depends on how comfortable you are in each environment. I have been developing on both Windows and Linux for 4 years (because I can’t afford a Mac) and I have found Windows to be the easiest in setup, as of late. Engineyard has released an installer for Windows that is an all in one for Ruby, Rails, Git, Bundler, SQLite, and DevKit among others.

Windows users are used to simple installers such as that Engineyard provides so if this sounds more like what you are used to, go with that.

Linux provides much more support online for installing Ruby on Rails. There are minor differences with each distro of linux for installing it so I can’t provide you with any links. You will also be able to find separate tutorials for installing Git, SQLite, and DevKit.

If you are much more comfortable working in the terminal, than I would suggest taking the plunge into Linux development. It can take a little longer to set up than Windows but you will find it much more command line friendly (and fulfilling).

After you set up Rails, the differences diminish quickly. Development will depend more on what IDE or text editor you are using. Most provide both Linux and Windows versions.

If your focus will be mostly server-side programming then Linux would be the best to look into. If you are working more on client-side, then I would suggest Windows (or MacOS).

My best possible suggestion would be to download VirtualBox, or some other VM, and try Linux. It is free and will only take up a day or so of your time to install and mess around in. If you don’t like it, go back to Windows.

(I personally use a combination of both thanks to the miracle that is Bundler)

Источник

Оцените статью
Adblock
detector