2017-09-06 21 views
1

我是新来的Rails,我运行打包机作为根错误&现在它无法正常工作。我试图使用gem uninstall bundler,然后gem install bundler但仍然没有修复。 如何让非root用户再次使用bundler工作(误用root后)?如何让非root用户再次使用bundler工作? (错误地使用它后根)

注: 我已经安装和使用rbenv,但在系统上安装一些宝石后直接

这种情况发生的错误是,捆绑博士表示矫正缺失的宝石,但不会如下图所示

须藤医生包
~/my_ruby_projects/myblog3$ bundle doctor 
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4. 
To update, run `gem install bundler --pre` 
The following gems are missing 
* execjs (2.7.0) 
* coffee-script (2.4.1) 
* coffee-rails (4.2.2) 
* font-awesome-rails (4.7.0.2) 
* temple (0.8.0) 

使用sudo 〜/ my_ruby_projects/myblog3 $ sudo的包医生 最新捆绑器1.16.0.pre.1,但当前运行1.15.4。 要更新,运行gem install bundler --pre 的Gemfile中的依赖性得到满足 与安装包没有找到问题

感谢您的帮助

更新: 我知道捆绑使用sudo是正确的,因为它给了真正的宝石是轨告诉我,他们丢失,如果我用包安装没有sudo提示错误如下(即使它的变化和chmod 777)

~/my_ruby_projects/myblog3$ bundle install 
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4. 
To update, run `gem install bundler --pre` 
There was an error while trying to write to `/home/usrname/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions`. It is likely that you 
need to grant write permissions for that path. 

sudo的包安装它说,所有已安装,但然后导轨抛出错误,我需要安装宝石(其捆绑医生给没有sudo

/my_ruby_projects/myblog3$ sudo bundle install 
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4. 
To update, run `gem install bundler --pre` 
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. 
Using rake 12.0.0 
Using concurrent-ruby 1.0.5 
# many other gems 
Using redis-rails 5.0.2 
Using rails_admin 1.2.0 
Bundle complete! 30 Gemfile dependencies, 98 gems now installed. 
Use `bundle info [gemname]` to see where a bundled gem is installed. 

更新2: rails s是给创业板文件丢失 但**sudo** rails s工作没有错误的错误

回答

2

您应该尝试更改所有者并为您的~/.bundle设置正确的权限。

尝试:

sudo chown -R <youruser> ~/.bundle 

其次:

sudo chmod -R 655 ~/.bundle 
+0

为什么第二CMD?第一个我认为重新给了我的用户dir的所有权,但为什么要将它指定为655的权限? bundle在第一个cmd后没有使用sudo,但仍然'rails s'不工作,有没有什么可以解决缺少rails? 感谢您的帮助 –

+0

rails s在没有sudo的情况下给出了以下内容: '为更多启动选项运行'rails server -h' 致命错误:侦听错误:无法监视目录是否发生更改。 请访问https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers了解如何解决此问题。 退出' github链接对我来说不清楚,回答是不标记的 –

相关问题