使用$ sudo bundle exec ...引发“ bundle:找不到命令”错误 [英] Using $ sudo bundle exec ... raises 'bundle: command not found' error

查看:166
本文介绍了使用$ sudo bundle exec ...引发“ bundle:找不到命令”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Ubuntu服务器上安装了rbenv。我可以进入应用程序目录并运行 $ bundle ,但是我需要运行 $ sudo bundle exec ... 这会给我一个错误:

I have installed rbenv on an Ubuntu sever. I can cd into my application directory and run $ bundle without issue, however I need to run $ sudo bundle exec ... and this gets me an error:


bundle:找不到命令

bundle: command not found

这是为什么,怎么解决?

Why is this and how can I fix it?

推荐答案

丹·卡利(Dan Carley)的 rbenv-sudo 看起来它将满足您的要求:

Dan Carley's rbenv-sudo looks like it will do what you want:

rbenv-sudo是rbenv的插件,允许您从sudo会话中运行rbenv提供的红宝石和宝石。

rbenv-sudo is a plugin for rbenv that allows you to run rbenv-provided Rubies and Gems from within a sudo session.

本文提供了有关其工作方式的详细说明:苏多(Sudo Rbenv)给我一个三明治

A more detailed explanation of how it works is provided in this article: Sudo Rbenv Me a Sandwich

这篇关于使用$ sudo bundle exec ...引发“ bundle:找不到命令”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