Brew + RVM

61 views
Skip to first unread message

Jeff Schmitz

unread,
Apr 6, 2012, 7:40:07 AM4/6/12
to stl...@googlegroups.com
I just installed brew and it appears to mess up rvm

Details - I installed using the alternate one-liner:
  mkdir homebrew && curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew


now ruby -v is back to system 1.8.7

Any idea why?  (I'm new to brew - not sure what brew does to my system).

Do I need to brew install rvm, reinstall rvm, or uninstall brew?

Brent Beer

unread,
Apr 6, 2012, 11:10:38 AM4/6/12
to stl...@googlegroups.com
Jeff, 

My guess is since brew handles pointing stuff at local directory that you should just 'rvm install (blank)'where blank is your ruby version.

Furthermore, it may just be me, but I use a specific gemset for each project. 

I think there's a rails 3 guide online (some long web based book basically)..a QuickStart guide, that directs you on using rvm gemsets, heroku to deploy, and a .rvmrc file in each directory to better handle switching between the rubies.

Give this a search and just use rvm that way
--
You received this message because you are subscribed to the Google Groups "Saint Louis Ruby Users Group" group.
To post to this group, send email to stl...@googlegroups.com.
To unsubscribe from this group, send email to stlruby+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/stlruby?hl=en.

Jeff Schmitz

unread,
Apr 6, 2012, 11:15:20 AM4/6/12
to stl...@googlegroups.com
Thanks Brent, but I did figure out the problem.

My installation wasn't the problem, I modified my .bash_profile and rvm was no longer found.  Brew + rvm appear to be happy together

jeff

Amos King

unread,
Apr 8, 2012, 8:23:20 AM4/8/12
to stl...@googlegroups.com

If you use bundler then gemsets are only causing you to install more copies of the same gem.

Brent Beer

unread,
Apr 8, 2012, 9:14:20 PM4/8/12
to stl...@googlegroups.com
So you're suggesting to not use Bundler at all?

Michael Bishop

unread,
Apr 9, 2012, 12:00:05 PM4/9/12
to stl...@googlegroups.com
Bundler is essential and if you work on multiple projects, there is virtually no way to get around multiple copies of gems on your machine. Gemsests + RVM help keep conflicts down. 

--

Michael Bishop
Principal | TheAbleFew.com

St. Louis:  314.537.6723
Indianapolis: 317.572.7083

Brent Beer

unread,
Apr 9, 2012, 12:36:39 PM4/9/12
to stl...@googlegroups.com
Agreed Mike. I didnt want to fill my email with "lolololol" at the suggestion of not using bundler. but seriously good luck to anyone who wants to try to avoid using it, amirite?

Jeff Barczewski

unread,
Apr 9, 2012, 1:00:32 PM4/9/12
to stl...@googlegroups.com
I don't know if anyone is interested, but as an experiment, I created a replacement for rvm (called brb, which is short for Bundled Rubies or Bundled Ruby) that allowed you to install arbitrary rubies, and gemsets using bundler and it supported the idea of sharing gems across projects (so you woudn't need to have multiple copies even across rubies if they were pure ruby). It leveraged having multiple ruby gemset_paths. It worked more like bundler in the fact that you would specify things you want (all the rubies and gemsets) then run build and it would go out and build everything for you.

I had done this because I didn't like how RVM worked (duplicating so many gems) and how complicated the code was (I was trying to find a bug buried in nested undocumented shell scripts with no tests).

I got it all working but was going to go back and refactor into something nicer, but also realized that I was using a feature in bash called associated arrays which was added in bash version 4 which has been out for a while, but the default Mac OS X was bash 3, so this was not ideal (especially considering the number of Mac users using ruby).

It was after this that I switched to node.js development and didn't work on it much since.

If anyone is interested I could put it up on github, but I haven't had time to refine it and/or figure out what to do with converting from associated arrays (if it was to be able to use on Mac OS X without upgrading bash).

All the best,

Jeff

Amos King

