Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On 0.3.0 - LoadError: no such file to load -- thread_safe/jruby_cache_backend #40

Closed
webandtech opened this issue Mar 18, 2014 · 38 comments
Milestone

Comments

@webandtech
Copy link

Bad release?

@bliaxiong
Copy link

Yes, I'm having this issue as well.

@headius
Copy link
Owner

headius commented Mar 18, 2014

Ugh. I was sure it built the jar this time too. Checking.

@headius
Copy link
Owner

headius commented Mar 18, 2014

Hmm...I see the jar in the gem.

@headius
Copy link
Owner

headius commented Mar 18, 2014

Can someone post a terminal session showing the problem? I can't reproduce here.

@alexfalkowski
Copy link

Someone beat me to it 👍

@alexfalkowski
Copy link

This only happens when I move to JRuby 1.7.11 it works fine if it is on 1.7.9 (not sure if it has anything to do with it)

@alexfalkowski
Copy link

LoadError: no such file to load -- thread_safe/jruby_cache_backend
ThreadSafe at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:12
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:3
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:1
Inflections at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:28
Inflector at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:27
ActiveSupport at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:6
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:5
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb:3
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/dependencies/autoload.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/activesupport-4.0.4/lib/active_support/dependencies/autoload.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/active_attr-0.8.2/lib/active_attr.rb:1
load at org/jruby/RubyKernel.java:1101
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver/gems/active_attr-0.8.2/lib/active_attr.rb:2
each at org/jruby/RubyArray.java:1613

@headius
Copy link
Owner

headius commented Mar 18, 2014

I will yank the 0.3.0 gem until I can figure out why you folks are seeing
this.

LoadError: no such file to load -- thread_safe/jruby_cache_backend
ThreadSafe at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:12
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:3
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:1
Inflections at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:28
Inflector at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:27
ActiveSupport at
/Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:6
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:5
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb:3
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/dependencies/autoload.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/dependencies/autoload.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/active_attr-0.8.2/lib/active_attr.rb:1
load at org/jruby/RubyKernel.java:1101
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/active_attr-0.8.2/lib/active_attr.rb:2
each at org/jruby/RubyArray.java:1613


Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-37896885
.

@bliaxiong
Copy link

Ok, thanks.

On Mon, Mar 17, 2014 at 10:57 PM, Charles Oliver Nutter <
notifications@github.com> wrote:

I will yank the 0.3.0 gem until I can figure out why you folks are seeing
this.

LoadError: no such file to load -- thread_safe/jruby_cache_backend
ThreadSafe at
/Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:12
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:3
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:1
Inflections at
/Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:28
Inflector at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:27
ActiveSupport at
/Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:6
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/inflections.rb:5
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/inflector/methods.rb:3
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/dependencies/autoload.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/activesupport-4.0.4/lib/active_support/dependencies/autoload.rb:1
require at org/jruby/RubyKernel.java:1085
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/active_attr-0.8.2/lib/active_attr.rb:1
load at org/jruby/RubyKernel.java:1101
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.11@address-resolver
/gems/active_attr-0.8.2/lib/active_attr.rb:2
each at org/jruby/RubyArray.java:1613

Reply to this email directly or view it on GitHub<
https://github.com/headius/thread_safe/issues/40#issuecomment-37896885>
.

Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-37897568
.

Thanks!

Blia Xiong
bliaxiong1@gmail.com

@headius
Copy link
Owner

headius commented Mar 18, 2014

I'm still not able to reproduce this:

$ jruby -e 'require "thread_safe/cache"; p ThreadSafe::Cache.new; p $".grep(/jruby_cache/)'
#<ThreadSafe::Cache:0x481153e5 @default_proc=nil>
["/Users/headius/.rvm/gems/jruby-1.7.11/gems/thread_safe-0.3.0-java/lib/thread_safe/jruby_cache_backend.jar"]

This was under 1.7.11, which @alexfalkowski said triggered the issue for him.

Does this command fail for all of you?

@headius
Copy link
Owner

headius commented Mar 18, 2014

Can someone give me a listing of the installed gem's lib/thread_safe dir? I am assuming the jar's not there for some reason, but if it's there then something else is going on.

