TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

No Need for RVM or Rbenv on OpenBSD

25 点作者 frenkel大约 11 年前

11 条评论

skywhopper大约 11 年前
Rbenv and RVM provide a lot more than just four major revisions of Ruby. They provide explicit, exact version selection down to the exact patchlevel of the release, alternative interpreters like JRuby, Maglev, Rubinius, and Ruby EE. Plus, they are user-installable, and have tools for automatically managing selecting the correct Ruby for a project without having to issue special commands.<p>Certainly I&#x27;d prefer if popular Linux distributions made more versions of tools like Ruby available as packages, but just having Ruby 2.0 and 2.1 installed at the same time is not the only point.<p>Honestly, the rbenv model is looking pretty good these days given that there&#x27;s also pyenv, nodenv, and plenv, all direct forks of rbenv. For the servers I take care of, I set up system-wide rbenv and pyenv installs as a non-root user to give our applications the flexibility of these tools without having to screw around with root access where it&#x27;s unnecessary. It works great, and I&#x27;m planning to move Perl to the same model.
评论 #7410741 未加载
评论 #7410880 未加载
otterley大约 11 年前
I don&#x27;t understand how the solution described actually solves the problem. There&#x27;s a (yawn-inducing) solution given for installing Gems outside the Ruby library path (i.e., in one&#x27;s homedir), but none for actually selecting the version of Ruby to build those Gems against. A Gem with C bindings built against the 1.9.3 shared libraries is unlikely to work (and might not even be found) when subsequently used under 2.0.0.
asdafa大约 11 年前
This post miss completely the main purpose of projects like rvm and rbenv.
评论 #7410404 未加载
评论 #7409985 未加载
malandrew大约 11 年前
More languages need to go the Leiningen&#x2F;Clojure route and make the language version work in a way similar to import&#x2F;require statements or be specifiable in a manifest file. IIRC, with lein you specify the clojure language version you want in the project manifest file.<p>For interpreted languages, I don&#x27;t know why we can&#x27;t just do something like:<p><pre><code> #!&#x2F;usr&#x2F;bin&#x2F;env ruby-2.1.1 </code></pre> In the main() file of our application.<p>Languages in general would be better off designed around having an executable that bootstraps loading the version appropriate for the code you are trying to execute. i.e. the `ruby` executable shouldn&#x27;t be versioned, but instead be designed to to determine the version of ruby you need and then execute your code using that version. The obvious way is to have user&#x27;s specify the version they need, but there is nothing stopping someone from creating a tool from each language that does nothing more than trying to parse the AST for a language and searching for tokens and language features that identify that code as being executable with version X, Y or Z. Furthermore, the language could easily keep a key-value db on disk whose sole responsibility is keeping keys that are the absolute path of the file on disk and the values are the mtime and sha256 of the file and the version of the language with which to execute that file when not explicitly stated in the file or program manifest.
atmosx大约 11 年前
People who up-voted this have no idea what rvm&#x2F;rbenv&#x2F;etc are about.. right?!
why-el大约 11 年前
This is a good solution if you simply want to keep up with Ruby&#x27;s development or you usually work with one version at a time, but not for projects where you mix and match. For instance, at my work we use multiple Rubies, including jruby, and a tool such as rvm is a must in this case.
TuxLyn大约 11 年前
WOW OpenBSD 5.5 will ship Ruby 2.1.0 ^_^ OP have you tried Arch Linux ? It already has v2.1.1 &gt; <a href="https://www.archlinux.org/packages/extra/x86_64/ruby/" rel="nofollow">https:&#x2F;&#x2F;www.archlinux.org&#x2F;packages&#x2F;extra&#x2F;x86_64&#x2F;ruby&#x2F;</a> Any future release if not in official repo&#x27;s then in testing. You can also find more info on official wiki here, <a href="https://wiki.archlinux.org/index.php/Ruby" rel="nofollow">https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;index.php&#x2F;Ruby</a>
bradleyland大约 11 年前
If you&#x27;re exposing your Ruby to the internet -- as in building web apps with it -- you should strongly consider <i>not</i> using your distribution&#x27;s Ruby, and relying on a tool that will allow you to install new releases more quickly. There have been some pretty important CVEs issued over the last couple of years. Not having the ability to quickly update, test, and deploy a new interpreter version is a pretty significant liability.
ElliotH大约 11 年前
I use rbenv because projects want different versions of ruby, and being able to switch without thinking is very helpful. It&#x27;s not like I&#x27;m lacking up to date copies of Ruby on Arch either.
alrs大约 11 年前
This only makes sense if you are going to prod with openbsd.<p>For everyone else, do your development in a VM that matches prod. Use distro packaged Ruby.
schappim大约 11 年前
Hmmm I use RVM for gemsets. Managing and being able to switch between different sets of potentially conflicting sets of gems is a huge use case for RVM!