Developing Expertiza on the VCL
Introduction
It can be tricky and time consuming to set up a Ruby on Rails environment for developing Expertiza. We created a Ruby on Rails VCL image to provide NC State students with a development environment and minimize setup time.
Connecting
Goal: Use VNC to connect to the graphical VCL (Virtual Computing Lab) environment to use RadRails.
- Visit http://vcl.ncsu.edu/ > Make a Reservation
- Select Ruby on Rails from the "Please select the environment ..." dropdown, select a duration, and then click Create Reservation
- Once the reservation is available, click Connect
- Follow the instructions on the connect screen (connect via SSH and then VNC). Connecting to SSH starts up VNC, the graphical environment to which you will connect.
- When connecting for the first time, it will prompt you for a password to access your (VNC) desktop. You can use any password, and it will be saved for later sessions.
- Follow the instructions given to connect to VNC. If you are using VNC through the browser Java applet, the connect window may appear behind the browser window. You can get a real VNC client at http://realvnc.com
- Once connected to VNC, you should see Aptana RadRails running.
First time setup
Goal: Check out the expertiza project and create a RadRails project. These will both persist in your Unity AFS space.
- Open a terminal (Applications > Accessories > Terminal)
- Ensure you have at least 20M disk quota available: fs lq . You can allocate more space at https://sysnews.ncsu.edu/tools-bin/usmdb-quota
- Visit the Expertiza project page (https://github.com/expertiza/expertiza) to find the git repository URL. For public read-only access, the URL is https://github.com/expertiza/expertiza.git . If the HTTP url fails, try the Git read-only or SSH URL. Expertiza developers with commit access have a different URL specific to them. You may also have a specific repository/URL to use for a class assignment
- Clone (like svn checkout) the git repository: git clone (expertiza repository URL)
- Change to the directory (cd expertiza) and accept the .rvmrc file (press enter and type yes)
- Add the project to RadRails: File > New > Rails Project; from existing source: the directory you just created with git clone (~/expertiza)
Running the Expertiza application server
- In RadRails, go to Window > Show View > Servers
- The Built-in Preview server will be running. Right click on the expertiza server and click Start Server
- As long as there were no errors, the log window will say "Mongrel 1.1.5 available at 0.0.0.0:3000"
- Open a browser: Applications > Internet > Firefox
- Connect to http://localhost:3000 (Alternatively you can connect using your local computer's browser via http://(VCL-IP):3000
- Most changes to Expertiza's code do not require a server restart, though modifying server configuration or plugins does require you to restart the expertiza (mongrel) server.
Installing new gems
The VCL image should usually have all necessary gems installed, but sometimes the the expertiza code moves faster than the VCL image; or you might be using new gems in your own development. The VCL image uses rvm, the Ruby Version Manager. This allows you to use the gem command without sudo. Gems you install will not stick around next time you load the VCL image; you'll have to install custom gems every time you create a VCL reservation.
- gem install gemname
Changing the VNC screen size / resolution
The default VNC screen resolution will be a little small for some people. Unfortunately, you must restart VNC to change its size.
- Save any work you have going in VNC - this will log you out.
- Open the SSH window you initially used to connect to VCL
- vncserver -kill :1 ; vncserver :1 -geometry 1200x750 # Change 1200x750 to the resolution you want to use
Updating the code
Before you start new work, you should ensure that your code is up to date.
- Make sure your working directory is clean (git status).
- git pull