Testing your Ruby App in the cloud using a Cloud IDE
Why run your ruby code in the cloud?
Running code in the cloud and seeing the results is useful for a number of reasons.
1. Collaboration. You can edit code and have someone else review and update it and teams can work on the same project in real time.
2. Less clutter on your local machine. You can keep your local machine free of projects, and even free of programming languages using cloud IDEs. If you have a Chromebook or tablet you can still code by using the cloud.
3. Testing. If you’re afraid you might break something on the local machine then just try it out in the cloud. No matter what happens you can just start from scratch. No harm done.
I’ve only looked at IDEs that allow you to run the code as an app in a browser, rather than a purely development only IDE. I’ve also focused on services with free options. As beginners, we’re more interested in testing and learning than paying a monthly fee for storage space or multiple apps.
This is one I hadn’t heard of before but I’m impressed by the list of languages and OSes to choose from.
The default interface is plain (white text on black background) but I like the fact that it’s easy to read and it’s fast to navigate.
It was easy to start a new rails app and run the server, just as I would on a local machine.
At this point, I had to alter an unwieldy URL to include port 3000 so that I could view the app in a browser. In the end, it’s a minor inconvenience.
Getting a Rails framework setup is as simple as selecting the Rails container (on CentOS or Ubuntu).
For plain Ruby I think the only way is to setup a blank container (which runs on CentOS by default) and install Ruby from the command line: sudo yum install ruby.
Then install Ruby gems: sudo yum install rubygems
And you can run the interactive Ruby console: irb
For beginners, Codeanywhere provides you with everything you’d need to test your code in the cloud.
This is probably the cloud IDE that I’ve used most. Cloud9 employs a really simple interface for setting up Workspaces (or containers for your coding language). Everything is laid out neatly and clearly. The site offers the following many templates such as Custom, Node.js, Ruby, Ruby on Rails Tutorial, and even WordPress to get you started.
Selecting a workspace and then giving it a name will bring you to the loading screen, which can take some time to complete. Once the loading screen disappears you can access the IDE. The Custom template already includes Ruby while the Ruby on Rails app is simple to setup.
There’s a good community built into the website and the documentation is extensive.
Cloud9 offers apparently unlimited free public workspaces (sort of like the GitHub model). The Individual plan is $19/month for unlimited private workspaces and better performance.
The very slow loading time for the free workspace is a bit annoying but once connected it’s a fast user experience.
I really like the interface on Cloud9 and it’s designed to be versatile and efficient.
Not the nicest landing page, and not the easiest product offering to navigate. After about 5 minutes I figured out where the free developer option was hiding. After logging in via my Github account I was then presented with a Profile form to complete. Guys, you’re not making this easy! Fortunately, the only required field was my name. I bypassed the optional credit card form, and finally, I was able to create a project.
I selected Ruby and after several more clicks the project was prepared and loaded.
Now I’m not an intuitive coder so I don’t know what I am supposed to see but once the project loaded I’m presented with an almost blank screen. Maybe if you’re an experienced developer it’s clear what’s going on. At this stage, having tested the other IDEs and seen how easy they are to use it would be easy to lose patience with Codenvy.
Rather unintuitively, under the ‘Runners’ tab at the bottom of the page there’s a console option. I tried using this but got an ‘activated once a run is started’. What does that mean? I tried running my ‘app’ and got the ‘runner not specified’ message. OK time to check the help. Under Help we have the option to ‘Find action’. I have no idea what this is so let’s check the help. The documentation is good, or at least there’s lots of it. I searched for Runner and this just brought me to the introduction. I think what they are telling me is to read the entire manual. I attempted to read some chapters and then decided that this is too difficult. Their nice looking blog has a 7 step approach to learning the software but contains headings such as ‘Running with a Different Runner’.
Koding’s approach to logging in is unique in that it asks you for a team name and email address. The team name is due to the collaboration type environment that Koding is trying to promote. Koding for teams is the motto.
I used RubyBeginner.koding.com as the URL for accessing my ‘team’ account.
The interface is slick and easy to understand. You’re first presented with options to configure a stack for use among your team, Slack for collaboration, and a command line program for use with a local IDE.
I tried skipping these by ended up stuck. Unable to configure a stack due to lack of options and guidance.
I returned to the main URL and tried again. This time, under Stacks I was presented with some options for configuring my cloud provider. Koding works differently to Cloud9 and CodeAnwhere in that you need to set up an Amazon Web Services account to use the cloud IDE. This isn’t too complicated, although personally I find Amazon’s Web Services to be purposely obscure and designed to lure you into spending money with them on a monthly basis, whether you want that or not.
So after about 5 minutes I was able to get into the IDE and start playing around.
To use Rails I had to run the ruby apt-get install ruby-railties-4.0 package, but at least the IDE told me this. On first try this failed due to some internal error. I tried reinstalling ruby, then an older version of rails with the —fix-missing parameter but this also failed.
Searching on the internet for help on this I saw that many other people had the same issue. Solutions hinted at editing files in the /etc folder. I’m fairly competent on Linux but this is a beginner blog and I am really looking for the simplest ways of coding in the cloud. Reconfiguring a Linux server is not what this evaluation is about.
Koding’s interface is very nice and it’s probably a great piece of software. Maybe they don’t want hobbyists and beginners using the IDE. I’ll leave this one for another day.
Nitrous.io is a cloud IDE that I rarely see mentioned and I’m not sure why that it is as it’s a fully featured IDE with a slick interface. There is a 50 hour limit per month for coding on the free plan (this may be the reason it’s not included on lists) but for hobbyists and beginners this will probably be enough. The basic plan is $19/month and allows multiple projects. Nitrous offers Ruby and Ruby on Rails projects. Out of all of the IDEs the speed, typography, and overall look of Nitrous would win my votes.
There are other cloud IDEs but many don’t support Ruby. The website URLs and branding seem to change often, and in this highly competitive market there’s a high attrition rate with new offerings. Considering we want to keep things free these are my recommendations:
If you want a really good looking IDE, don’t plan to spend more than 50 hours a month on one project at a time then go for nitrous.io
For an overall easy to use experience with nice interface recommend Cloud9 or Codeanywhere.
If you have experience with any other IDEs please let me know. What’s your favorite and why?