@headius
Copy link
Owner

headius commented Mar 18, 2014

Also, does 0.2.0 work ok with 1.7.11? I'm totally stumped here.

@bliaxiong
Copy link

it does. i had to uninstall 0.3.0.

On Tue, Mar 18, 2014 at 11:37 AM, Charles Oliver Nutter <
notifications@github.com> wrote:

Also, does 0.2.0 work ok with 1.7.11? I'm totally stumped here.

Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-37955315
.

Thanks!

Blia Xiong
bliaxiong1@gmail.com

@alexfalkowski
Copy link

The 0.3.0 installs and works fine for 1.7.9 (which I'm not sure why that is the case). Looking at the contents of the lib folder for thread_safe-0.3.0-java this is what I have

├── thread_safe
│   ├── atomic_reference_cache_backend.rb
│   ├── cache.rb
│   ├── jruby_cache_backend.jar
│   ├── mri_cache_backend.rb
│   ├── non_concurrent_cache_backend.rb
│   ├── synchronized_cache_backend.rb
│   ├── synchronized_delegator.rb
│   ├── util
│   │   ├── adder.rb
│   │   ├── atomic_reference.rb
│   │   ├── cheap_lockable.rb
│   │   ├── power_of_two_tuple.rb
│   │   ├── striped64.rb
│   │   ├── volatile.rb
│   │   ├── volatile_tuple.rb
│   │   └── xor_shift_random.rb
│   ├── util.rb
│   └── version.rb
└── thread_safe.rb

@headius
Copy link
Owner

headius commented Mar 19, 2014

Ok...I'm really confused.

The gem looks fine, and the diff between 0.2.0 and 0.3.0 does not show anything that might cause this require to fail. At least one person reported that 0.3.0 does work properly with JRuby 1.7.9...what about the rest of you? What JRuby version are you using?

I have yanked the gem even though it looked fine. I have a couple unlikely theories to test out.

@headius
Copy link
Owner

headius commented Mar 19, 2014

Those of you having trouble...I need your help. If you don't have the gem anymore you can download it manually here: https://rubygems.org/gems/thread_safe/versions/0.3.0-java

  1. Run this first and if it fails, proceed. If it works, but your app fails, tell me that and go to step two :-)

    jruby -v -e 'require "thread_safe/cache"; p ThreadSafe::Cache.new; p $".grep(/jruby_cache/)'

  2. Using whichever command failed, the above or your app, add these options to JRuby and gist the output: -d -Xdebug.loadService=true

@bliaxiong
Copy link

Installed the gem and can't seem to reproduce the error with the given
command or with Rails.

On Wed, Mar 19, 2014 at 8:32 AM, Charles Oliver Nutter <
notifications@github.com> wrote:

Those of you having trouble...I need your help. If you don't have the gem
anymore you can download it manually here:
https://rubygems.org/gems/thread_safe/versions/0.3.0-java

Run this first and if it fails, proceed. If it works, but your app
fails, tell me that and go to step two :-)

jruby -v -e 'require "thread_safe/cache"; p ThreadSafe::Cache.new; p
$".grep(/jruby_cache/)'
2.

Using whichever command failed, the above or your app, add these
options to JRuby and gist the output: -d -Xdebug.loadService=true

Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-38050382
.

Thanks!

Blia Xiong
bliaxiong1@gmail.com

@headius
Copy link
Owner

headius commented Mar 19, 2014

@bliaxiong Are you saying 0.3.0 gem works now for you?

@bliaxiong
Copy link

Yes. I was seeing the issues when running 'rails new my_app' with JRuby
1.7.11 and Rails 4.0.4.

I downloaded and manually installed the gem. I ran your command without any
errors. I also ran 'rails new my_app' twice and scaffold a new resources
without incident.

Running gem list shows this: thread_safe (0.3.0 ruby java, 0.2.0 java). I
don't recall seeing Ruby there before.

On Wed, Mar 19, 2014 at 9:01 AM, Charles Oliver Nutter <
notifications@github.com> wrote:

