Fubar and Gemfile.lock

Hi All,
In trying to port a working version from one computer to another
I had installed the requisites and copied over the files in the rails
project. However one method wouldn’t work and it was because the gem
involved wouldn’t work with the newest rails. After uninstalling
rails, reinstalling an earlier version and playing with DevKit, et.
al., I’ve managed to fubar the project so that now it even claims it
can’t find rubygems. So I’m inclined to uninstall gems, the devkit
and rails and then copy over the code again, essentially starting
over.
Question 1) what is the proper method of uninstalling those 3?
Question 2) What is the function of the file “Gemfile.lock”. Should
it be copied over or will it be generated?
Thanks,
Barney

On Sep 29, 2011, at 1:16 PM, Barney wrote:

Question 1) what is the proper method of uninstalling those 3?
Question 2) What is the function of the file “Gemfile.lock”. Should
it be copied over or will it be generated?
Thanks,
Barney

Let me answer your 2nd question first. The Gemfile.lock specifies the
versions of each gem that were selected to satisfy the dependency
graph. You should copy it over (actually, you should check it into the
repository; you are using a code repository, right?) and then a bundle
install will use those versions. Without Gemfile.lock, it builds a
new dependency graph, either with gems it finds or gems that it
installs, and constructs a new Gemfile.lock with the results.

You can also run bundle package to put all the .gem files into
vendor/cache/ (by default) which can also be kept in the repository.

Copy the Gemfile.lock over and see if bundle install doesn’t just
solve your problem.

-Rob

Rob B.
[email protected] http://AgileConsultingLLC.com/
[email protected] http://GaslightSoftware.com/

Thanks, Rob. I’ll copy over my original tomorrow morning.
Is there anything special I have to know if I still need to start over
(in terms of being careful to delete certain things that uninstall
didn’t uninstall, etc.)?
Barney

On Sep 29, 2:30pm, Rob B. [email protected]

On Sep 29, 2011, at 5:00 PM, Barney wrote:

involved wouldn’t work with the newest rails. After uninstalling

[email protected] http://GaslightSoftware.com/

Thanks, Rob. I’ll copy over my original tomorrow morning.
Is there anything special I have to know if I still need to start over
(in terms of being careful to delete certain things that uninstall
didn’t uninstall, etc.)?
Barney

The bundle install will very likely be all you need. It will install
additional versions of gems if the one that you got originally on the
new machine is different. Then you will almost certainly want to use
bundle install _cmd_ whenever you run a cmd that needs gems to be
sure that you’re getting the right version(s).

-Rob

On Thu, Sep 29, 2011 at 11:09 PM, Rob B.
<[email protected]

wrote:

I had installed the requisites and copied over the files in the rails
Thanks,

[email protected] http://GaslightSoftware.com/
additional versions of gems if the one that you got originally on the new
machine is different. Then you will almost certainly want to use bundle install _cmd_ whenever you run a cmd that needs gems to be sure that
you’re getting the right version(s).

I presume this last sentence has a typo. I presume you intended to say
… "
use bundle exec _cmd_ whenever " …

Like this:

$ bundle install rake environment # probably incorrect
“install” was called incorrectly. Call as “bundle install”.
$ bundle exec rake environment # this is you first test that should pass

HTH,

Peter

rubyonrails-talk+u[email protected]**googlegroups.com[email protected]

.
For more options, visit this group at http://groups.google.com/**

group/rubyonrails-talk?hl=enhttp://groups.google.com/group/rubyonrails-talk?hl=en

.


Peter V.
gsm: +32-478-27.40.69
e-mail: [email protected]
http://twitter.com/peter_v

On Sep 29, 2011, at 6:43 PM, Peter V. wrote:

In trying to port a working version from one computer to another
it be copied over or will it be generated?

[email protected] http://GaslightSoftware.com/
certainly want to use bundle install _cmd_ whenever you run a
$ bundle exec rake environment # this is you first test that should
pass

HTH,

Peter

Ah, yes. Thank you for catching that, Peter.
-Rob

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs