My workaround to avoid System.java:-2:in `arraycopy': java.lang.ArrayIndexOutOfBoundsException

You should install arel v 2.0.9 before installing rails.
Then install rails.
Then in your Gemfile you should put

gem ‘arel’, ‘2.0.9’.

The problem is also on rspec 2.6.0 so in your Gemfile you should put

gem ‘rspec-rails’, ‘2.6.0.rc6’.

That’s how I’ve solved the problem.

you are a genius - thankyou so much, I was having the same problem with
the rails_admin gem, and this workaround totally fixed it!!