I have a rails app which requires a gem. I host this gem on bitbucket in a private repository.
In my Gemfile I added the gem like following:
gem \"my-gem
I would suggest to use ENV vars instead of a new user like:
https://#{ENV['BITBUCKET_USER']}:#{ENV['BITBUCKET_PWD']}....
Then set them using:
heroku config:add BITBUCKET_X=value
For your development environment you can use the dotenv gem to define the credentials.
See also: How can I specify a gem to pull from a private github repository?