unread,
Apr 9, 2012, 1:04:00 PM4/9/12
to stl...@googlegroups.com

Use bundler and not gemsets was my suggestion.

--
You received this message because you are subscribed to the Google Groups "Saint Louis Ruby Users Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/stlruby/-/Kn_hpg4uzsIJ.

Jeff Barczewski

unread,
Apr 9, 2012, 1:06:55 PM4/9/12
to stl...@googlegroups.com
For apps, I agree, using bundler is great.

However you do often need some gems installed before you drop into working in an app, for instance you need to run rails to generate an app, so you often need certain things installed before you jump into working in an app.

So it is for these things that you need outside of an app that gemsets are nice (but duplicated in every ruby I would use).
--
Jeff Barczewski
Inspired Horizons
http://inspiredhorizons.com/
Professional Software Craftsmanship

Amos King

unread,
Apr 9, 2012, 1:08:41 PM4/9/12
to stl...@googlegroups.com

Run the version you want when starting the app. Or create a gemfile first.

Jeff Barczewski

unread,
Apr 9, 2012, 1:20:16 PM4/9/12
to stl...@googlegroups.com
If you project needs to be able to generate apps in all my rubies (if one of its purposes is a generator) and be tested in each, then again it means installing for each and every ruby.

Also when using bundler it did not have to reinstall the gems locally for each app, if it could find the appropriate versions in my gempaths, so I didn't need as much duplication across all my apps, it would just use the right gem already available..

Maybe I am the only one who ever had these issues or disliked all the duplication :-)

Iouri Kostine

unread,
Apr 9, 2012, 1:35:39 PM4/9/12
to stl...@googlegroups.com
You can also use @global gemset, any gem added there will be available in all other gemsets for that ruby version.
2c

iouri kostine
Partner | TheAbleFew.com

Mobile: 314.600.5473

St. Louis:  314.537.6723
Indianapolis: 317.572.7083

Jeff Barczewski

unread,
Apr 9, 2012, 1:38:05 PM4/9/12
to stl...@googlegroups.com
RVM provides (>= 0.1.8) a @global gemset per ruby interpreter.

It helps, but you still install a copy for each and every ruby interpreter you use.

Brent Beer

unread,
Apr 9, 2012, 1:43:54 PM4/9/12
to stl...@googlegroups.com
Iouri beat me to it! yes, @global

Amos King

unread,
Apr 9, 2012, 1:44:45 PM4/9/12
to stl...@googlegroups.com

You really don't need gem sets. You have to install for each ruby, but that is the ame either way. Gem sets are frustrating. Just use bundler that is what it is for. It also resolves dependencies.

Richard K Jordan

unread,
Apr 9, 2012, 1:44:58 PM4/9/12
to stl...@googlegroups.com
I am not a fan of the duplication, but drive space is no longer premium, so it hasn't grated enough to fix yet.

Jeff Barczewski <jeff.ba...@gmail.com> wrote:

>If you project needs to be able to generate apps in all my rubies (if one
>of its purposes is a generator) and be tested in each, then again it means
>installing for each and every ruby.
>
>Also when using bundler it did not have to reinstall the gems locally for
>each app, if it could find the appropriate versions in my gempaths, so I
>didn't need as much duplication across all my apps, it would just use the
>right gem already available..
>
>Maybe I am the only one who ever had these issues or disliked all the
>duplication :-)
>
>
>
>
>On Mon, Apr 9, 2012 at 12:08 PM, Amos King <amos....@gmail.com> wrote:
>
>> Run the version you want when starting the app. Or create a gemfile first.

>> On Apr 9, 2012 12:06 PM, "Jeff Barczewski" <jeff.ba...@gmail.com>

Amos King

unread,
Apr 9, 2012, 2:10:16 PM4/9/12
to stl...@googlegroups.com

Yes but my time is not and so waiting to reinstall a bunch of gems is worth not having gem sets.

Brent Beer

unread,
Apr 9, 2012, 2:15:30 PM4/9/12
to stl...@googlegroups.com
How many times do you need to reinstall gems?

