Skip to content

Instantly share code, notes, and snippets.

@regularfry
regularfry / gist:4030956
Created November 7, 2012 11:28
rvm jruby-1.5.1 fail
$ rvm install jruby-1.5.1 --disable-binary
jruby-1.5.1 - #downloading jruby-bin-1.5.1, this may take a while depending on your connection...
Error running '/home/zander/.rvm/scripts/fetch http://jruby.org.s3.amazonaws.com/downloads/1.5.1/jruby-bin-1.5.1.tar.gz', please read /home/zander/.rvm/log/jruby-1.5.1/fetch.log
$ cat /home/zander/.rvm/log/jruby-1.5.1/fetch.log
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.5M 100 11.5M 0 0 47982 0 0:04:11 0:04:11 --:--:-- 48236
Downloaded archive checksum did not match, archive was removed!
If you wish to continue with not matching download add '--verify-downloads 2' after the command.
[11:38:20] zander@pancake: ~/tmp/rack/rack-jetty master!
$ gem list rake
*** LOCAL GEMS ***
rake (10.0.2)
[11:38:31] zander@pancake: ~/tmp/rack/rack-jetty master!
$ gem uninstall rake --version=10.0.2
INFO: gem "rake" is not installed
$ jruby -d -S gem install jruby-openssl
Exception `LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/1.8/Win32API.rb:2 - Win32API only supported on win32
Exception `Gem::LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems.rb:777 - Could not find RubyGem jruby-openssl (>= 0)
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Exception `Gem::LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems.rb:777 - Could not find RubyGem jruby-openssl (>= 0)
Exception `LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/x509.rb:8 - OpenSSL::X509 requires the jruby-openssl gem
Exception `Gem::LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems.rb:777 - Could not find RubyGem test-unit (>= 0)
$ gem install ./jruby-openssl-0.7.7.gem
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Fetching http://rubygems.org/latest_specs.4.8.gz
Fetching https://rubygems.org/latest_specs.4.8.gz
/home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8: OpenSSL::SSL requires the jruby-openssl gem (LoadError)
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:124:in `use_ssl='
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:248:in `connection_for'
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:329:in `request'
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:286:in `open_uri_or_path'
@regularfry
regularfry / pmbi
Created October 10, 2013 01:35
Poor Man's Bundle Install
#!/usr/bin/env ruby
lockfile=ARGV.shift
sources=[]
gems=[]
File.foreach(lockfile) do |line|
case line
when /^ remote: (.*)$/
sources << $1
when /^ (\S+) \((.*)\)$/
#!/usr/bin/env ruby
class Matcher
def initialize( *args, &blk )
@args = args
@blk = blk
end
def call( *params )
matches = @args.zip(params).all?{|arg, param|
@regularfry
regularfry / link-gems
Created March 21, 2014 12:42
microgems

SRP: two approaches, two definitions of “responsibility”

Using “Uncle Bob” and “Sandi Metz” as figureheads of each style because they’ve both written about them, not necessarily to imply any ownership of the concepts.

  • Uncle Bob: “Each module has a single responsibility TO SOMEONE”
    • If this applies at the class level, it can’t be usefully used at the method level
  • Sandi Metz: “Each class/method has a single responsibility FOR SOMETHING”
    • This implies the same test applied at two different levels of
@regularfry
regularfry / pdns_remote_http.md
Created November 8, 2015 18:00
pdns_server remote backend problem
@regularfry
regularfry / gemstash_problem.shell
Last active December 21, 2015 17:00
gemstash problem
$ cat /etc/nginx/sites-available/gemstash.conf
server {
listen 80;
listen [::]:80;
server_name gemstash;
keepalive_timeout 0;
location / {
proxy_pass http://127.0.0.1:9292;