Setting up Ruby on Rails development environment with NetBeans on Windows

I've set up NetBeans for Ruby on Rails with NetBeans twice today -- first at work for a friend who is moving to RoR development from PHP, and then at home where a dying hard disk forced me to get a new hard disk and install all the software I require all over again.

I realized that setting up a Rails environment might seem a daunting task for a newbie. Here's a list of steps to get Ruby on Rails working on a windows machine. I use NetBeans with MySQL because I found the least trouble to set up.

  1. Go to www.ruby-lang.org and download the ruby one-click installer for Windows.

  2. Install ruby using the one-click installer, and remember to select RubyGems when asked what components you want installed.

  3. Download and install MySQL from http://dev.mysql.com/downloads/.

  4. You will need java to run NetBeans, so download java from http://www.java.com/en/ and install.

  5. Download the latest version (6.7 at the moment) of NetBeans from http://www.netbeans.org/. You might choose the complete NetBeans package or the Ruby only version. Either of them will do.

  6. Install rails for your ruby installation by using this command in the command line:

    gem install rails

  7. You will also need the ruby MySQL driver to be installed to be able to use MySQL databases. For this, install the mysql gem by this command:

    gem install mysql

  8. When I started NetBeans and created a new rails project, NetBeans asked me to update ruby gems from 1.3.1 to 1.3.2. Unfortunately, the one click installer is available only for Ruby 1.8.6 and contains gem version 1.3.1, so you'll have to update rubygems using the command line:

    gem update --system


That's it... you can now use NetBeans as a rails development environment. I know that was a very long list of steps to get a rails IDE working, but it's worth the trouble. Using ruby on rails as your development environment will make up for the effort required to set up the IDE.

What IDE do you use for rails development? When you were new to rails development, did you have trouble setting up a development environment? And in case you're a newbie rails developer, is that how you got here?
[Read more...]

First impressions: Ruby Encoder for ruby source code encryption

About a week ago at work, I was asked to evaluate Ruby Encoder, an application to encrypt the source code of your ruby application.

Normally, you wouldn't want to encrypt the source code of your ruby applications. The code resides on your server and there's no way anyone else can access it. However, if you are going to allow others to host your code on their own servers, you might want to obfuscate your code so that nobody can see it.

I signed up for the free trial of Ruby Encoder and so far I've been impressed with how easy it is to set it up for use with the ruby on rails application I'm working on. It took me less than ten minutes to encrypt all the ruby files and run the project on the development machine.

Ruby Encoder works by encrypting the ruby source into bytecode and then decrypts this encrypted code using a loader (which is an compiled ruby module) and sends it to the interpreter. This way, all anyone will get to see in your .rb files will be a lot of gibberish and a call to the loader function.

I haven't really had the time to check it out thoroughly and I don't know how well it will work in production, but right now it looks like the best option (and probably the only option?) for what I am trying to accomplish.

I was discussing Ruby Encoder with a friend and one very valid argument that came up was about how far such software could help if someone really wanted to clone our application. If someone wanted to steal our code, they most likely would be capable of coding the application by themselves by looking at the views of the application. So is it really worth the trouble to use an application like Ruby Encoder just to make things a little bit more difficult for them?

What do you think of ruby source code encryption? Have you ever used Ruby Encoder or similar products for any of your projects? If so, how well has it worked for you? Do you think using such an application is a good idea?

What method would you employ if you had to ensure that your ruby code remained closed source?
[Read more...]