When installing Hobo it installed a previous version of rails in my system, is it going to mess up things?

StackOverflow https://stackoverflow.com/questions/12151947

Pregunta

I am (was?) using rvm with ruby 1.9.3 and rails 3.2.8.

I decided to give Hobo rails plugin a try and so i followed the instructions on Hobo site which say you only need to type:

gem install hobo

which outputted:

Successfully installed activesupport-3.0.17

Successfully installed builder-2.1.2

Successfully installed i18n-0.5.0

Successfully installed activemodel-3.0.17

Successfully installed rack-1.2.5

Successfully installed rack-test-0.5.7

Successfully installed rack-mount-0.6.14

Successfully installed abstract-1.0.0

Successfully installed erubis-2.6.6

Successfully installed actionpack-3.0.17

Successfully installed arel-2.0.10

Successfully installed activerecord-3.0.17

Successfully installed activeresource-3.0.17

Successfully installed mail-2.2.19

Successfully installed actionmailer-3.0.17

Successfully installed railties-3.0.17

Successfully installed rails-3.0.17

Successfully installed hobo_support-1.3.0

Successfully installed hobo_fields-1.3.0

Successfully installed dryml-1.3.0

Successfully installed will_paginate-3.0.3

Successfully installed hobo-1.3.0

So as you can see it installed rails 3.0.17 and lots of older version gem that work good with rails 3.0.17

i typed rails -v and it still says 3.2.8 (also after logging out and back in from shell)

I am quite puzzled about that now. Is my rails installation messed up ? Does rvm automatically manage more rails versions at the same time ? How can those gem binaries (like rails command itself, for example) not overwrite themselves? Shouldn't I get rails 3.0.17 if i type rails -v since I just installed it? Shouldn't that also happen for the other gems that came with it?

I hope someone can clarify it to me.. I am tired of reinstalling ruby and rails.. sometime it feels like it's kind of a too much delicate ecosystem (young/immature) that all of a sudden can break down... :\ Sorry for the quick rant ;)

¿Fue útil?

Solución

As ruralocity indicated, it's your gemfile and gemfile.lock that indicate what gems are loaded. Rvm gemsets were a godsend with rails 2, but they are not worth the hassle for rails 3.

You will have to downgrade your app to rails 3.0 if you ant to use hobo 1.3. Alternatively you can use the version of hobo from github, which works with rails 3.2. I recommend the latter. Hobo 1.4 is very stable and very close to release.

The other caveat is that while rails automatically uses gemfile.lock, other command line apps may not. Get into the habit of typing ‛bundle exec rake‛ instead of just rake.

Otros consejos

This is where Bundler and your application's Gemfile should come into play. rails -v will show whatever the most recent version you have installed is; however, your Gemfile can specify an older version. All these versions can live happily alongside one another, provided your Gemfile specifies the version your application uses. So as long as your Rails application's gemfile has the line

gem 'rails', '3.2.8'

you should be fine even with multiple versions of Rails installed. Use gem list to see all the versions of your installed gems.

You can add to the gem isolation, if you'd like, using RVM gemsets. You may just find that it adds complexity, though. See https://rvm.io/gemsets/ for more information.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top