On Windows 7 running ‘gem install [gem name]” I was getting this cryptic error:
ERROR: While executing gem … (ConcurrencyError)
Detected invalid array contents due to unsynchronized modifications with concurrent users
The only post I found that mentions this exact error was in the comments for this post about Neo4j on Ruby, and specifically getting this error with jruby 1.6.0.-RC2. I was using 1.6.0-RC1. I downloaded the latest version (220.127.116.11) and replaced my older version, and that fixed it.
Heroku uses Git for your code repo, and therefore uses SSH to talk to the remote server. If you’re already using an SSH keypair for another repo or elsewhere, you may have to explicitly manage which of your key’s you want to use to access Heroku.
To list your current keys you’ve shared with Heroku:
To add a new key – run this from your ~/.ssh/ dir:
heroku keys:add keyfilename (e.g. rsa_id.pub)
If you get this error:
Fingerprint already exists. Please use one SSH key per Heroku account
… it’s because you’ve already used this SSH key with another account.
This post walks you through getting started with Heroku and deploying a simple Spring MVC web app.
- Follow the Getting Started guide to get your Heroku Toolbelt setup
- Login to Heroku from the commandline with ‘heroku login’
- Since Heroku does not provide it’s own app server, you configure your pom.xml to pull in a dependency on a container, like Jetty (this is from the Getting Started with Spring MVC guide)
The Heroku Getting Started with Java instructions give some steps on how to run your app locally by running Java from the command line and passing a classpath pointing to your target dir, but this seems odd since Jetty is able to run from Mavan against your created war file or even the code compiled to your target dir using the ‘mvn jetty:run’ command. Add the following to the above <plugins> section to enable and use this approach instead:
- Heroku uses a file named ‘Procfile’ in the root of your project to tell Heroku how to run your code. Add this file, and inside it add this one line
web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war
- Create your new app on Heroku with ‘heroku create –stack cedar’
- Add and commit your code if you haven’t already, then push to your heroku remote git:
git add . git commit -m "commit comment" git push heroku master
At this point Heroku should build you app remotely and start it up.
If you see this error about the jetty-runner.jar missing, then you forgot to add the plugin part to your pom.xml to copy the jetty jar to the target/dependency dir:
Unable to access jarfile target/dependency/jetty-runner.jar