Which RoR to run on Mac OS X for a particular RoR app.

I am extremely new to RoR, I am. I am slowly but surely learning Ruby
and the Rails concepts but the environment is confusing.

I have an application that was written for my company in RoR. It is on a
ubuntu server that is going to be shut down. I want to move the app to
my two Macs (one Leopard and one Snow Leopard). We want to keep the app
to demo a business concept but it can run locally exclusively
(localhost). So I want to move it to my Macs from the shared Ubuntu
server. I am concerned about Rails and Ruby backwards compatibility; and
if there are any particular sand traps please let me know. Also why does
gem list --local seem to indicate the Macs have multiple versions? Is
this bad? And what should I do to insure I have compatible Mac RoRs for
running the app.

The current Ubuntu is:
gem list --local
*** LOCAL GEMS ***
actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
builder (2.1.2)
capistrano (2.5.4)
curb (0.3.2)
daemons (1.0.10)
fastthread (1.0.1)
GData (0.0.4)
highline (1.5.0)
hoe (1.9.0)
hpricot (0.6.164)
mysql (2.7)
net-scp (1.0.2)
net-sftp (2.0.2)
net-ssh (2.0.10)
net-ssh-gateway (1.0.1)
parseexcel (0.5.2)
passenger (2.0.6)
rack (0.9.1)
rails (2.2.2)
rak (1.0)
rake (0.8.4, 0.8.3)
rcov (0.8.1.2.0)
roo (1.2.3)
rubyforge (1.0.3)
rubyzip (0.9.1)
uuidtools (1.0.7)
ruby - v
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

Rob Th wrote in post #966620:

I am extremely new to RoR, I am. I am slowly but surely learning Ruby
and the Rails concepts but the environment is confusing.

I have an application that was written for my company in RoR. It is on a
ubuntu server that is going to be shut down. I want to move the app to
my two Macs (one Leopard and one Snow Leopard). We want to keep the app
to demo a business concept but it can run locally exclusively
(localhost). So I want to move it to my Macs from the shared Ubuntu
server. I am concerned about Rails and Ruby backwards compatibility; and
if there are any particular sand traps please let me know. Also why does
gem list --local seem to indicate the Macs have multiple versions? Is
this bad? And what should I do to insure I have compatible Mac RoRs for
running the app.

Use RVM and setup exactly the same environment that is currently on the
Ubuntu box and all should be well with the world:

http://rvm.beginrescueend.com/

Thanks. I found the rvm and installed it. I think...

xxxxiMac:~ uxxx$ rvm gemdir
/Library/Ruby/Gems/1.8

But this is sooo confusing. I do not think this is what I want. I do not
want to switch around from different ruby versions. In fact, the version
I have on my iMac is the same as the one on my Ubuntu server. 1.8.7

I would be happy to just delete the old and newer versions of rails and
just keep the 2.2.2 version.

I don't think I need the tricked-out rvm.

Can you help me figure out how to remove the other versions of Rails?

R

Rob Th wrote in post #966660:

Thanks. I found the rvm and installed it. I think...

xxxxiMac:~ uxxx$ rvm gemdir
/Library/Ruby/Gems/1.8

But this is sooo confusing. I do not think this is what I want.

But you are probably wrong.

I do not
want to switch around from different ruby versions. In fact, the version
I have on my iMac is the same as the one on my Ubuntu server. 1.8.7

But RVM also lets you switch between different gemsets, which *is* what
you want.

Best,

Phew, this is getting even more confusing. Why do I "want to switch
between gemsets".

I want the version of rail on my Mac to match the Ubuntu which is 2.2.2!

I want the other versions of rails to go bye-bye. How do I do that?

Why would your *think* I want to switch?

Please quote when replying.

Rob Th wrote in post #966668:

Phew, this is getting even more confusing. Why do I "want to switch
between gemsets".

So that you can have your Ruby interpreter see only the gems you want it
to see.

I want the version of rail on my Mac to match the Ubuntu which is 2.2.2!

I want the other versions of rails to go bye-bye. How do I do that?

By using RVM or Bundler. Take your pick. (There are other ways, but
those tools make life simpler than the other options.)

Why would your *think* I want to switch?

Because that's exactly what you're saying you want. You've said "I want
my Rails application to see these particular gems, and no others".
That's basically the definition of a defined gemset.

Best,

Sorry, I interpreted you remarks as "switch" back and forth. I want to
'blow away' - remove - delete all rails except 2.2.2.

Ok, so how do I use rvm to remove the other versions of rails from Macs?

Please quote when replying!

Rob Th wrote in post #966685:

Sorry, I interpreted you remarks as "switch" back and forth. I want to
'blow away' - remove - delete all rails except 2.2.2.

"RVM also lets you switch between different gemsets" usually means
switch between.

Yes. It's usually best to have a separate gemset for each Rails
application. That way, each application sees only the gems it needs.

I just want one version.

No, you probably want one version *per application*.

I still think rvm is confusing.

It's a lot less confusing that any of the other gem management solutions
I'm aware of. Try it!

Ok, so how do I use rvm to remove the other versions of rails from Macs?

