Permalink
Browse files

How did I miss this

  • Loading branch information...
1 parent a727d55 commit 8dab540720d13dcc1805773ebf0eda357936d6a0 @jbarnette jbarnette committed Feb 15, 2013
Showing with 1 addition and 1 deletion.
  1. +0 −1 .gitignore
  2. +1 −0 .ruby-version
View
@@ -1,6 +1,5 @@
/.bundle
/.librarian
-/.ruby-version
/.snapshot
/.tmp
/bin
View
@@ -0,0 +1 @@
+system

20 comments on commit 8dab540

@kevinSuttle
Member

This stays in place, disallowing overrides. E.g:

SuttleMac:repo kevinsuttle$ rbenv version
system (set by /opt/boxen/repo/.ruby-version)
SuttleMac:repo kevinsuttle$ rbenv global 1.9.3-p392
SuttleMac:repo kevinsuttle$ rbenv version
system (set by /opt/boxen/repo/.ruby-version)
@wfarr
Member
wfarr commented on 8dab540 Mar 5, 2013

So ./.ruby-version always supersedes the default system ruby. The global version is literally that — a default that other things will override on a case-by-case basis.

Boxen should, for now, always run under the system ruby. There are a handful of reasons behind this, mostly being consistency between first run and (N>1)th run.

@kevinSuttle
Member

Hm. So, why install the other versions, including Github's custom build? Sorry, just trying to figure out how this works under the hood. Thanks.

@kevinSuttle
Member

I'm used to RBenv or RVM handling issues like this too:

You don't have write permissions into the /Library/Ruby/Gems/1.8 directory

Also, lots of gems depend on 1.9+ don't they? How are we getting around this?

@kevinSuttle
Member

Obviously, sudo, but I'm confused about the overall workflow. Thanks.

@ericanderson
Contributor

Because boxen depends on the system ruby, a known constant in mac land. Even if you fuckup your boxen install or don't install rbenv + rubies, boxen will still work.

They install newer verisons of ruby because most of us want to use the latest. You are free to remove those lines from your site.pp

@kevinSuttle
Member

So, how would I get Rbenv playing nice with Boxen again? How do we use the latest if Boxen needs the system? Sorry, this kind of stuff is a bit foreign to me.

@ericanderson
Contributor

YOu let boxen install rbenv. You should uninstall it before installing boxen. This commit makes it so that this project uses the system ruby always.

@wfarr
Member
wfarr commented on 8dab540 Mar 6, 2013
@kevinSuttle
Member

So, I understand the following points:

  1. Boxen uses and relies upon system ruby in .ruby-version
  2. Boxen installs Rbenv
  3. Your standard install of Rbenv should be removed before installing Boxen because it includes its own version of Rbenv

What I don't understand.

  1. Why I can't, or how I can use, Boxen's Rbenv to change the version of Ruby I'm using on my machine (as opposed to the default).

Apologies if this is obvious, or I'm just not getting it.

@ericanderson
Contributor
@jbarnette
Member

@kevinSuttle You can. You just can't change the version of Ruby boxen uses to run itself.

@kevinSuttle
Member

I want to change the global system Ruby, not the boxen Ruby. See previous comment: 8dab540#commitcomment-2739526

@ericanderson
Contributor

Ah, I think this is a misunderstanding about how rbenv works. It walks up your PWD looking for a .ruby-version file. If it finds one, thats the ruby you get no matter what. If it doesn't, it falls back to the global one. (its important to not mix up global and system here).

After making that global call, you should be able to type "cd; rbenv version" and get what you want. You just can't have anything but system ruby in any of the boxen repo directories.

@kevinSuttle
Member

I'm sure I'm misunderstanding. Yes, global vs system: didn't realize there is a difference.

So, if I place a .ruby_version in my ~/Code directory for example, I can have it be something other than system?

@kevinSuttle
Member

TBH, it's probably a misunderstanding about rubygems too for me.

@ericanderson
Contributor
@kevinSuttle
Member

Interesting. How does that affect installing gems? Maybe I'm expecting rubygems to function like npm, being able to install both globally and locally. Do Ruby devs only install gems per-project with Gemfiles and Bundles?

@jbarnette
Member

@kevinSuttle gems are managed in isolation for each rbenv-provided Ruby version. Per-project varies by developer. At GitHub we rarely install global gems.

@kevinSuttle
Member

Interesting. I know about how Rbenv does it (I use default-gems), but wasn't aware of the convention to not install global gems. Thanks!

Please sign in to comment.