如何在 Openshift 应用程序中获得 root 权限?我需要在我的 Openshift 虚拟机上安装额外的 gem,如果没有超级用户权限就不可能做到这一点。
对于登录,我使用 SSH:
SSH[电子邮件受保护] /cdn-cgi/l/email-protection
我已经将 id_key.pub 输入到 Openshift Web 界面,并且正在使用无密码的 SSH。
要在 openshift 中安装其他 gem,请参阅this https://openshift.redhat.com/community/forums/openshift/problems-installing-the-ruby-gem-whois论坛,复制自 ramr 答案:
所以你需要做的就是添加一个 Gemfile + Gemfile.lock 到你的
应用程序,然后执行 git Push -- 请参阅https://github.com/openshift/rails-example https://github.com/openshift/rails-example举个例子
Gemfile+Gemfile.lock。
步骤: 1. 创建一个合适的 Gemfile —— 可能是
就像是:
source 'http://rubygems.org'
gem 'whois'
gem "minitest"
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exists?(local_gemfile)
puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v`
instance_eval File.read(local_gemfile)
end
在您的工作站上执行捆绑程序安装捆绑安装(您可能
需要gem安装bundler才能使用bundler)。那应该
创建一个 Gemfile.lock - 添加该文件和 Gemfile 并提交 git add
Gemfile Gemfile.lock, git commit Gemfile Gemfile.lock -m 'added deps'
将更改推送到您的 OpenShift 应用程序 git push HTH
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)