Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
zulhfreelancer / readline_bundle_image_not_found.md
Last active November 3, 2021 20:50
How to fix 'readline.bundle image not found' problem?

If you get error like this:

Running via Spring preloader in process 7662
/Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': dlopen(/Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
  Referenced from: /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
  Reason: image not found - /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
@hoverlover
hoverlover / pg_locking.rb
Last active November 26, 2019 08:57
PG::LockNotAvailable rescue woes
def save_with_lock
r = Record.first
# This will raise PG::LockNotAvailable if already locked
#
r.with_lock("FOR UPDATE NOWAIT") do
# do stuff
end
# This rescue block isn't executed for some reason??
@velll
velll / issue_estimation.sql
Last active May 16, 2016 11:18
Issue estimation
-- estimation storage table
CREATE TABLE ISSUE_ESTIMATION(
N_ESTIMATION_ID NUMBER,
VC_PREDICTOR VARCHAR2(64) NOT NULL,
VC_ISSUE VARCHAR2(64) NOT NULL,
N_ESTIMATION NUMBER NOT NULL,
D_ESTIMATION DATE NOT NULL);
ALTER TABLE ISSUE_ESTIMATION
add constraint PK_ISSUE_ESTIMATION primary key (N_ESTIMATION_ID);