@bliaxiong https://github.com/bliaxiong Are you saying 0.3.0 gem works
now for you?

Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-38053306
.

Thanks!

Blia Xiong
bliaxiong1@gmail.com

@rubyonrails3
Copy link

I don't see thread_safe 0.3.0 gem file in rubygems so not able to bundle.

Fetching additional metadata from https://rubygems.org/..
Could not find thread_safe-0.3.0 in any of the sources

but adding this works

gem 'thread_safe', :github => 'headius/thread_safe'

@ratnikov
Copy link

Although the gem is yanked, it's possible to download it from rubygems directly: http://rubygems.org/gems/thread_safe/versions/0.3.0

I've also tried to reproduce the issue, but rails new foobar seems to work fine:

$ rails new foobar
      create
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
 [ ... ]
      create  vendor/assets/stylesheets/.keep
         run  bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.9.0)
Using atomic (1.1.16)
Using thread_safe (0.3.0)
Using tzinfo (0.3.39)
Using activesupport (4.0.4)
[ ... ]
Using rails (4.0.4)
Installing rdoc (4.1.1)
Installing sass (3.2.16)
Installing sass-rails (4.0.2)
Installing sdoc (0.4.0)
Installing therubyrhino_jar (1.7.4)
Installing therubyrhino (2.0.3)
Installing turbolinks (2.2.1)
Installing uglifier (2.5.0)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
$

alexfalkowski (or whoever can reproduce the issue) could you provide steps to reproduce it from a clean gemset?

@rubyonrails3
Copy link

I tried on rails 4.0.4 actually I was running 4.0.2 and I then upgraded to
4.0.4 and ran into that issue

SENT FROM MY HTC Butterfly S
On Mar 19, 2014 8:57 PM, "Dmitry Ratnikov" notifications@github.com wrote:

Although the gem is yanked, it's possible to download it from rubygems
directly: http://rubygems.org/gems/thread_safe/versions/0.3.0

I've also tried to reproduce the issue, but rails new foobar seems to work
fine:

$ rails new foobar
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
[ ... ]
create vendor/assets/stylesheets/.keep
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.9.0)
Using atomic (1.1.16)
Using thread_safe (0.3.0)
Using tzinfo (0.3.39)
Using activesupport (4.0.4)
[ ... ]
Using rails (4.0.4)
Installing rdoc (4.1.1)
Installing sass (3.2.16)
Installing sass-rails (4.0.2)
Installing sdoc (0.4.0)
Installing therubyrhino_jar (1.7.4)
Installing therubyrhino (2.0.3)
Installing turbolinks (2.2.1)
Installing uglifier (2.5.0)
Your bundle is complete!
Use bundle show [gemname] to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install

= 1.9.2 : nothing to do! Yay!
$

alexfalkowski (or whoever can reproduce the issue) could you provide steps
to reproduce it from a clean gemset?

Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-38068305
.

@rubyonrails3
Copy link

@ratnikov I think you've created new app but you didn't removed(uninstall) the gem so It would have picked from the old gems you had on your local drive. if you'll see in 'gem list' then remove version 0.3.0 and then do bundle, I'm sure you gonna get the error.

@ratnikov
Copy link

Huh?

$ gem list | grep thread
thread_safe (0.3.0 java)

If I uninstall it and try to run bundle install, it fails to find it (duh), but doesn't raise any weird errors:

$ gem uninstall thread_safe

You have requested to uninstall the gem:
        thread_safe-0.3.0-java

activesupport-4.0.4 depends on thread_safe (~> 0.1)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled thread_safe-0.3.0-java
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Could not find thread_safe-0.3.0-java in any of the sources
$

@alexfalkowski
Copy link

So I have tried it in JRuby 1.7.9.

gem install atomic -v 1.1.7
Fetching: atomic-1.1.7-java.gem (100%)
Successfully installed atomic-1.1.7-java

gem install --local thread_safe-0.3.0.gem
Successfully installed thread_safe-0.3.0
1 gem installed

