headius/thread_safe

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

webandtech opened this issue Β· 38 comments

Bad release?

Yes, I'm having this issue as well.

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

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

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

Someone beat me to it πŸ‘

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)

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

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
.

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

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?

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.

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

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

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

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.

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

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

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

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

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'

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?

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
.

@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.

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
$

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

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

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.

Cheers πŸ‘

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).

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.

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

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.

@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.

@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.

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

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)

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.

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