You don't need to. Just declare a gemset that doesn't include the gems
you don't want.

Or is there a another way?

Well, you needn't usually worry too much. Gems are designed so that
multiple versions can coexist, and Rails applications pick the version
they want in the environment.rb file.

Best,

PLEASE, do not tell me what I want, I WANT to get rid of all versions of
rails besides 2.2.2.

This is the infuriating thing about RoR. People tell me what I want when
I tell them what I want and what they want me to want is not want I
want. jeez.

For the third time, please quote when replying.

Rob Th wrote in post #966691:

PLEASE, do not tell me what I want, I WANT to get rid of all versions of
rails besides 2.2.2.

This is the infuriating thing about RoR. People tell me what I want when
I tell them what I want and what they want me to want is not want I
want. jeez.

You yourself said you're new to Ruby and Rails. Please try to
understand the usual Ruby and Rails ways of doing things before you
decide to do things differently. That means understanding how to manage
gems properly, not just deleting things you don't understand.

You posted here asking for advice. Don't ignore the advice you're
getting because it isn't exactly what you wanted to hear.

Best,

Give me a break.

I asked a question.

To uninstall a gem version you have 2 options:

a) Declare the version at the end of the uninstall command: gem
uninstall my_gem -v=x.x.x (You replace the 'x.x.x' with the version
you want to remove, OR
b) Run the uninstall command without version specified: gem uninstall
my_gem

Option b) will prompt you which version you want to remove out of all
the versions you have loaded but if you only have one version it will
go ahead and remove just that one without asking.

Just a note about the 'what you wants'. I don't know if it will be
your case but I'm not a native English speaker and when I first talked
to native speakers it bothered me a lot the 'no, what you want is...',
then I realized that it's just their way of saying 'what you probably
should do is...', or I take it that way. It has never bothered me
since I saw it that way.

Thanks pepe,

RobsMacAir:~ rob$ rails -v
Rails 2.3.8
RobsMacAir:~ rob$ gem uninstall my_gem -v=2.3.8
ERROR: While executing gem ... (Gem::InstallError)
    Unknown gem my_gem = 2.3.8
RobsMacAir:~ rob$

??

I want to uninstall everything besides 2.2.2

pepe wrote in post #966708:
[...]

Just a note about the 'what you wants'. I don't know if it will be
your case but I'm not a native English speaker and when I first talked
to native speakers it bothered me a lot the 'no, what you want is...',
then I realized that it's just their way of saying 'what you probably
should do is...', or I take it that way. It has never bothered me
since I saw it that way.

Yes, that's how I meant it. Sorry for any misunderstanding.

Best,

Ok, but do you know how to actually erase the old versions of rails. The
last suggestion did not work as you can see from my terminal session.

You have to put the name of the gem you want to uninstall instead of
my_gem. That was just an example. Are you sure you are cut out for
this? In your case you want to uninstall the rails gem, so
gem uninstall rails.
Dependant on which environment you are running in you may have to use
sudo on the front. Do that if you used sudo to install it.
gem list will show all the gems you have installed by the way.

Colin

Thanks, Colin. I live in literalville.

I tried as I think you suggested and got this.

Select gem to uninstall:
1. rails-2.3.8
2. rails-2.3.8
3. All versions

3

Remove executables:
  rails

in addition to the gem? [Yn]
Removing rails
Successfully uninstalled rails-2.3.8
Remove executables:
  rails

in addition to the gem? [Yn]
Removing rails
Successfully uninstalled rails-2.3.8
RobsiMac:~ rob$ rails -v
-bash: /usr/bin/rails: No such file or directory
RobsiMac:~ rob$ gem list --local

*** LOCAL GEMS ***

actionmailer (2.3.8, 2.3.5, 2.2.2, 1.3.6)
actionpack (2.3.8, 2.3.5, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.8, 2.3.5, 2.2.2, 1.15.6)
activeresource (2.3.8, 2.3.5, 2.2.2)
activesupport (2.3.8, 2.3.5, 2.2.2, 1.4.4)
acts_as_ferret (0.4.3)
capistrano (2.5.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
dnssd (0.6.0)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
highline (1.5.0)
hpricot (0.6.164)
libxml-ruby (1.1.2)
mongrel (1.1.5)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.1, 1.1.1)
net-ssh (2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)
rack (1.1.0, 1.0.1)
rails (2.3.5, 2.2.2, 1.2.6)
rake (0.8.3)
RedCloth (4.1.1)
ruby-openid (2.1.2)
ruby-yadis (0.3.4)
rubynode (0.1.5)
rvm (1.1.3)
sqlite3-ruby (1.2.4)
termios (0.9.4)
xmpp4r (0.4)
RobsiMac:~ rob$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
RobsiMac:~ rob$ rails -v
-bash: rails: command not found

I expected after deinstalling rails 2.3.8 gem list local would find the
other rails versions. But did this blow away all rails?

I admit I am in learning mode. I thought this was a place to help out
beginners. I have been programming in Assembler, C, and tons of SQL and
now some PHP and writing shell scripts since the late 70s, and the
complexity and impreciseness of the books and tutorials are amazing RoR,

