在运行sudo bundle install之后,如果没有前缀sudo,我就无法执行任何命令。例如,如果我想生成一个迁移
rails generate migration AddLastNameToCandidates last_name:string它会抛出一个错误
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.但是,如果我跑
sudo rails generate migration AddLastNameToCandidates last_name:string成功地生成了迁移。
如何恢复此操作并运行命令(如bundle install ),而不必以sudo的形式执行它?
发布于 2016-01-15 20:16:34
编辑:我一直在尝试,这是因为每个gem都属于sudo域。我在这篇文章中找到了解决办法
Could not find rake-10.0.4 in any of the sources (Bundler::GemNotFound)
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前缀的每个命令都运行得很完美。
https://stackoverflow.com/questions/34818629
复制相似问题