gem install rails -v 4.0.3
Fetching: i18n-0.6.9.gem (100%)
Successfully installed i18n-0.6.9
Fetching: multi_json-1.9.2.gem (100%)
Successfully installed multi_json-1.9.2
Fetching: tzinfo-0.3.39.gem (100%)
Successfully installed tzinfo-0.3.39
Fetching: minitest-4.7.5.gem (100%)
Successfully installed minitest-4.7.5
Fetching: activesupport-4.0.3.gem (100%)
Successfully installed activesupport-4.0.3
Fetching: builder-3.1.4.gem (100%)
Successfully installed builder-3.1.4
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: rack-test-0.6.2.gem (100%)
Successfully installed rack-test-0.6.2
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: actionpack-4.0.3.gem (100%)
Successfully installed actionpack-4.0.3
Fetching: activemodel-4.0.3.gem (100%)
Successfully installed activemodel-4.0.3
Fetching: arel-4.0.2.gem (100%)
Successfully installed arel-4.0.2
Fetching: activerecord-deprecated_finders-1.0.3.gem (100%)
Successfully installed activerecord-deprecated_finders-1.0.3
Fetching: activerecord-4.0.3.gem (100%)
Successfully installed activerecord-4.0.3
Fetching: mime-types-1.25.1.gem (100%)
Successfully installed mime-types-1.25.1
Fetching: polyglot-0.3.4.gem (100%)
Successfully installed polyglot-0.3.4
Fetching: treetop-1.4.15.gem (100%)
Successfully installed treetop-1.4.15
Fetching: mail-2.5.4.gem (100%)
Successfully installed mail-2.5.4
Fetching: actionmailer-4.0.3.gem (100%)
Successfully installed actionmailer-4.0.3
Fetching: rake-10.1.1.gem (100%)
Successfully installed rake-10.1.1
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
Fetching: railties-4.0.3.gem (100%)
Successfully installed railties-4.0.3
Fetching: bundler-1.5.3.gem (100%)
Successfully installed bundler-1.5.3
Fetching: hike-1.2.3.gem (100%)
Successfully installed hike-1.2.3
Fetching: tilt-1.4.1.gem (100%)
Successfully installed tilt-1.4.1
Fetching: sprockets-2.12.0.gem (100%)
Successfully installed sprockets-2.12.0
Fetching: sprockets-rails-2.0.1.gem (100%)
Successfully installed sprockets-rails-2.0.1
Fetching: rails-4.0.3.gem (100%)
Successfully installed rails-4.0.3
28 gems installed

rails new foobar
LoadError: no such file to load -- thread_safe/jruby_cache_backend
ThreadSafe at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:12
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/thread_safe-0.3.0/lib/thread_safe/cache.rb:3
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/inflector/inflections.rb:1
Inflections at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/inflector/inflections.rb:28
Inflector at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/inflector/inflections.rb:27
ActiveSupport at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/inflector/inflections.rb:6
require at org/jruby/RubyKernel.java:1083
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/inflector/inflections.rb:5
(root) at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at org/jruby/RubyKernel.java:1083
require at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/inflector/methods.rb:3
require at org/jruby/RubyKernel.java:1083
(root) at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
require at org/jruby/RubyKernel.java:1083
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support/dependencies/autoload.rb:1
(root) at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at org/jruby/RubyKernel.java:1083
require at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/activesupport-4.0.3/lib/active_support.rb:25
require at org/jruby/RubyKernel.java:1083
(root) at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
require at org/jruby/RubyKernel.java:1083
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/railties-4.0.3/lib/rails/generators.rb:4
(root) at /Users/alexfalkowski/.rvm/rubies/jruby-1.7.9/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
load at org/jruby/RubyKernel.java:1099
(root) at /Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/bin/rails:23

I made sure I created a new ruby-gemset.

This is what the contents of the gem look like:

