Dennis J. Darland's APFP Calculators using Ruby on Rails
Mail To: pal at dennisdarland dot com
For other things I'm doing see
my home page.
Notes on Ruby on Rails Calculators using APFP (Feb 24, 2015)
I wrote these tools several years ago and had them working a couple times under dennisdarland.com.
However they are very CPU intensive.
I suspect my host service disabled them somehow - anyway they would stop working.
Recently I decided to get them working locally using WEBrick under Windows.
It took me most of 3 days to accomplish that.
I was using 64 bit Windows 8.1.
I had no trouble installing Ruby. - But ended up using 32 bit Ruby 1.9.3 - because of difficulties with installing rails.
Ruby on Rails Site
Others my not have that difficulty. I don't know if there is any connection - but I don't have any version of Java installed.
Also before installing rails it is necessary to install DevKit for Ruby (corresponding with the Ruby version you use.)
Follow the Ruby installer page to Add-Ons to DevKit.
Note - You need to install DevKix is a permanent place.
And then in that permanent place run:
"ruby dk.rb init"
"ruby dk.rb install"
Also I did not use rbenv - although it is recommended - it seems no longer to be maintained.
Then install rails with:
"gem install rails"
It did a some things and then had an error on installing some documentation - I proceeded anyway.
Sourceforge Project APFP Calculators Download Page
Then I installed the calculator I wrote for real numbers (there is also one for complex numbers).
from a source directory where it is ubzipped in a dos prompt you:
"rails new realcalc"
(for me this did a lot of work then failed and said to install a gem and specified a version).
I installed the gem
"gem install ..."
I deleted the realcalc directory" (I used File explorer which I kept handy - I am sure there is way in dos prompt - but I am mainly used to Linux)
repeated "rails new realcalc"
needed to install another gem deleted directory etc
Repeated above 20-40 times for more gems - I would guess - then finally got success.
then For the next 3 steps I have created bat files.
These must be run from the parent of the realcalc directory
realcalc2.bat -- for the controller
realcalc3.bat -- for the model
realcalc4.bat - to copy my revised files.
One of the revised files is in the config subdirectory of realcalc.
routes.rb -- it should be OK
It was what I had most difficulty understanding.
One other change also involved config was to cause session data to be stored in database instead of cookies (the default - but my data too large for cookies).
I used activerecord-session_store.
"gem install activerecord-session_store"
I had to change config/initializers/session-store.rb
I installed this gem and then had to add it to Gemfile (in realcalc directory) at bottom
Put "gem 'activerecord-session_store'" at bottom of Gemfile
rerun "bundle install"
Then (in realcalc directory)
"rails generate active_record:session_migration"
"rake db:migrate RAILS_ENV=development"
then start the server (in realcalc directory).
Then in your browser go to:
compcalc is exactly the same - except all the gems will be installed
You will have to edit the Gemfile still.
Otherwise just substitute "compcalc" for "realcalc"