Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a Ruby development environment [closed]

I am currently trying to set up a development environment for learning Ruby. The environment will primarily be for getting to grips with the language, but I will most probably move on to development with Rails after long. With web development a target, I would like to hear about preferred web servers and databases.

I plan on setting up the environment on a virtual machine, so I'm not worried about trashing the thing. Therefore, I am open to using a Linux distribution, OSX or Windows as the operating system.

I'm moving from C#, so I'd like to be forced into the Ruby way of thinking to a certain extent. Obviously, that's easier said than done.

  • What OS do most Ruby developers use?
  • What is the easiest IDE to get to grips with coming from a background of using Visual Studio?
  • Which database is used most within the Ruby community?
  • Which database is most likely to be supported by most web hosts?
  • Which web server is the easiest to configure? To get up and running in the shortest amount of time.

Hopefully I have provided all the information needed and hopefully this will aid others in setting up their own environments.

Thanks

Edit:

Thanks guys. Some really good suggestions so far, all of which I'll take on board. I'm currently wading through the copious articles surrounding initial RoR setup on Linux, as I like to understand how things work and are tied together. Also, because it's all free...

I'm currently putting together a virtual machine (so I can break stuff) using:

  • Ubuntu
  • SQLite
  • No webserver, I plan on using whatever development server comes with Rails out of the box, initially
  • Redcar Editor

Edit 2

I have setup a couple of environments now.

I have the ubuntu setup running in a Virtual Machine on Windows and decided to try decking my Mac out for ruby development too.

Overall, I'd have to say setup for the mac was a lot less painful than the linux setup. On the mac I'm running with:

  • SQLite that comes with OSX out of the box(!)
  • TextMate (trial version, but loving it)
  • Mongrel web server

I've progressed from learning the ways of Ruby to writing some simple websites with Rails and am finding development with Rails really simple to use. I have also set up a GIT repository on my working directory and am currently trying out Heroku.

Thanks for the help, everyone.

If anyone would like any more information about setting up on either environment, I'd be happy to provide more detail.

like image 754
fletcher Avatar asked Aug 06 '10 07:08

fletcher


People also ask

Do I need DevKit for Ruby?

Ruby is the programming language that Jekyll is written in. You'll need to install Ruby and the corresponding DevKit, which is needed to build some of Jekyll's dependencies as “native extensions”.

Can you develop Ruby on Windows?

Windows. If your machine does not have Ruby, install it. For new ruby users, we recommend you use Ruby 2.2. X installers, which provide a stable language and an extensive list of packages (gems) that are compatible and updated.

Does Ruby have virtual environments?

Inspired by Python's virtualenv project, Ruby-Virtualenv is a utility to create sandboxed Ruby/Rubygems environments. It is meant to address the following issues: Conflicts with unspecified gem dependency versions.

Do I need Xcode to install Ruby?

You won't need Xcode to write Ruby programs, but Ruby and some of its components will rely on Xcode's Command Line Tools package. Execute this command in the Terminal to download and install these components: xcode-select --install.


2 Answers

What OS do most Ruby developers use?

Mac OS for most, but any Linux distro will do (Ubuntu/Fedora etc).

What is the easiest IDE to get to grips with coming from a background of using Visual Studio?

Textmate is quite popular if you're on Mac. Netbeans and Aptana are there if you need something similar to enterprise world. Emacs/Vim is ok too.

Which database is used most within the Ruby community?

So far most Ruby / RoR guys I know use open source databases. sqlite for local development while Mysql or Postgresql for production. My advice, sqlite is easy to learn, while give a try with Mysql or Postgresql, you might not know when your clients going to ask you to develop on them. Mysql is very popular. Postgresql I think has lot more features (personal preference).

Which database is most likely to be supported by most web hosts?

Mysql is most supported by shared hosting hence the M in LAMP (Linux/Apache/Mysql/Php). But Postgresql is getting more support too. Some hosting companies even support both but Rails developers usually prefer to use VPS (slicehost.com/linode.com) and manage all these themselves. Checkout heroku.com too for deploying your Rails app without needing much knowledge in sys admin stuffs.

Which web server is the easiest to configure? To get up and running in the shortest amount of time.

Developing with Rails you'll get webrick as a development server where you can test ur app locally. But for production I prefer modrails.com where you can choose between apache/nginx. I prefer to use apache since that is what I'm used to.

like image 80
edthix Avatar answered Oct 22 '22 04:10

edthix


You'll want to look at RVM from the start, this takes away a lot of the pain of managing Ruby versions and gems.

Judging from the laptops I saw at Railsconf last June, Rails developers are about 90% OSX, 9.9% Linux, and there's like 1 or 2 guys on Windows.

Personally I use Textmate when I'm at home on OSX and gedit and redcar when I'm at work on Ubuntu Linux. I use sqlite for development mainly with mysql in production, but mongodb seems to be the new hotness, but I haven't done much more than some sample apps with it so I can learn it.

Virtual hosting providers will probably give you a choice of whatever database you want. Heroku is awesome and is used for deploying Rails applications via git, and uses postgres but has plugins to use mongodb if you want to go that way.

For what the community at large is doing, check out Thoughbot's survey results at: http://robots.thoughtbot.com/post/308239139/2009-ruby-survey-results

like image 24
Dan McNevin Avatar answered Oct 22 '22 05:10

Dan McNevin