Here is the code:
It seems like the stack is not registering the local versions of applications. I also could not run the mysql backup/restore. However I found that if I included the full path I could run both ruby and mysql.
sudo /opt/redmine/ruby/bin/ruby bin/rake db:migrate RAILS_ENV=production
/opt/redmine/mysql/bin/mysqldump -u bitnami -p bitnami_redmine > /home/user/backup_41.sql
I also had some errors with the db:migrate with table already present. For some I just removed the *.rb migrate files that were causing the problem since if I dropped the tables I would loose all of the email addresses. Then for some others I dropped the tables.
I tested my upgrade on the bitnami redmine virtual appliance and I did not have as many problems.
These are the migrate files that I deleted for both the stack and VM
These are the additional tables that I needed to drop in the stack
I was upgrading from redmine bitnami stack:
Redmine version 3.1.1.stable