/Users/alexfalkowski/.rvm/gems/jruby-1.7.9@test-thread_safe/gems/thread_safe-0.3.0
├── Gemfile
├── LICENSE
├── README.md
├── Rakefile
├── examples
│   └── bench_cache.rb
├── ext
│   ├── org
│   │   └── jruby
│   │   └── ext
│   │   └── thread_safe
│   │   ├── JRubyCacheBackendLibrary.java
│   │   ├── jsr166e
│   │   │   ├── ConcurrentHashMap.java
│   │   │   ├── ConcurrentHashMapV8.java
│   │   │   ├── LongAdder.java
│   │   │   ├── Striped64.java
│   │   │   └── nounsafe
│   │   │   ├── ConcurrentHashMapV8.java
│   │   │   ├── LongAdder.java
│   │   │   └── Striped64.java
│   │   └── jsr166y
│   │   └── ThreadLocalRandom.java
│   └── thread_safe
│   └── JrubyCacheBackendService.java
├── lib
│   ├── thread_safe
│   │   ├── atomic_reference_cache_backend.rb
│   │   ├── cache.rb
│   │   ├── mri_cache_backend.rb
│   │   ├── non_concurrent_cache_backend.rb
│   │   ├── synchronized_cache_backend.rb
│   │   ├── synchronized_delegator.rb
│   │   ├── util
│   │   │   ├── adder.rb
│   │   │   ├── atomic_reference.rb
│   │   │   ├── cheap_lockable.rb
│   │   │   ├── power_of_two_tuple.rb
│   │   │   ├── striped64.rb
│   │   │   ├── volatile.rb
│   │   │   ├── volatile_tuple.rb
│   │   │   └── xor_shift_random.rb
│   │   ├── util.rb
│   │   └── version.rb
│   └── thread_safe.rb
├── test
│   ├── src
│   │   └── thread_safe
│   │   └── SecurityManager.java
│   ├── test_array.rb
│   ├── test_cache.rb
│   ├── test_cache_loops.rb
│   ├── test_hash.rb
│   ├── test_helper.rb
│   └── test_synchronized_delegator.rb
└── thread_safe.gemspec

16 directories, 40 files

@alexfalkowski
Copy link

I get the same issue with 1.7.11. Seems like there might be something up with the gem?

@headius
Copy link
Owner

headius commented Mar 20, 2014

I think there may be some mismatching gem version out there. A couple theories.

  • Some of you may have installed the non-java gem between the times I pushed that one and the java version. I would have expected it to fail to build the ext, but perhaps it is picking up an already built ext or not failing hard.
  • If you set the GitHub repo as the source, you will get the error for certain because we do not commit the jar file and there is no install-time logic to build it.

I am in transit for the next day or so, but I (or @thedarkone) will push a new 0.3.1 gem that has no changes and have you all retest.

@alexfalkowski
Copy link

Cheers 👍

5vankmajer added a commit to Psychlopedia/psychlopedia that referenced this issue Mar 20, 2014
@thedarkone
Copy link
Collaborator

I am in transit for the next day or so, but I (or @thedarkone) will push a new 0.3.1 gem that has no changes and have you all retest.

Can't help with this right now 😢 (don't have access to dev env for a few days).

@headius
Copy link
Owner

headius commented Mar 21, 2014

I have pushed a 0.3.1 gem that's identical to the old one, because I can't reproduce and can't figure out what would be causing issues for you all. If the new version doesn't work either, I need you to work with me to figure it out. Run your app/command with -Xdebug.loadService=true passed to JRuby (or in JRUBY_OPTS) and find relevant output when it looks for the jar it can't find.

If it's still broken, open a new issue for 0.3.1.

@headius headius closed this as completed Mar 21, 2014
@headius headius added this to the 0.3.1 milestone Mar 21, 2014
@alexfalkowski
Copy link

Just tried it and it seems to be working, thanks for the update :)

@myronmarston
Copy link

I have yanked the gem even though it looked fine.

@headius, please consider not yanking gems in the future for issues like this. When you yank a gem, it means that users who have the yanked version in their Gemfile.lock will get sudden unexpected deploy failures when they try to deploy. IMO, yanking is appropriate for when a version of a gem has such a dangerous security flaw that it's better for users deploys to break than for them to install the gem...but for something relatively benign like a LoadError, I don't believe yanking is appropriate.

We're on MRI and haven't hit this bug with v0.3.0 (since it appears to be jruby-specific) so it was surprising to suddenly have bundles fail.

