How do I recompile a ruby with RVM?

牧云@^-^@ 提交于 2019-12-03 04:43:38

问题


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.


回答1:


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).

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

rvm reinstall --disable-binary 2.1



回答2:


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

or nicer:

rvm reinstall [RUBY]



回答3:


or rvm reinstall [RUBY]





回答4:


Use:

rvm install --force

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

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.

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:

  • --rvmrc - already available in RVM - will create .rvmrc file
  • --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


来源:https://stackoverflow.com/questions/9663005/how-do-i-recompile-a-ruby-with-rvm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!