Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何修复以下绑定器错误?_Ruby On Rails_Ruby_Bundle_Bundler - Fatal编程技术网

Ruby on rails 如何修复以下绑定器错误?

Ruby on rails 如何修复以下绑定器错误?,ruby-on-rails,ruby,bundle,bundler,Ruby On Rails,Ruby,Bundle,Bundler,以下是错误消息: Fetching gem metadata from https://rubygems.org/ Retrying fetcher due to error (2/4): Errno::EACCES Permission denied @ rb_sysopen - /home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop Retry

以下是错误消息:

Fetching gem metadata from https://rubygems.org/
Retrying fetcher due to error (2/4): Errno::EACCES Permission denied @ rb_sysopen - /home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
Retrying fetcher due to error (3/4): Errno::EACCES Permission denied @ rb_sysopen - /home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
Retrying fetcher due to error (4/4): Errno::EACCES Permission denied @ rb_sysopen - /home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?

  I ran the command `/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/exe/bundle install`

- What did you expect to happen?

  I expected Bundler to...

- What happened instead?

  Instead, what actually happened was...


Error details

    Errno::EACCES: Permission denied @ rb_sysopen - /home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `initialize'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `open'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `open'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in `update'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:63:in `update'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:72:in `update_info'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:42:in `block in dependencies'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/fetcher/compact_index.rb:83:in `call'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/fetcher/compact_index.rb:83:in `block (3 levels) in compact_index_client'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:65:in `call'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:65:in `apply_func'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:60:in `block in process_queue'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:57:in `loop'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:57:in `process_queue'
      /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:29:in `block (2 levels) in initialize'

Environment

  Bundler   1.12.0.rc.3
  Rubygems  2.2.2
  Ruby      2.1.5p273 (2014-11-13 revision 0) [x86_64-linux-gnu]
  GEM_HOME  /home/rajan/.gem
  GEM_PATH  
  Git       2.5.0

      Bundler settings

  path
    Set for the current user (/home/rajan/.bundle/config): "/home/rajan/.gem"
  disable_shared_gems
    Set for your local app (/home/rajan/Desktop/app/.bundle/config): true
    Set for the current user (/home/rajan/.bundle/config): "true"
  orig_path
    Set via BUNDLE_ORIG_PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.



If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new
         run  bundle exec spring binstub --all
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:356:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'rails (= 4.2.6)' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound)
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:331:in `each'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:331:in `verify_gemfile_dependencies_are_found!'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:200:in `start'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:184:in `resolve'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:200:in `resolve'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:140:in `specs'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:185:in `specs_for'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:174:in `requested_specs'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/environment.rb:19:in `requested_specs'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/runtime.rb:14:in `setup'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler.rb:95:in `setup'
    from /var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/setup.rb:19:in `<top (required)>'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
从中获取gem元数据https://rubygems.org/
由于错误(2/4)而重试获取程序:Errno::EACCES权限被拒绝@rb_sysopen-/home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
由于错误(3/4)而重试获取程序:Errno::EACCES权限被拒绝@rb_sysopen-/home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
由于错误(4/4)而重试获取程序:Errno::EACCES权限被拒绝@rb_sysopen-/home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
---错误报告模板-------------------------------------------------------
-你做了什么?
我运行了命令`/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/exe/bundle-install`
-你以为会发生什么?
我希望Bundler。。。
-发生了什么事?
相反,实际发生的是。。。
错误详细信息
Errno::EACCES:Permission denied@rb_sysopen-/home/rajan/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/treetop
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in'initialize'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact\u index\u client/lib/compact\u index\u client/updater.rb:32:在“打开”中
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact\u index\u client/lib/compact\u index\u client/updater.rb:32:在“打开”中
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:32:in'update'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:63:in'update'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:72:in'update_info'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:42:在“依赖项中的块”中
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/fetcher/compact_index.rb:83:in'call'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/fetcher/compact\u index.rb:83:在“compact\u index\u客户端中的块(3级)”中
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:65:in'call'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:65:in'apply_func'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:60:“进程中的块队列”中
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:57:in'loop'
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:57:在“进程队列”中
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/worker.rb:29:在“初始化中的块(2个级别)”中
环境
捆扎机1.12.0.rc.3
Rubygems 2.2.2
Ruby 2.1.5p273(2014-11-13第0版)[x86_64-linux-gnu]
GEM_HOME/HOME/rajan/.GEM
宝石路
Git 2.5.0
捆绑机设置
路径
为当前用户(/home/rajan/.bundle/config)设置:“/home/rajan/.gem”
禁用共享宝石
为本地应用程序(/home/rajan/Desktop/app/.bundle/config)设置:true
为当前用户(/home/rajan/.bundle/config)设置:“true”
原路
通过BUNDLE\u ORIG\u路径设置:“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games”
---模板端----------------------------------------------------------------
不幸的是,发生了意外错误,捆绑程序无法继续。
如果还没有关于此错误的任何报告,请创建副本并将上面的报告模板粘贴到新版本中。不要忘记匿名任何私人数据!新发行表格位于:
https://github.com/bundler/bundler/issues/new
运行bundle exec spring binstub--所有
/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:356:在“验证中的块\u gemfile\u依赖项是否找到”中:在gem文件中列出的或此计算机上可用的任何gem源中找不到gem“rails(=4.2.6)”。(绑定器::GemNotFound)
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:331:in'each'
从/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:331:在“验证是否找到依赖项”中
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:200:in'start'
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/resolver.rb:184:in'resolve'
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:200:in'resolve'
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:140:in'specs'
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:185:in'specs_for'
摘自/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/definition.rb:174:“请求的规范”中
来自/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/environment.rb:19:“请求的规范”中
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/runtime.rb:14:in'setup'
from/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler.rb:95:in'setup'
来自/var/lib/gems/2.1.0/gems/bundler-1.12.0.rc.3/lib/bundler/setup.rb:19:in`'
from/usr/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
from/usr/lib/ruby/2.1.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'

在命令前键入SUDO


您有权限错误。

尽管运行@ProperSharp建议的
sudo bundle安装应该会有所帮助,但它并不能解决问题的原因。问题的原因是当前用户没有权限。最有可能是
rvm
rvm
的gemset文件夹。RVM希望当前用户
# General environment repairs
rvm repair

# Fixes issues with folder/file permissions
rvm fix-permissions