如何设置所需的Ruby版本的正确家当 [英] How to set the correct shebang for the needed Ruby version

查看:90
本文介绍了如何设置所需的Ruby版本的正确家当的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行的Ruby 2.0.0与MacOS X的。

I am running Ruby 2.0.0 with MacOS x.

由于某些原因,当我运行混帐推在我的本地gitlab,我有一个以

For some reason, when I run git push on my local gitlab, I have a script that begins with

#! /usr/bin/env ruby

这是处理的红宝石版本是 ruby​​1.8.7 它打破了应用程序。

The Ruby version that is processed is ruby1.8.7 which breaks the app.

我如何正确设置这个家当为了使用Ruby 2.0.0?

How can I set correctly this shebang in order to use Ruby 2.0.0?

推荐答案

在黑暗中拍摄,但在取出家当和运行呼应2.0.0-P247> .ruby版本(替换您的特定版本)可能的帮助。或者说是家当绝对必要的?

A shot in the dark, but removing the shebang and running echo 2.0.0-p247 > .ruby-version (substituting your specific version) might help. Or is the shebang absolutely necessary?

刮的是,按照本网站你可以可以尝试#!的/ usr / bin中/ env的RVM 2.0做红宝石(或类似的东西)。

Scratch that, as per this site you could could try #!/usr/bin/env rvm 2.0 do ruby (or something similar).

这篇关于如何设置所需的Ruby版本的正确家当的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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