简体   繁体   English

Ruby on Rails-版本2.3.8的机车-有这样的事情吗?

[英]Ruby on Rails - Locomotive for version 2.3.8 — is there such a thing?

I am looking for a piece of software that will allow me to use Ruby on Rails 2.3.8 on top of MACOSX - basically, I teach at a college where students are not able to get terminal acccess to the rails built into OSX so I am looking for a piece of software like "Locomotive" that is an app that allows students to use rails without administrator access to the computer itself. 我正在寻找一款允许我在MACOSX之上使用Ruby on Rails 2.3.8的软件-基本上,我在一所大学里任教,学生无法获得OSX内置的Rails的终端访问权限,所以我寻找一款类似“ Locomotive”的软件,该软件可让学生在无需管理员访问计算机本身的情况下使用滑轨。 Any one have any ideas? 有人有想法么?

We will be using Rails 2.3.8 我们将使用Rails 2.3.8

thanks. 谢谢。

I encourage you to teach 3.0, but each to their own. 我鼓励您教3.0,但每个人都要自己教。 If your materials only cover 2.3.8 then it's missing out on a lot of goodies associated with 3.0 (such as Bundler). 如果您的资料仅涵盖2.3.8,则与3.0相关的许多好东西(例如Bundler)都将丢失。 Anyway: 无论如何:

My primary fear with this is that you're going to have an un-upgradable version of Rubygems if you don't have system privileges. 我对此的主要担心是,如果您没有系统特权,那么您将拥有一个不可升级的Rubygems版本。 Some gems require a Rubygems version >= 1.3.5 or even better, 1.3.6. 有些宝石需要Rubygems版本> = 1.3.5或更高版本1.3.6。 Latest is 1.3.7. 最新是1.3.7。 Thankfully, there's a way around it. 幸运的是,有一种解决方法。

You can do this by installing the rvm gem: 您可以通过安装rvm gem来做到这一点:

 gem install rvm --install-dir ~/.gems

RVM is "Ruby Version Manager" and does what it says on the tin: manages different versions of Ruby on your system. RVM是“ Ruby版本管理器”,其功能如其所言:管理系统上不同版本的Ruby。 It'd be helpful in your case because it works without modifying the system Ruby. 这对您有帮助,因为它无需修改系统Ruby就可以工作。

This will install the gem to the user's home directory rather than the default system path. 这会将gem安装到用户的主目录,而不是默认系统路径。 Then you'll need to run the rvm-install command which, as of this writing is: 然后,您需要运行rvm-install命令,截至撰写本文时,该命令是:

 ~/.gems/rvm-1.0.14/bin/rvm-install

Your version of RVM may be different. 您的RVM版本可能有所不同。 To install a new version of Ruby which people can (ab)use run: 要安装人们可以使用的新版本Ruby,请运行:

 rvm install ruby-1.9.2-p0

1.9.2 is the latest stable version of Ruby and I highly encourage you use it rather than the older 1.8.7. 1.9.2是Ruby的最新稳定版本,我强烈建议您使用它,而不要使用旧的1.8.7。

This should come with the latest Rubygems and, for bonus points, won't muddle about with the existing ruby installation on the machine (which is probably impossible if you don't have admin rights). 它应该随最新的Rubygems一起提供,并且要获得加分,也不会与计算机上现有的ruby安装混为一谈(如果您没有管理员权限,这可能是不可能的)。

From this point, you'll be able to use 至此,您将可以使用

 rvm use ruby-1.9.2-p0

to "switch" to that specific ruby. “切换”到该特定的红宝石。 From there, you'll be able to do run gem install rails -v 2.3.8 which will install Rails somewhere in ~/.rvm . 从那里,您将能够运行gem install rails -v 2.3.8 ,它将在~/.rvm某个位置安装Rails。 The location is not important. 位置并不重要。 What is important however is that now you'll have a rails command that you can use and then you can go from there. 但是重要的是,现在您将具有可以使用的rails命令,然后可以从那里开始。

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM