Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active November 3, 2021 20:50
Show Gist options
  • Star 80 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save zulhfreelancer/47efc39584cb9f006da43c41c014e03a to your computer and use it in GitHub Desktop.
Save zulhfreelancer/47efc39584cb9f006da43c41c014e03a to your computer and use it in GitHub Desktop.
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'
	from /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/irb/completion.rb:10:in `<top (required)>'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
	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'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/console.rb:3:in `<top (required)>'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
	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'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:58:in `console'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
	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'
	from /Users/zulh/hg/cws/bin/rails:9:in `<top (required)>'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'
	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:268:in `load'
	from /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from -e:1:in `<main>'

Run this in your Terminal:

ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

And then run you rails c again. It should work.

Update on 28 May 2019

If above doesn't work, try this:

ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

Credit to @dirkdk for sharing his solution.

@ByteDecoder
Copy link

Thanks!!

@LuisPinedaJR
Copy link

Thank you so much for this 👍

@Muhammad-Ahmed96
Copy link

Thanks :)

@dawsongraham925
Copy link

This is glorious, thank you!

@arefaslani
Copy link

Thanks, it worked! 🎉❤️

@patrickxrivera
Copy link

💯

@benclifford79
Copy link

Thank you!

Copy link

ghost commented Dec 10, 2019

Thanks parcero!

@i5okie
Copy link

i5okie commented Dec 20, 2019

THANKYOU

@TafDev
Copy link

TafDev commented Dec 30, 2019

Thanks a lot, saved me a lot of time

@AlejandroFernandesAntunes

Thanks man!

@juanmanuelramallo
Copy link

T H A N K Y O U

@mfsinirmal
Copy link

Works like charm. Thank you

@tejash-jl
Copy link

This works,
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

@syafilm
Copy link

syafilm commented Feb 21, 2020

thanks

@iarobinson
Copy link

Thank you!

@abuzze
Copy link

abuzze commented Mar 9, 2020

Thx. Saved me a lot of time.

@michaelhvisser
Copy link

Thanks!

@andrefa
Copy link

andrefa commented Mar 19, 2020

The proposed solution is still working. Thank you!

@pjoter
Copy link

pjoter commented Mar 26, 2020

thanks 1M times :)

@nbalsamo
Copy link

nbalsamo commented Apr 7, 2020

perfect!

@crabbits
Copy link

👏

@lundie
Copy link

lundie commented Apr 20, 2020

Thanks :)

@ipatovanton
Copy link

Thanks

@paneq
Copy link

paneq commented Jul 9, 2020

Thank you

@thieunv90
Copy link

Thank you!

@besi
Copy link

besi commented Oct 29, 2020

Thanks. For me on macOS Catalina 10.15.5 (19F101) this did the trick:

ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

@fabiensebban
Copy link

Thanks! It works also on macOS High Sierra 10.13.6 (17G65) to run the Ruby On Jets console

@DonMat
Copy link

DonMat commented Dec 30, 2020

In Catalina 10.15.7 (19H15) with libreadline.8.1
I need to use
ln -s /usr/local/opt/readline/lib/libreadline.8.1.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

Thanks for trick! :)

@danielousky
Copy link

🙌🏽 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment