奇怪的导轨错误“权限被拒绝:bin/rails"对于旧的 Rails 应用程序 [英] Weird rails error "permission denied: bin/rails" for old rails apps

查看:48
本文介绍了奇怪的导轨错误“权限被拒绝:bin/rails"对于旧的 Rails 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我运行 rails(或任何 rails 命令)时,我都会收到此错误<代码>_rails_command:2: 权限被拒绝:bin/rails仅当我在某个 rails 应用程序目录中时.

I'm getting this error whenever I run rails (or any rails command) _rails_command:2: permission denied: bin/rails ONLY when i'm inside some old rails app directory.

在这些目录中 bundle exec rails c 命令有效但 rails 甚至 rails -v 不起作用.

In these directories bundle exec rails c command works but rails or even rails -v don't work.

背景:我将编码工作区保存在 dropbox 文件夹中.现在我最近安装了 Manjaro,因此我从以前的操作系统下载回来的所有 rails 应用程序我都称它们为 rails 应用程序.

Background: I keep my coding workspace in dropbox folder. Now I recently installed Manjaro and hence all the rails apps which I downloaded back from my previous OS I call them old rails app.

简而言之:除了旧的 Rails 应用程序外,Rails 在任何地方都可以正常工作.bundle exec rails c 工作正常.我尝试过的 Ruby 版本:2.0.0 (rvm), 2.1.1(rvm), 2.1.1 (system)

In Short: Rails works fine everywhere except for old rails apps. bundle exec rails c works fine though. Ruby versions which I've tried: 2.0.0 (rvm), 2.1.1(rvm), 2.1.1 (system)

宝石环境:<代码>RubyGems 环境:- 红宝石版本:2.2.2- 红宝石版本:2.0.0 (2014-02-24 patchlevel 451) [x86_64-linux]- 安装目录:/home/tat/.rvm/gems/ruby-2.0.0-p451@latest- 红宝石可执行文件:/home/tat/.rvm/rubies/ruby-2.0.0-p451/bin/ruby- 可执行目录:/home/tat/.rvm/gems/ruby-2.0.0-p451@latest/bin- SPEC 缓存目录:/home/tat/.gem/specs- 红宝石平台:- 红宝石- x86_64-linux- 宝石路径:-/home/tat/.rvm/gems/ruby-2.0.0-p451@latest-/home/tat/.rvm/gems/ruby-2.0.0-p451@global- 宝石配置:- :update_sources =>真的- :详细=>真的- :backtrace =>错误的- :bulk_threshold =>1000- 远程资源:- https://rubygems.org/- 外壳路径:-/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 上.

UPDATE: Its working fine in bash, the problem seem to be with oh-my-zsh.

这是我的 rvm-info(来自 zsh):

Here is my rvm-info (from 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"

推荐答案

在你提到的目录中,你的 rails 处于可执行模式.如果没有你可以申请

In the directory you mentioned is your rails in executable mode. If not you can apply

chmod u+x bin/rails

并使其可执行.

这篇关于奇怪的导轨错误“权限被拒绝:bin/rails"对于旧的 Rails 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