I had a need to deploy a Redmine instance online, so I decided to try deploying it on Heroku. Heroku is a briliant and super easy cloud deployment app which deploys a number of potentially complicated web framework apps from your local machine. So forget the headaches of trying to set up Rails, Django, node.js, etc on a server... with a few minimal commands using their toolkit ("heroku" command line) and a git push, apps are instantly pushed online without much fuss or headache.
Anyway, I decided to try out the free tier by trying to get Redmine to work. I remember trying to install it on my Linode a year ago with much annoyance as I followed a guide that required different databases, Phusion Passenger, general Apache muckery and complication. Plus I'm not a fan of Rails (although I respect the framework, I prefer not to use it) so I was kind of dreading trying to get it work on Heroku despite the all the praise of easy deployment. But as I am a masochist sometimes, I decided to try it out on a Sunday night.
So, here are my notes on getting it to work. It actually only spent around 30 minutes total ... and granted if I knew what I was doing I could have gotten it working in 5 minutes even. Heroku is that awesome. What was most helpful was following a guide by Bayle Shanks from a Debian machine that I found, and also following Redmine's guide on Installing on OS X. Basically you have to get it working locally first, and then you can push it to heroku.
I grab the latest Redmine source from the website. Uncompress folder into directory where I would like to run Redmine locally (like a Projects folder). Install/update Ruby Gems necessary for Rails. Then we have to use SQLite3, so we then edit config/database.yml:
production:
adapter: sqlite3
database: redmine
# host: localhost
# port:
# username: redmine
# password:
encoding: utf8
development:
adapter: sqlite3
database: redmine
# host: localhost
# username: root
# password:
encoding: utf8
I then run these commands. To get it to work, we have to downgrade gems to 1.3.7 version and then install the SQLite3 adapter for Ruby if you don't have that yet. Then migrate DB and start up the WEBrick local server:
> rake generate_session_store
> sudo gem update --system 1.3.7
> gem install sqlite3-ruby
> RAILS_ENV=production rake db:migrate
> ruby script/server webrick -e production
Test that things are working by going to http://localhost:3000 and login with admin/admin. Then Control-C to stop WEBrick. Edit config/environment.rb and then add a line before the last "end" statement:
config.action_controller.session = { :key => "_myapp_session", :secret => "<SOME LONG STRING OF CHARACTERS>" }
Edit .gitignore and delete the line "public/plugin_assets" and initialize the git repo:
> git init
> git add .
> git commit -m "first commit on heroku for redmine"
Now we are ready to push to Heroku. Make sure you are logged in using the heroku login command first.
> heroku create
> git push heroku master
> heroku rename APP_NAME
> heroku rake db:migrate
If you encounter any errors like heroku complaining that it doesn't have anything to push to, try creating the heroku before adding your files and pushing. Migration will also take a while. But once it's done, you should *immediately* fire up your newly installed Redmine on the cloud and login to admin and change the password. And then with that, you should be able to enjoy managing projects to your heart's content.
Also to keep in mind: attachments won't work unless you plug in something like S3 to handle file uploads. Creating users, projects, tasks, etc are handled fine by the database but files will need a place to go.