-
Notifications
You must be signed in to change notification settings - Fork 505
Windows Setup
Warning: As of 2015, it is no longer possible to run the Archive locally on Windows due to incompatible gems. The recommended procedure on Windows is therefore to use the Vagrant development environment.
#Old Instructions
This document assumes that you are comfortable with the Windows command line and starting/stopping services.
To install the Archive, you will need to install the following (preferably in this order):
-
Ruby 2.0 - http://rubyinstaller.org/
This is the bit that “runs” the code. -
MySQL 5.6 - http://dev.mysql.com/downloads/
The Archive keeps all its data in a MySQL database, and also needs one for the tests.
Run it as a service on its default port 3306. -
Redis – http://freshclickmedia.co.uk/2013/09/installing-redis-on-windows/
Redis is an in-memory database which is faster than MySQL. To avoid going back to read data from MySQL every time it is needed, the Archive stuffs data into Redis as it goes along, so that the next request for the same data will be quicker. The Archive will not run without Redis.
Run it as a service on the default port 6379. -
Java JDK 1.7 - http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
This is required for Elasticsearch, which is a Java application. Make sure JAVA_HOME is set to the JDK root folder in your Environment Variables. -
Elasticsearch 0.90 – http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-service-win.html
This is the search engine that powers most of the lists you see on the Archive (eg: Works or Bookmark listings).
Run it as a service on its default port range 9200-9300. -
ImageMagick - http://www.imagemagick.org/script/binary-releases.php
This is a dependency for one of the Gems we use. The tests won’t run without it. -
Memcache (optional) – http://zurmo.org/wiki/installing-memcache-on-windows
You will need this if you want to work on caching-related features, but it is not required to run the Archive and hasn't yet been tested on Windows. -
RubyMine (optional) – http://www.jetbrains.com/ruby/
The Archive has a community license for this fully-featured Ruby IDE. Though this guide gives you the command line instructions that would be used in Linux, most of those commands can be run by configuring tasks in RubyMine’s Run environment, so it is well worth reading their documentation and setting those up if you’re the kind of Windows user who isn’t keen on the command prompt!
Make sure you know exactly where all these applications are and what ports they use if they are not the ones we’ve listed above.
- Fork the otwcode/otwarchive repo
- Clone your forked copy into a folder of your choice on your Windows machine
(If you have already joined the OTW as an official volunteer, you can also follow the "Getting started" instructions on the internal wiki and use Dropbox to synchronise your folder with your Webdev)
The live Archive runs on Unicorn HTTP web servers. However, Unicorn doesn't work on Windows, so you'll have to substitute Thin instead. To do this, simply add the following lines at the end of the Gemfile in the root of otwarchive:
group :mswin do
# Windows alternative to unicorn
gem "thin"
end
Note: If you are using RubyMine, you can use the Run command to start the otwarchive app and it will run the web app using WEBrick (though see this StackOverflow post for the solution to a common warning that WEBrick adds to the logs)
Make sure that the Ruby executable is in the path, then with otwarchive as your current directory, run the following commands:
bundle install
bundle exec seed
When it has finished doing all that, then the following command will start up the Thin web service and run the app:
C:\Ruby193\bin\ruby.exe D:/Dropbox/OTW-Projects/otwarchive/script/rails server -b 127.0.0.1 -p 3000 -e development
(Or you can let RubyMine's Run menu magically work it out for you)
Autocomplete relies on data in Redis. This needs to be loaded whenever it changes; on the production server (“Beta”), this task is automated, but on your Windows installation, you will have to load the data yourself. There is a load_autocomplete_data Rake task in /lib/tasks which takes care of this. Make sure Redis is running as a service, and run the following task:
RAILS_ENV=staging rake autocomplete:load_data
You should be able to see some autocomplete results on your copy of the Archive within a few minutes.
If you have any questions regarding code development, please don't hesitate to send an email to [email protected] and we will try to get back to you as soon as possible!
- Home
- Set Up Instructions
- Docker (All platforms)
- Gitpod (Cloud-based development)
- Linux
- OS X
- Creating Development Data
- Writing and Tracking Code
- Automated Testing
- Architecture
-
Getting Started Guide
- Getting Set Up
- Your First Pull Request
- More About Git
- Jira