Getting Aptana Studio 3 working with GitHub on your Windows PC

While setting up my laptop to do development work on I came to the realization that I’ve always gotten my IDE running using a patchwork quilt of websites, each providing small but crucial tips on getting a Rails dev environment with GitHub integration working smoothly under Windows. Here’s my attempt to put all those tips in an ordered list for others to benefit from.inflatables for sale in canada

This guide assumes you’ve already created yourself a GitHub account, so if you haven’t gotten to that yet, head on over and spend the two minutes it takes to register and verify an account.

  1. The first thing we need is the Ruby binaries compiled to run on Windows operating systems. That means heading over to the RubyInstaller for Windows and downloading the latest Ruby package. I went with Ruby 1.9.2-p0:
  2. After the download was complete, run the executable to install Ruby. I made sure to click the checkbox that added the Ruby binaries to my path so Windows could access them as needed.
  3. That’s it for Ruby itself – now let’s get the Rails 3 framework downloaded and installed. This too is amazingly simple. Having installed Ruby to the default location of C:\Ruby192\ , I next opened a Command Prompt and navigated to C:\Ruby192\bin\ . There I executed the command:
    gem install rails
  4. Some time later, that will complete. Next up is the installation of the SQLite3 gem, which allows us to make use of an extremely lightweight and free relational database with our Ruby applications. Install the SQLite gem by running the following command:
    gem install sqlite3-ruby
  5. The previous command will have given you a warning which in part reads, “You can put the sqlite3.dll available in this package in your Ruby bin directory, for example C:\Ruby\bin”. To accomplish this, click over to the SQLite Download Page and download the DLL of the SQLite library: At the time of writing, that was sqlitedll-3_6_23_1.zip. Unzip the file and place the sqlite3.dll file contained within inside your Ruby binaries directory (again in our example at C:\Ruby192\bin\ ).
  6. Next we introduce our Ruby on Rails IDE of choice, Aptana Studio 3. While Studio 3 is technically still in beta, its feature set already boasts a built-in console, a smart file explorer and mandatory Git integration, which in mind cements it in place as the best Rails 3 development environment on the Windows family of OSes. Head over to the Download Aptana Studio 3.0.0 page, grab the standalone version, and install once that’s downloaded.
  7. Start up Aptana Studio 3. While the IDE comes with Git integration built in, to use GitHub we’ve got to install the add-on Eclipse EGit. Start this process by opening the Help menu and selecting Install New Software… Change the dropdown selector for Work with: to –All Available Sites– and type egit into the filter field to have Aptana search and retrieve add-ons listed by that name:
  8. Proceed through the various screens to install EGit. Once that’s done, choose to restart Aptana Studio 3 so it is given the chance to load the new add-on into memory.
  9. Time to create our first Rails project! Navigate to File > New > Ruby/Rails Project. Next, let’s give the new project an obvious name: My Test Project. Leave the rest of the properties as shown below (most importantly, leave Generate App set to Use the standard ‘rails’ generator) and click Finish:
  10. Since we’ve got a command line console ready and waiting for us, let’s make use of it. In order to upload and download files from GitHub securely we’ll have to create a public encryption key that GitHub knows about. Do this by generating a key using the ssh-keygen tool that came with our Ruby installation and specifying your own e-mail address, pressing Enter at each of the three following prompts to select the default behaviour:
  11. Navigate to the id_rsa.pub file generated and open the file in a text editor like Notepad. Copy the entire contents of the file to the clipboard and paste it into your GitHub account settings under SSH Public Keys > Add another public key > Key. Leave the Title blank and hit the Add key button.
  12. Now we need to create a new GitHub repository, naming it anything you want. On the next page, copy the SSH address for the repository and return to Aptana Studio 3.
  13. With that SSH address, it’s time to configure your test project to upload to GitHub. Start by viewing your project via Project Explorer. Next, right-click the entire project and select Team > Share Project…
  14. Select Git, not Aptana Git. (EGit is listed as Git, while Aptana Git is the default installation of the Git package that doesn’t work well with GitHub.)
  15. Select My Test Project from the list. If you can’t click the Finish button because it’s greyed out, first click the Create Repository button, and the Finish.
  16. Again viewing your project via Project Explorer, right-click the entire project and select Team > Push… Paste the SSH address into the URI field, which will automatically populate the rest of the fields. Click Next to continue.
  17. You’re now going to run into an error that reads “Auth fail”. This is expected – in the earlier step we generated a SSH key and placed it within a directory named \.ssh\ . However, EGit is looking for files within \ssh\ (which moments ago was also automatically created). A quick fix is implemented by copying the files id_rsa and id_rsa.pub to \ssh\ . Back in Aptana Studio, run File > Restart to restart the IDE.
  18. Return yet again to the project as viewed from the Project Explorer, and again right-click the entire project and select Team > Commit. Commit all of the files of the project (or just a few) so we’ve got something to push up to GitHub in the next step.
  19. Again we use the Project Explorer to right-click the entire project. Select Team > Push… Re-enter the SSH address and again click Next. The final dialog screen allows you to select which branch you want to push your commits under.

That’ll do it – the end of this series of steps leaves you with a Windows development environment for Rails 3 that can push and pull changes to GitHub.

References:

7 Comments

  1. BozoJoe

    hey thanks for posting this. Big struggle with eGit on windows and ssh+git, and nice to see a simple walk thru to make sure I wasn’t insane

  2. Ignant

    Thanks a lot for posting this. Wouldn’t have been able to figure this out without it. Although I am running into two problems.

    1) In Step 14 where do I select Git? When I select “Share Project” in the previous step I get the “Configure Git Repository” window and there is no option for Git or Aptana Git. This could be do to latest version of Aptana Studio 3 that I am running.

    2)In Step 16 the “Push” option under “Team” is grayed out for me. I haven’t been able to figure out what else I need to do. Let me know if you have any ideas.

    Thanks again for posting this.

  3. Ignant

    Well found out I had to select “add Remote” and enter in the ssh address there first before the “Push” option becomes selectable. Might want to update that step.

    Now I have another problem of the Studio hanging while attempting to push.

  4. Akaahn

    If you get “file ‘lib’ not found”
    run
    >gem install rdoc
    and the
    >gem install rails
    again

Leave a Reply

Your email address will not be published. Required fields are marked *