FWIW, I think rubygems needs some other way to tag a specific version as "problematic" or "not recommended", and I'm going to go open an issue to suggest they add alternative to yanking for things like this.

@sferik
Copy link
Collaborator

sferik commented Mar 21, 2014

@myronmarston I’ve convinced @indirect and @hone that this is worth fixing in Bundler, so gems in the Gemfile.lock will always install, even if they’ve been yanked. You can follow this issue here: rubygems/bundler#2277.

@headius
Copy link
Owner

headius commented Mar 22, 2014

@sferik Thanks, that does sound like a better approach. Given that the gem was still downloadable from rubygems.org, I assumed it would be lower impact to yank than it actually was.

@myronmarston At the point I decided to yank this, I assumed the gem was totally broken. Not yanking it would mean even more people ended up with a broken gem in their Gemfile.lock, which means more support hassles for me. The delay between yanking and pushing a new gem was unexpected and unfortunate, but I was really stuck between two not-so-great options.

@arvindsv
Copy link

arvindsv commented May 6, 2014

I came across this issue again, in 0.3.3. After some investigation, this is what I found. I use "bundle install --deployment" for vendorizing gems into vendor/bundle. Then, I check-in the vendor/bundle directory into git.

When doing that, bundler untars the gem into that directory. The thread_safe gem has been packaged with a .gitignore file (the same one that is checked in, into code). That .gitignore file ignores "lib/thread_safe/jruby_cache_backend.jar". When checked into git, the .gitignore kicks in, and the jruby_cache_backend.jar is not checked in. Locally, it stays and so it works for some people. But, if you do a "git clean -fdx" or clone it somewhere else, the jar is not going to be around.

If this is what was happening to the others too, it could explain why #39 talked about the gem not changing between 0.3 and 0.3.1. Looking at the yanked gem, it DOES have that jar file. So, it was not corrupted.

I think the thread_safe.gemspec file needs a line like this in it, to make sure that the .gitignore is not packaged:

gem.files         -= ".gitignore" # Untested

@indirect
Copy link

indirect commented May 6, 2014

That usage pattern for Bundler is completely unsupported, and any problems you encounter while using it are your own to solve, I'm afraid.

(That said, I also recommend not including gitignore files inside packed gems. :)

On Tue, May 6, 2014 at 8:14 AM, Aravind SV notifications@github.com
wrote:

I came across this issue again, in 0.3.3. After some investigation, this is what I found. I use "bundle install --deployment" for vendorizing gems into vendor/bundle. Then, I check-in the vendor/bundle directory into git.
When doing that, bundler untars the gem into that directory. The thread_safe gem has been packaged with a .gitignore file (the same one that is checked in, into code). That .gitignore file ignores "lib/thread_safe/jruby_cache_backend.jar". When checked into git, the .gitignore kicks in, and the jruby_cache_backend.jar is not checked in. Locally, it stays and so it works for some people. But, if you do a "git clean -fdx" or clone it somewhere else, the jar is not going to be around.
If this is what was happening to the others too, it could explain why #39 talked about the gem not changing between 0.3 and 0.3.1. Looking at the yanked gem, it DOES have that jar file. So, it was not corrupted.
I think the thread_safe.gemspec file needs line like this in it, to make sure that the .gitignore is not packaged:

gem.files         -= ".gitignore" # Untested

Reply to this email directly or view it on GitHub:
#40 (comment)

@arvindsv
Copy link

arvindsv commented May 6, 2014

That usage pattern for Bundler is completely unsupported, and any problems you encounter while using it are your own to solve, I'm afraid.

:) Agreed. Also, I meant to say, "bundle install --standalone --path vendor/bundle", instead of --deployment.

[Off topic] In my case, I'm using embedded JRuby (jruby-complete.jar) inside a war. So, I need the gems available and not dependent on anything else. That's why the vendoring.

@thedarkone
Copy link
Collaborator

Wow, @arvindsv thanks for digging into it! 👍 I'll make sure .gitignore is no longer packed/included in a gem.

thedarkone added a commit that referenced this issue May 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests