首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >执行sudo Bundle安装后更正bundle权限

执行sudo Bundle安装后更正bundle权限
EN

Stack Overflow用户
提问于 2016-01-15 19:41:48
回答 1查看 1.2K关注 0票数 0

在运行sudo bundle install之后,如果没有前缀sudo,我就无法执行任何命令。例如,如果我想生成一个迁移

代码语言:javascript
复制
 rails generate migration AddLastNameToCandidates last_name:string

它会抛出一个错误

代码语言:javascript
复制
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.

但是,如果我跑

代码语言:javascript
复制
 sudo rails generate migration AddLastNameToCandidates last_name:string

成功地生成了迁移。

如何恢复此操作并运行命令(如bundle install ),而不必以sudo的形式执行它?

EN

回答 1

Stack Overflow用户

发布于 2016-01-15 20:16:34

编辑:我一直在尝试,这是因为每个gem都属于sudo域。我在这篇文章中找到了解决办法

Could not find rake-10.0.4 in any of the sources (Bundler::GemNotFound)

代码语言:javascript
复制
Sometimes we don’t get response from http://rubygems.org/. So it will show the given error.

You can use following ways for fixing this issue

    Try again for gem install using gem install rack command and run bundle update rake for updating your Gemfile.lock file.
    Delete the Gemfile.lock and again bundle install it.

现在,没有sudo前缀的每个命令都运行得很完美。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34818629

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档