Is there a way to just go into the file system, and delete all the
directories for Rails and just do a fresh reinstall. I cannot figure out
rvm,

Thanks, Colin. I live in literalville.

I tried as I think you suggested and got this.

Select gem to uninstall:
1. rails-2.3.8
2. rails-2.3.8
3. All versions

3

Remove executables:
rails

in addition to the gem? [Yn]
Removing rails
Successfully uninstalled rails-2.3.8
Remove executables:
rails

in addition to the gem? [Yn]
Removing rails
Successfully uninstalled rails-2.3.8
RobsiMac:~ rob$ rails -v
-bash: /usr/bin/rails: No such file or directory
RobsiMac:~ rob$ gem list --local

*** LOCAL GEMS ***

actionmailer (2.3.8, 2.3.5, 2.2.2, 1.3.6)
actionpack (2.3.8, 2.3.5, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.8, 2.3.5, 2.2.2, 1.15.6)
activeresource (2.3.8, 2.3.5, 2.2.2)
activesupport (2.3.8, 2.3.5, 2.2.2, 1.4.4)
acts_as_ferret (0.4.3)
capistrano (2.5.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
dnssd (0.6.0)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
highline (1.5.0)
hpricot (0.6.164)
libxml-ruby (1.1.2)
mongrel (1.1.5)
needle (1.3.0)
net-scp (1.0.1)
net-sftp (2.0.1, 1.1.1)
net-ssh (2.0.4, 1.1.4)
net-ssh-gateway (1.0.0)
rack (1.1.0, 1.0.1)
rails (2.3.5, 2.2.2, 1.2.6)

Note the above

rake (0.8.3)
RedCloth (4.1.1)
ruby-openid (2.1.2)
ruby-yadis (0.3.4)
rubynode (0.1.5)
rvm (1.1.3)
sqlite3-ruby (1.2.4)
termios (0.9.4)
xmpp4r (0.4)
RobsiMac:~ rob$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
RobsiMac:~ rob$ rails -v
-bash: rails: command not found

I expected after deinstalling rails 2.3.8 gem list local would find the
other rails versions. But did this blow away all rails?

No, 2.3.5, 2.2.2 and 1.2.6 are still installed as noted above

I admit I am in learning mode. I thought this was a place to help out
beginners. I have been programming in Assembler, C, and tons of SQL and
now some PHP and writing shell scripts since the late 70s, and the
complexity and impreciseness of the books and tutorials are amazing RoR,

I can't say that I agree with you here. What _is_ confusing is that
there are so many out of date tutorials and mailing list archive
entries that are found when searching for data on rails. This is
inevitable unfortunately if you want to experiment with fast moving
technologies like Rails. All the ones you mention have been little
changed for decades so the documentation is stable.

Is there a way to just go into the file system, and delete all the
directories for Rails and just do a fresh reinstall. I cannot figure out
rvm,

I don't understand why you want to that. What is the problem you are
having? Having multiple versions of things is not an issue provided
you have the versions you need and they are specified in your app. It
will then use those versions.

Looking back at the OP I see that you are trying to get an existing
app running. Why not just concentrate on that and sort out the
problems as you come to them?

Colin

"No, 2.3.5, 2.2.2 and 1.2.6 are still installed as noted above"

Whoops. Yeah I bought two books on RoR and google like crazy to find
help and information. The tutorials online assume one is pretty much up
to speed kind of like a cooking show half way in (what white sauce we
just made?) The books deal with programming fairly well but not the
config stuff - especially Mac.

I would just feel 100% more confident going into getting this app
running if I knew the "environment" was clean and pure. And only one
version of the software loaded. As you mention this stuff changes a lot.
For example why is rails -v not working. As you said the command left
the other versions.

BTW, I do not agree that this is merely a time issue. I programmed on C
on a PDP when there was exactly one book. Writing and compiling C is a
piece of cake compared to RoR.

So I appreciate asking "why", but I would just love a "how". How do I
blow away all RoR completely and then I think a gem install of version
2.2.2 would work.

Rob Th wrote in post #966868:
[...]

The books deal with programming fairly well but not the
config stuff - especially Mac.

Then you're reading the wrong books. Most Rails developers work on Mac
OS.

I would just feel 100% more confident going into getting this app
running if I knew the "environment" was clean and pure. And only one
version of the software loaded.

Right. So create a pristine gemset with RVM for your project and have
done with it.

[...]

Why is there such a resistance to blowing away - deleting - RoR? Is it
that no one actually knows how to do it? Or is there some sort of
religious thing about deleting old versions of Rails?

Neither. We do know how to do it, and several of us have told you how.
But we have also told you that it unnecessary in your particular
situation -- gems are designed to coexist in multiple versions, and
anyway RVM can make a pristine environment for you any time you want.

Why is there such a resistance to following the advice of more
experienced developers? Really, we *do* know what we're talking about
here, and by your own admission, you don't. So follow our advice to get
up to speed with how Rails usually works, then go experiment all you
like!

Best,