问题描述
如何在我的Openshift应用程序中获得root特权?我需要在Openshift虚拟机上安装其他gem,如果没有超级用户权限,就不可能做到这一点.
How can I get root privileges in my Openshift app? I need to install additional gems to my Openshift virtual machine and it's impossible to do it without superuser privileges.
要登录,我使用的是SSH:ssh generate-hash@myapp-myns.rhcloud.com
For login, I'm using SSH:ssh generated-hash@myapp-myns.rhcloud.com
我已经将我的id_key.pub输入到Openshift Web界面,并且正在使用SSH进行密码登录.
I've already entered my id_key.pub to the Openshift web interface and I'm doing SSH with no password.
推荐答案
要在openshift中安装其他gem,请参见此论坛,从ramr答案中复制:
To install additional gems in openshift see this forum, copied from ramr answer:
执行此操作的步骤:1.创建一个合适的Gemfile-可能 像这样:
Steps to do that: 1. Create an appropriate Gemfile -- probably something like:
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
这篇关于在Openshift上安装ruby gem的root特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!