Front end for DECC 2050 calculator
- Requires ruby 2.2.2
Fontcustom has its own dependencies. See github<-- TODO: Remove, as no longer maintained
Here is how to install it
- Install Ruby Version Manager following these instructions: https://rvm.io/rvm/install
git clone https://github.com/tur-ium/twenty-fifty-new-look/
to download the modified and updated branch of the calculator- Run
bundle install
- Run
cd model
ruby compile_c_version_of_excel.rb
cd ..
rvm 2.2
to switch to Ruby version 2.2. You may need to download and install this version. Ruby Version Manager will prompt you and suggest instructions when you try running this command- Run
middleman build
- Run
bundle exec rackup
You need hyper virtualization to run Docker on Windows as far as I am aware. Also, Docker is not great for development of the 2050 model, so it is better to install without Docker, but if the above isn't working for you, here is the way I got the calculator running before I worked out how to install it properly.
-
Set up Docker for Windows and configure WSL following this guide: https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly In WSL:
-
git clone https://github.com/tur-ium/twenty-fifty-new-look
-
cd twenty-fifty-new-look
-
Install Ruby version manager following these instructions https://rvm.io/rvm/install
-
docker image build -t twenty-fifty:1.0 .
#This builds the docker image -
docker container run --publish 8080:80 --detach twenty-fifty:1.0
-
Open a web browser and navigate to
http://localhost:8080
-
When starting the docker instance, if you get an error like
Bind for 0.0.0.0:8000 failed: port is already allocated
, try using a different port (change 8080 to another number like 9292 in the command) -
There may be other ways of setting it up, please let me know if you manage to get them working