relative path not resolved correctly with :path gem

742 views
Skip to first unread message

Adam Cigánek

unread,
Oct 18, 2010, 12:56:27 PM10/18/10
to ruby-bundler
Hello,

I have this in the Gemfile:

gem "foo", :path => 'vendor/gems/foo-1.2.3'

The bundler manpage says that if the path is relative, it's resolved
relative to the location of the Gemfile. So far so good. But when I
try to deploy my app, the deployment fails with:

The path '/home/deploy/vendor/gems/foo-1.2.3' does not exist.

It seems the path resolution is somehow broken. My deploy_to path is "/
home/deploy/my_app", so i'd expect the resolved path to be something
like "/home/deploy/my_app/releases/{timestamp}/vendor/gems/foo-1.2.3",
but instead it's resolved relative to my deploy user home directory.

Am I doing something wrong, or is this a bug in bunder, or what?

Andre Arko

unread,
Oct 18, 2010, 1:16:47 PM10/18/10
to ruby-b...@googlegroups.com
On Oct 18, 2010, at 9:56 AM, Adam Cigánek wrote:
>
> Am I doing something wrong, or is this a bug in bunder, or what?

Paths with no reference point are expanded relative to `~` deliberately. If you want a path relative to the current directory, say so:

gem "foo", :path => "./vendor/gems/foo-1.2.3"

— Andre

Adam Cigánek

unread,
Oct 18, 2010, 1:31:21 PM10/18/10
to ruby-b...@googlegroups.com
Thanks for the answer. I changed the path as you suggested (and run
bundle install afterwards, to update Gemfile.lock), but I still get
the same error:

The path `/home/deploy/vendor/gems/foo-1.2.3` does not exist.

What else could be wrong?

2010/10/18 Andre Arko <an...@arko.net>:

> --
> You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
> To post to this group, send email to ruby-b...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-bundler...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-bundler?hl=en.
>
>

Andre Arko

unread,
Oct 18, 2010, 1:48:09 PM10/18/10
to ruby-b...@googlegroups.com
On Oct 18, 2010, at 10:31 AM, Adam Cigánek wrote:
>
> What else could be wrong?

You might not be using the newest version of bundler? Also, "bundle install" might not be smart enough to update the lock file. Try deleting Gemfile.lock and running install again.

— Andre

Adam Cigánek

unread,
Oct 19, 2010, 5:24:16 AM10/19/10
to ruby-b...@googlegroups.com
> You might not be using the newest version of bundler? Also, "bundle install" might not be smart enough to update the lock file. Try deleting Gemfile.lock and running install again.

I'm using bunder 1.0.3 (is it the newest?). The Gemfile.lock was
updated by bundle install, but I tried to delete it and run install
again, just in case. Nothing helped. Still getting the same error.

Adam Cigánek

unread,
Oct 19, 2010, 12:21:51 PM10/19/10
to ruby-b...@googlegroups.com
Hmm, I tried to downgrade to 1.0.2, and it seems the problem does not
occur. So, to me, this looks like a bug. Shall I submit a bugreport?

2010/10/19 Adam Cigánek <adam.c...@gmail.com>:

Andre Arko

unread,
Oct 19, 2010, 12:29:31 PM10/19/10
to ruby-b...@googlegroups.com
On Oct 19, 2010, at 9:21 AM, Adam Cigánek wrote:
>
> Hmm, I tried to downgrade to 1.0.2, and it seems the problem does not
> occur. So, to me, this looks like a bug. Shall I submit a bugreport?

Yes, please. The information in ISSUES[1] would be helpful. Thank you.

— Andre

[1]: http://github.com/carlhuda/bundler/blob/master/ISSUES.md

Reply all
Reply to author
Forward
0 new messages