In your app run this command.
bundle config local.rails /home/ubuntu/workspace/Fork/rails
Then in your Gemfile you specify the github source which will be overridden.
gem 'rails', :github => 'rails/rails', :branch => 'any_of'
Source: http://gembundler.com/v1.3/git.html