1

Is there a way to run ruby code from inside of a string.

Something like

'x = %ruby command%'

I have tried this from inside of my GemFile with no luck

gem 'private_gem', '>= 2.0.0', :git => 'https://#{ENV['github_user']}:#{ENV['github_password']}@github.umn.edu:asrweb/umn_shib_auth.git'

This is the error message

[!] There was an error parsing `Gemfile`: syntax error, unexpected tIDENTIFIER, expecting end-of-input - ... => 'https://#{ENV['github_user']}:#{ENV['github_password']}...
...                               ^. Bundler cannot continue.

1 Answer 1

2

Just use double quotes:

gem 'private_gem', '>= 2.0.0', :git => "https://#{ENV['github_user']}:#{ENV['github_password']}@github.umn.edu:asrweb/umn_shib_auth.git"
Sign up to request clarification or add additional context in comments.

1 Comment

Clarification: Double quotes ("...") will interpolate on #{...}, while single quotes ('...') will not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.