如何使用RVM重新编译ruby?

时间:2022-06-28 20:07:30

I installed Ruby 1.9.3 with RVM, and it works fine. I then made some changes in a ruby C source file, and I want to recompile and re-install it so I can use the changes. I haven't found any kind of rvm recompile command however.

我用RVM安装了Ruby 1.9.3,它运行正常。然后我在ruby C源文件中做了一些更改,我想重新编译并重新安装它,以便我可以使用这些更改。我没有找到任何类型的rvm重新编译命令。

4 个解决方案

#1


49  

The problem with using rvm [reinstall|install] is that it will fetch and use precompiled binaries if it can find any. Sometimes, you really want to rebuild from source, probably because you're trying to use a more recent version of GCC (e.g. 4.8 or 4.9).

使用rvm [重新安装|安装]的问题是它将获取并使用预编译的二进制文件,如果它可以找到任何。有时候,你真的想从源代码重建,可能是因为你试图使用更新版本的GCC(例如4.8或4.9)。

The correct flag is --disable-binary, not --force:

正确的标志是--disable-binary,而不是--force:

rvm reinstall --disable-binary 2.1

#2


18  

Ah hah. rvm uninstall [RUBY] followed by rvm install [RUBY] does the trick.

啊哈。 rvm uninstall [RUBY]后跟rvm install [RUBY]就可以了。

or nicer:

或者更好:

rvm reinstall [RUBY]

#3


11  

or rvm reinstall [RUBY]

或者rvm重新安装[RUBY]


#4


7  

Use:

使用:

rvm install --force

It explicitly asks RVM to use existing sources, in earlier versions this was default - but might be very confusing.

它明确要求RVM使用现有的源,在早期版本中这是默认的 - 但可能会非常混乱。

So other commands in ther for installing:

所以其他命令还可以安装:

rvm try_install <ruby>

Will only install if not yet installed (your problem)

只安装(如果尚未安装)(您的问题)

rvm reinstall <ruby>

is the same as:

是相同的:

rvm remove [--gems] <ruby>
rvm install <ruby>

obviously some time saved with reinstall and use [--gems] to also remove all the gems that were installed with ruby.

显然有一些时间保存重新安装并使用[--gems]也删除所有使用ruby安装的宝石。

mkdir -p projects/smth && cd projects smth
rvm use 1.9.3@gem --install --create --ruby-version

will go to project, install 1.9.3 (if not yet installed), create the gemset, and create .ruby-version file (available only in RVM head before v. 1.11.0) the other flgs:

将进入项目,安装1.9.3(如果尚未安装),创建gemset,并创建.ruby-version文件(仅在V 1.11.0之前的RVM头中可用)其他flg:

  • --rvmrc - already available in RVM - will create .rvmrc file
  • --rvmrc - 已在RVM中可用 - 将创建.rvmrc文件
  • --versions-conf - available only in RVM head before v. 1.11.0 - will create .versions.conf - a configuration file for your project, you can put there any important information about your project ... like node.js version
  • --versions-conf - 仅在v.1.11.0之前的RVM头中可用 - 将创建.versions.conf - 项目的配置文件,你可以放置关于你的项目的任何重要信息......比如node.js版本

#1


49  

The problem with using rvm [reinstall|install] is that it will fetch and use precompiled binaries if it can find any. Sometimes, you really want to rebuild from source, probably because you're trying to use a more recent version of GCC (e.g. 4.8 or 4.9).

使用rvm [重新安装|安装]的问题是它将获取并使用预编译的二进制文件,如果它可以找到任何。有时候,你真的想从源代码重建,可能是因为你试图使用更新版本的GCC(例如4.8或4.9)。

The correct flag is --disable-binary, not --force:

正确的标志是--disable-binary,而不是--force:

rvm reinstall --disable-binary 2.1

#2


18  

Ah hah. rvm uninstall [RUBY] followed by rvm install [RUBY] does the trick.

啊哈。 rvm uninstall [RUBY]后跟rvm install [RUBY]就可以了。

or nicer:

或者更好:

rvm reinstall [RUBY]

#3


11  

or rvm reinstall [RUBY]

或者rvm重新安装[RUBY]


#4


7  

Use:

使用:

rvm install --force

It explicitly asks RVM to use existing sources, in earlier versions this was default - but might be very confusing.

它明确要求RVM使用现有的源,在早期版本中这是默认的 - 但可能会非常混乱。

So other commands in ther for installing:

所以其他命令还可以安装:

rvm try_install <ruby>

Will only install if not yet installed (your problem)

只安装(如果尚未安装)(您的问题)

rvm reinstall <ruby>

is the same as:

是相同的:

rvm remove [--gems] <ruby>
rvm install <ruby>

obviously some time saved with reinstall and use [--gems] to also remove all the gems that were installed with ruby.

显然有一些时间保存重新安装并使用[--gems]也删除所有使用ruby安装的宝石。

mkdir -p projects/smth && cd projects smth
rvm use 1.9.3@gem --install --create --ruby-version

will go to project, install 1.9.3 (if not yet installed), create the gemset, and create .ruby-version file (available only in RVM head before v. 1.11.0) the other flgs:

将进入项目,安装1.9.3(如果尚未安装),创建gemset,并创建.ruby-version文件(仅在V 1.11.0之前的RVM头中可用)其他flg:

  • --rvmrc - already available in RVM - will create .rvmrc file
  • --rvmrc - 已在RVM中可用 - 将创建.rvmrc文件
  • --versions-conf - available only in RVM head before v. 1.11.0 - will create .versions.conf - a configuration file for your project, you can put there any important information about your project ... like node.js version
  • --versions-conf - 仅在v.1.11.0之前的RVM头中可用 - 将创建.versions.conf - 项目的配置文件,你可以放置关于你的项目的任何重要信息......比如node.js版本