ruby-on-rails – 旧轨道应用程序的奇怪导轨错误“权限被拒绝:bin / rails”

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 旧轨道应用程序的奇怪导轨错误“权限被拒绝:bin / rails”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我运行rails(或任何rails命令)时,我收到此错误

_rails_command:2:权限被拒绝:bin / rails

只有当我在一些旧的rails应用程序目录.

在这些目录中,包含exec rails c命令,但rails或甚至rails -v不起作用.

背景:
我将编码工作区保留在保管箱文件夹中.
现在我最近安装了Manjaro,因此我从我以前的操作系统下载的所有rails应用程序,我称之为旧的rails应用程序.

简而言之:
除了旧的rails应用程序,Rails的工作正常.
bundle exec rails c工作正常.
我试过的Ruby版本:
2.0.0(rvm),2.1.1(rvm),2.1.1(系统)

宝石环境:

RubyGems环境:
– RUBYGEMS VERSION:2.2.2
– RUBY VERSION:2.0.0(2014-02-24 patchlevel 451)[x86_64-linux]
– 安装目录:/home/tat/.rvm/gems/ruby-2.0.0-p451@latest
– RUBY EXECUTABLE:/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/ruby
– EXECUTABLE DIRECTORY:/home/tat/.rvm/gems/ruby-2.0.0-p451@latest/bin
– SPEC CACHE DIRECTORY:/home/tat/.gem/specs
– RUBYGEMS PLATFORMS:
– 红宝石
– x86_64-linux
– 创业板PATHS:
– /home/tat/.rvm/gems/ruby-2.0.0-p451@latest
– /home/tat/.rvm/gems/ruby-2.0.0-p451@global
– 创业板配置:
– :update_sources =>真正
– :verbose =>真正
– :backtrace =>假
– :bulk_threshold => 1000
– 远程来源:
– https://rubygems.org/
– SHELL PATH:
– /home/tat/.rvm/gems/ruby-2.0.0-p451@latest/bin
– /home/tat/.rvm/gems/ruby-2.0.0-p451@global/bin
– /home/tat/.rvm/rubies/ruby-2.0.0-p451/bin
– / home / tat / bin
– /usr/local / bin
– /usr/local / sbin
– /usr/local / bin
– /usr/bin
– /usr/bin/core_perl
– /home/tat/.rvm/bin

更新:
它在bash中工作正常,这个问题似乎与oh-my-zsh有关.

这是我的rvm-info(从zsh):

ruby-2.0.0-p451@latest:

  system:
    uname:       "Linux tat-Box 3.10.37-1-MANJARO #1 SMP Mon Apr 14 20:56:29 UTC 2014 x86_64 GNU/Linux"
    system:      "manjaro/0.8.9/x86_64"
    bash:        "/usr/bin/bash => GNU bash,version 4.3.8(1)-release (x86_64-unknown-linux-gnu)"
    zsh:         "/usr/bin/zsh => zsh 5.0.5 (x86_64-unknown-linux-gnu)"

  rvm:
    version:      "rvm 1.25.23 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>,Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "21 hours 33 minutes 15 seconds ago"
    path:         "/home/tat/.rvm"

  ruby:
    interpreter:  "ruby"
    version:      "2.0.0p451"
    date:         "2014-02-24"
    platform:     "x86_64-linux"
    patchlevel:   "2014-02-24 revision 45167"
    full_version: "ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]"

  homes:
    gem:          "/home/tat/.rvm/gems/ruby-2.0.0-p451@latest"
    ruby:         "/home/tat/.rvm/rubies/ruby-2.0.0-p451"

  binaries:
    ruby:         "/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/ruby"
    irb:          "/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/irb"
    gem:          "/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/gem"
    rake:         "/home/tat/.rvm/gems/ruby-2.0.0-p451@latest/bin/rake"

  environment:
    PATH:         "/home/tat/.rvm/gems/ruby-2.0.0-p451@latest/bin:/home/tat/.rvm/gems/ruby-2.0.0-p451@global/bin:/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin:/home/tat/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl:/home/tat/.gem/ruby/2.1.0/bin:/home/tat/.rvm/bin"
    GEM_HOME:     "/home/tat/.rvm/gems/ruby-2.0.0-p451@latest"
    GEM_PATH:     "/home/tat/.rvm/gems/ruby-2.0.0-p451@latest:/home/tat/.rvm/gems/ruby-2.0.0-p451@global"
    MY_RUBY_HOME: "/home/tat/.rvm/rubies/ruby-2.0.0-p451"
    IRBRC:        "/home/tat/.rvm/rubies/ruby-2.0.0-p451/.irbrc"
    RUBYOPT:      ""
    gemset:       "latest"

解决方法

在您提到的目录中,您的导轨是可执行模式.如果不可以申请
chmod u+x bin/rails

并使其可执行.

猜你在找的Ruby相关文章