Dependencies

I'm trying to resolve some dependancies issues in my rails app.

How do you resolve these issues typically?

Thanks,
Joe

What do you have in mind specifically? I can’t recall the last time where I had any issues with bundler.

Resolving dependencies…

The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.1.

To update, run gem install bundler --pre

Bundler could not find compatible versions for gem “railties”:

In Gemfile:

devise (>= 3.5.6, ~> 3.5) x64-mingw32 was resolved to 3.5.6, which depends

on

railties (< 5, >= 3.2.6)

devise (>= 3.5.6, ~> 3.5) x64-mingw32 was resolved to 3.5.6, which depends

on

railties (< 5, >= 3.2.6) x64-mingw32

devise (>= 3.5.6, ~> 3.5) x64-mingw32 was resolved to 3.5.6, which depends

on

railties (< 5, >= 3.2.6) x86-mingw32

rails (= 5.0) x86-mingw32 was resolved to 5.0.0, which depends on

railties (= 5.0.0)

rails (= 5.0) x86-mingw32 was resolved to 5.0.0, which depends on

railties (= 5.0.0) x64-mingw32

rails (= 5.0) x86-mingw32 was resolved to 5.0.0, which depends on

railties (= 5.0.0) x86-mingw32

Here are my problems on my problems on my mac. I was using rails gem 4.2.5, but ran into a fix num error, and someone said that switching to rails 5.0 (in my gem file and running bundle update would fix it).

Unfortunately, I ran into more problems. :frowning:

ok, a smaller jump to rails 4.2.8 compiled without any warnings.

:slight_smile:

ok, a smaller jump to rails 4.2.8 compiled without any warnings.

:slight_smile:

You do pretty much just have to read the messages. It’s saying that it wants to use devise 3.5.6, which needs rails < 5 but that elsewhere in your gem file you’re saying you want rails 5, so it doesn’t know what to do. Typically you would resolve this by changing the constraint on devise (I think you might need devise 4.x for rails 5).

Fred

Ok, I missed that constraint. I will look at swapping it out, but it compiled ok now.

wow, I learned a new command yesterday.

A very useful command from Railscast - ‘bundle outdated’. Anyways, this will identify if there are any gems that need to be updated.

I’m not so sure why bundle update doesn’t do this automatically, I’m thinking it has to do with the gem file (and if’s it locked to a certain version).

Anyways, updating a few too many broke my code, so instead of trying to figure out what I messed up, I reverted back.

So, I guess if it ain’t broke don’t fix it.

I'm not so sure why bundle update doesn't do this automatically, I'm
thinking it has to do with the gem file (and if's it locked to a certain
version).

Of course, the whole point of having versions in the Gemfile is to
lock specific gems to a specific version or range.

Anyways, updating a few too many broke my code, so instead of trying to
figure out what I messed up, I reverted back.

So, I guess if it ain't broke don't fix it.

No. Keeping current is essential.

If you fall too far behind, there will be a day when you *must* update
some gem due to a critical security issue -- and you won't be able to
because of some other gem(s) being out of date.

Learning to update and resolve dependencies is just part of the job.

Lol, I don’t have a job as rails developer yet. I’m still trying to figure this out.

Maybe, eventually.