Comments (10)
@deivid-rodriguez I'll craft a repro project.
It needs to be done with JRuby and then packaged as a JAR.
I'll set up a repro project today.
from bundler.
@deivid-rodriguez I have produced a minimal example at https://github.com/fzakaria/warbler-bundler-jruby-failure
In order to reproduce it, please make sure you are using
jruby
(I used rvm to install)
If you run the example script with simply ruby, it works.
bundle exec ruby bin/warbler-example.rb
>> Starting the JAR!
>> hello world
however, if you build the JAR & run it you get the error from above.
bundle exec warble
java -jar warbler-example.jar
[!] There was an error parsing `Gemfile`: different prefix: "uri:classloader://" and "uri:classloader:/warbler-example". Bundler cannot continue.
# from uri:classloader:/warbler-example/Gemfile:4
# -------------------------------------------
# gem 'warbler', '2.0.5'
> gem 'jruby-jars', '9.1.17.0' # ruby '2.3.3', engine: 'jruby', engine_version: '9.1.17.0'
# -------------------------------------------
from bundler.
Tracking this in JRuby issue also jruby/jruby#6045
from bundler.
Hello @fzakaria! Could you post exact repro instructions? I tried bundling a Gemfile including something like gem 'some-gem', :path => "ruby-gems/some-gem"
and it worked, so there must be something else going on in your application.
from bundler.
I could reproduce the issue, thanks! I'll try to investigate it.
from bundler.
Great ! Let me know if you need anything else for help in the investigation.
from bundler.
Ok, so this seems like due to a weird inconsistency in jruby
that should probably be fixed, where Pathname#expand_path
with an argument always returns uri:classloader://
(double slash) as the canonical version of "uri:classloader" paths, while Pathname#expand_path
without an argument always returns uri:classloader/
(single slash) as the canonical version of "uri:classloader" paths.
Pathname.new("uri:classloader://foo/bar").expand_path
# => <Pathname:uri:classloader:/foo/bar>
Pathname.new("uri:classloader:/foo/bar").expand_path
# => <Pathname:uri:classloader:/foo/bar>
Pathname.new("foo/bar").expand_path("uri:classloader://")
# => <Pathname:uri:classloader://foo/bar>
Pathname.new("foo/bar").expand_path("uri:classloader:/")
# => <Pathname:uri:classloader://foo/bar>
That makes Pathname#relative_path_from
explode because we end up passing to different "uri:classloader" kind of paths to it.
So, I see two things that can be fixed/changed in jruby:
- Make
Pathname#expand_path
return consistent versions of "uri:classpath" paths. - Make
Pathname#relative_path_from
support different versions of "uri:classpath" paths, since they are both absolute paths after all.
As a workaround, I believe we can apply the following patch to bundler:
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index f98f5155fb..1aea7ece0d 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -132,7 +132,7 @@ module Bundler
end
def expand(somepath)
- somepath.expand_path(root_path)
+ somepath.expand_path(root_path).expand_path
rescue ArgumentError => e
Bundler.ui.debug(e)
raise PathError, "There was an error while trying to use the path " \
from bundler.
Since it's way less onerous to update Bundler gem vs updating our JRuby installation I would very much appreciate the patch to bundler to accommodate the bug.
I'll also add your latest investigation to jruby/jruby#6045 for them
from bundler.
Yes, we'll provide a workaround in bundler. I want to make sure I add a basic test for this in order to catch basic errors with warbler
like this one in the future.
from bundler.
🙏 thanks.
Please feel free to tag me on the PR.
from bundler.
Related Issues (20)
- Migrate current Linux CI matrix to Github Actions
- RUBY VERSION ruby 2.6.0p0 BUNDLED WITH 1.17.3 ``` --- TEMPLATE END ---------------------------------------------------------------- Unfortunately, an unexpected error occurred, and Bundler cannot continue. First, try this link to see if there are any existing issue reports for this error: https://github.com/bundler/bundler/search?q=%22&type=Issues If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
- Improve OpenSSL load failure message HOT 1
- i can't run bundle install HOT 2
- LoadError: cannot load such file -- <file_name> HOT 3
- CHANGELOG is out of date on master (does not mention 2.1.4) HOT 1
- config are stored to global when using `bundle config set --local` more than once HOT 3
- Bundle install got stuck on 'Resolving dependencies'
- Running Github Page Locally
- init_gems_rb setting is ignored in bundle-gem
- https://github.com/bundler/bundler/search?q=unknown+encoding+name+-+CP720&type=Issues
- gem install bundler - fails HOT 1
- (please ignore or delete this issue) HOT 1
- `cannot load such file -- did_you_mean` on `bunde install` with ruby-2.7.0 HOT 10
- Codeanywhere: Unfortunately, an unexpected error occurred, and Bundler cannot continue. HOT 1
- Gem::RemoteFetcher::FetchError: too many connection resets
- Gem::RemoteFetcher::FetchError: too many connection resets HOT 1
- Bundler removes more than it should HOT 1
- Bundle does not find gems after bundle install. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bundler.