如何在哈希爆炸可执行文件中引用本地红宝石? [英] How do I reference the local ruby in a hash-bang executable?

查看:50
本文介绍了如何在哈希爆炸可执行文件中引用本地红宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Ruby可执行文件(它是捆绑程序binstub)

 #!/ usr / bin / env ruby 

在我的服务器上,我通过RVM安装了Ruby 193。

  $其中红宝石
-> /home/dtuite/.rvm/rubies/ruby-1.9.3-p0/bin/ruby

在我的本地计算机上,我也通过RVM安装了Ruby,但是安装在其他位置(显然!)

  $其中ruby 
-> /Users/davidtuite/.rvm/rubies/ruby-1.9.3-p0/bin/ruby

当我尝试在服务器上运行此可执行文件时,出现错误

  / usr / bin / env:ruby:没有此类文件或目录

有没有一种方法可以在哈希爆炸中引用本地可用的红宝石,以便

解决方案

尝试 rvm-auto-ruby -在 RVM的Textmate文档中以不同的上下文进行了解释。 p>

I have a Ruby executable (it's a bundler binstub) which starts with

#!/usr/bin/env ruby

On my server I have Ruby 193 installed via RVM.

$ which ruby
-> /home/dtuite/.rvm/rubies/ruby-1.9.3-p0/bin/ruby

On my local machine, I also have Ruby installed via RVM, but in a different location (obviously!)

$ which ruby
-> /Users/davidtuite/.rvm/rubies/ruby-1.9.3-p0/bin/ruby

When I try to run this executable on the server I get an error

/usr/bin/env: ruby: No such file or directory

Is there a way I can reference the locally available ruby in the hash-bang so that the same script will execute on both the server and the local machine?

解决方案

Try rvm-auto-ruby - it is explained in a somewhat different context in RVM's Textmate documentation.

这篇关于如何在哈希爆炸可执行文件中引用本地红宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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