有没有办法从字符串内部运行ruby代码。
像
这样的东西'x = %ruby command%'
我已经从我的GemFile里面试了这个,没有运气
gem 'private_gem', '>= 2.0.0', :git => 'https://#{ENV['github_user']}:#{ENV['github_password']}@github.umn.edu:asrweb/umn_shib_auth.git'
这是错误消息
[!] There was an error parsing `Gemfile`: syntax error, unexpected tIDENTIFIER, expecting end-of-input - ... => 'https://#{ENV['github_user']}:#{ENV['github_password']}...
... ^. Bundler cannot continue.
答案 0 :(得分:2)
只需使用双引号:
gem 'private_gem', '>= 2.0.0', :git => "https://#{ENV['github_user']}:#{ENV['github_password']}@github.umn.edu:asrweb/umn_shib_auth.git"