Jeff Barczewski

unread,
Apr 9, 2012, 2:34:40 PM4/9/12
to stl...@googlegroups.com
Whether you use the global gemset or some named gemsets, or you loosely install , it is useful to have some gems installed so they are available outside of an app space (where bundler's domain comes in). 

gemsets the way rvm implements is not ideal because everytime you want to use a new ruby instance you need to reinstall them for that ruby instance. 

To me, project owners that are building tools to use across many ruby implementations (mri-1.8, mri-1.9, jruby, rubinius, mri-1.9.3, mri-head, ...) need to be able to easily test across each of these environments.

I hated having to reinstall a bunch of stuff each and everytime I wanted to try a new version of a ruby interpreter/compiler.

I guess if you never do this, then it is not a problem.

So I am in agreement that I don't like how rvm uses gemsets, but I also don't agree that bundler by itself gives me everything I need. Pure ruby shared gemsets are nice in that you don't need to reinstall for new rubies.

All that being said, it isn't a problem for me right now since I am working in node.js which has its own complexities that I am working on solutions for  :-)

Anyway, thanks for the discussions. It is good to understand how people use their tools (best practices) to avoid issues and pain. 

All the best,

Jeff

Richard K Jordan

unread,
Apr 9, 2012, 2:44:52 PM4/9/12
to stl...@googlegroups.com
True, they are really essential only when you have older, pre-bundler projects in the mix. Nobody supports those, right? =)

Amos King <amos....@gmail.com> wrote:

>> >>>>> All the best,
>> >>>>>
>> >>>>> Jeff
>> >>>>>
>> >>>>>

Amos King

unread,
Apr 15, 2012, 2:52:40 PM4/15/12
to stl...@googlegroups.com
Every time someone on my team updates gems, or if I have to stand up a new development machine, or starting a new project. Frequently enough that a useless feature if I'm using bundler is not worth my time. I write Ruby full time and have many projects that I work on. This is a frequent issue for me.

Brent Beer

unread,
Apr 15, 2012, 3:07:17 PM4/15/12
to stl...@googlegroups.com
Yes, I also work with ruby full time and have about 5 apps daily that I switch between as well, and never run into this problem due to gemsets, as is the case for the entire team (~9 people) that I work with.

If we didnt have these gemsets we'd be in dependency hell with apps ranging from 1.8.7 to 1.9.3 and everywhere in between.

Amos King

unread,
Apr 15, 2012, 3:09:33 PM4/15/12
to stl...@googlegroups.com
If your using bundle to load your dependencies then why would you have gemsets. I understand each version of Ruby will have it's own gemset. Why do you need project level gemsets?

Brent Beer

unread,
Apr 15, 2012, 3:38:09 PM4/15/12
to stl...@googlegroups.com
Ah, I thought you were arguing against different versions of ruby having different gemsets! 

Different projects usually have their own gemset merely out of "just in case" situations because it's so easy to manage and because they dont often change but the versions may differ slightly between projects

Amos King

unread,
Apr 15, 2012, 3:45:11 PM4/15/12
to stl...@googlegroups.com
The dependency issues should be handled by bundler and shouldn't matter for you.

Mark Sands

unread,
Apr 15, 2012, 8:55:49 PM4/15/12
to stl...@googlegroups.com
I personally believe that the bike shed looks better blue.

Amos King

unread,
Apr 15, 2012, 8:59:53 PM4/15/12
to stl...@googlegroups.com

Red

Amos King

unread,
Apr 15, 2012, 9:01:02 PM4/15/12
to stl...@googlegroups.com

I personally wouldlike to understand so I can learn. I want to know what color makes the best shed.

On Apr 15, 2012 7:56 PM, "Mark Sands" <marks...@gmail.com> wrote:

Richard K Jordan

unread,
Apr 15, 2012, 10:52:22 PM4/15/12
to Amos King, stl...@googlegroups.com
They were supposed to be green.

Sorry, couldn't resist the red dwarf reference.

Reply all
Reply to author
Forward
0 new messages