简体   繁体   English

我可以在没有root特权的情况下在远程用户shell帐户上安装“ yajl-ruby”或“ json”吗?

[英]Can I install 'yajl-ruby' or 'json' on a remote user shell account without having root privileges?

For some reason, I trust is for a good one which I fail to see, ' json ' and ' yajl-ruby ' ruby gems required by 'twitter' gem, in order to work properly, need root privileges. 出于某种原因,我相信这是一件好事,但我没有看到,为了确保其正常工作,“ twitter”宝石所需的“ json ”和“ yajl-ruby ”红宝石宝石需要root用户特权。

I need to install and run the ruby script I prepared on a 24/7-up server and there's no better place from my remote paid host provider, which gives a shell. 我需要在24 / 7-up服务器上安装和运行我编写的ruby脚本,而我的远程付费主机提供者再也找不到比这更好的地方了。 It's a FreeBSD 7.4 server. 这是一个FreeBSD 7.4服务器。

I setup manually rubygems, the server only provided ruby1.8 via precompiled binary. 我手动设置rubygems,服务器仅通过预编译的二进制文件提供ruby1.8。 So once I installed the gems I start using most of them without issues when I finally crossed 'twitter' I got this error: 因此,一旦我安装了宝石,当我最终越过“ twitter”时,我就开始毫无问题地使用其中的大部分宝石,我得到了这个错误:

$ gem install yajl-ruby $ gem install yajl-ruby
Building native extensions. 构建本机扩展。 This could take a while... 这可能需要一段时间...
ERROR: Error installing yajl-ruby: 错误:安装yajl-ruby时出错:
ERROR: Failed to build gem native extension. 错误:无法生成gem本机扩展。
[...] make install /usr/bin/install -c -o root -g wheel -m 0755 yajl.so /path/.gems/gems/yajl-ruby-0.8.2/lib [...]进行安装/ usr / bin / install -c -o root -g wheel -m 0755 yajl.so /path/.gems/gems/yajl-ruby-0.8.2/lib
install: /path/.gems/gems/yajl-ruby-0.8.2/lib/yajl.so: chown/chgrp: Operation not permitted 安装:/path/.gems/gems/yajl-ruby-0.8.2/lib/yajl.so:chown / chgrp:不允许操作
* Error code 71 *错误代码71

So I'm kinda stuck. 所以我有点卡住了。

regards 问候

Using RVM you'll install gems without sudo. 使用RVM,您将安装没有sudo的gems。

It is very usefull and "must have" tool anyway :) 无论如何,它是非常有用和“必须具备”的工具:)

Also you can try to pass --install-dir option to your local dir with writing permissions 您也可以尝试将--install-dir选项传递给具有写入权限的本地目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM