I'm trying to install bundler gem on Mac OS Yosmite
~/code/hello gem install bundler
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I've done the following:
Install zlib through homebrew
Upgrade Rubygems
Reinstall RVM and Ruby 2.2.2
Switched to Rbenv and Ruby 2.2.2
This is really doing my head in. Ruby 2.2.1 works fine but 2.2.2 causes this issue whenever I try to install a gem.
Anyone got any ideas?
The following worked for me:
brew install homebrew/dupes/zlib
rvm reinstall 2.2.2 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8
Hope this helps anyone else who runs into it.
Try rvm pkg install zlib
(from this question)
RVM pkg docs: https://rvm.io/packages
It also looks like RVM has a more up to date way of managing packages called autolibs. Check rvm autolibs show, which I hope will be default(enabled) since you just installed. If it's not, rvm autolibs enable, or you can even tell it to use Homebrew instead of its own manager with rvm autolibs homebrew.
RVM autolibs docs: https://rvm.io/rvm/autolibs
Related
I'm having issues getting Jekyll working on El Capitan. Well, any Gem really. All my Gem installs failed, and I found out it was because of Apple's System Integrity Protection, and the recommended solution is to use ruby versioning tool RBENV.
Installed rbenv and ruby-build using homebrow
Installed Ruby 2.3.0
Set rbenv global to 2.3.0
ran rbenv init and added it to ~/.zshenv so my path now looks like: /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/thuijls/.rbenv/shims
gem install works fine, I installed jekyll and some other gems. No drama, everything installed to /usr/local/bin/gems.
ran rbenv rehash
Running any of them tho:
/usr/local/bin/jekyll:22:in `load': cannot load such file -- /Library/Ruby/Gems/2.0.0/gems/jekyll-3.0.3/bin/jekyll (LoadError)
from /usr/local/bin/jekyll:22:in `<main>'
They still try to access Apple's standard Ruby in /Library/, which is where none of those Gems are installed.
Any suggestions?
Although I don't use rbenv, try these few steps:
run brew prune to fix the system's symlinks;
fix any other issues indicated by brew doctor;
use .bash_profile in your home folder instead of ~/.zshenv
If it still doesn't work, try using RVM:
install it with an argument to set up your PATH properly with: \curl -sSL https://get.rvm.io | bash -s stable --auto-dotfiles
set RVM to use Homebrew to install any necessary dependencies with rvm autolibs enable && rvm autolibs packages && rvm autolibs homebrew
install ruby-2.3.0: rvm install 2.3.0
go ahead and install any gem on your current gemset
i'm using rvm, i installed ruby 2.0 with rvm but i need to uninstall it to get ruby 1.9.3. But my terminal is doing strange things:
MacBook-Pro-Kuba:~ Kuba$ gem install bundler
Successfully installed bundler-1.3.5
Parsing documentation for bundler-1.3.5
1 gem installed
MacBook-Pro-Kuba:~ Kuba$ sudo rvm all do uninstall ruby
Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
So as you can see i'm definitely having bundler installed, and it's throwing this error. What should i do?
(i use mountain lion)
Why do you need to uninstall ruby2.0 to get ruby1.9.3? The whole idea of rvm is that you can have (and switch between) many different versions.
List the Rubies with rvm list.
Install (if required) with rvm install 1.9.3.
Swap to it with rvm use 1.9.3.
So I tried to install ruby through rbenv on my new ubuntu 12.04LTS running on VirtualBox.
I got rbenv from https://github.com/sstephenson/rbenv and ruby-build from https://github.com/sstephenson/ruby-build.
and then i run the following but build fails :(
rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20130506102349.2564
Results logged to /tmp/ruby-build.20130506102349.2564.log
Last 10 log lines:
installing default gems: /home/shivin/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
bigdecimal 1.2.0
io-console 0.4.2
json 1.7.7
minitest 4.3.2
psych 2.0.0
rake 0.9.6
rdoc 4.0.0
test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Any help would be appreciated. Let me know if you need any more details. Thanks!
You are going to need libssl-dev. For best results install all of the requirements which rvm autolibs function will install for you. Some of them (like sqlite3) presume that you will ultimately be wanting to install Rails, but aren't harmful if you don't need them.
Most probably you need the openssl extension as a prerequisite :
sudo apt-get install openssl
should to the trick. Relaunch your RBENV install afterwards.
Hit the same issue. moschop's suggestion on the thread worked!
sudo apt-get install libssl-dev
and then
rbenv install 2.0.0-p247
You will have to rehash everytime you install a Ruby version or a gem
rbenv rehash
Make a Ruby version default:
rbenv global 2.0.0-p247
When attempting to run any rake, rails or bundle commands, I get following error:
/home/username/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': libcrypto.so.1.0.0: cannot open shared object file: No such file or directory - /home/username/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/x86_64-linux/digest/sha1.so
I have tried rvm pkg install openssl, rvm remove 1.9.3, rvm reinstall 1.9.3, reinstall bundler and all gems. I read on another forum that I may have to uninstall rvm, ruby and rails and start from scratch. Ugh - really?
Thanks in advance.
you need to read and follow the instructions displayed with:
rvm requirements
then remove the rvm installed openssl:
rm -rf $rvm_path/usr/
and reinstall ruby:
rvm reinstall 1.9.3-p194
I am attempting to install Ruby with RVM. I already have Ruby installed, but I have now installed RVM and am trying to install Ruby 1.9.3 using rvm 1.9.3 and I get the following error:
Error running ' ./configure --prefix=/Users/anderskitson/.rvm/rubies/ruby-1.9.3-p0 --
enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/anderskitson/.rvm/usr ', please read /Users/anderskitson/.rvm/log/ruby-1.9.3-p0/configure.log
There has been an error while running configure. Halting the installation.
rvm 1.9.3 will not install Ruby. It will tell RVM to switch to using Ruby 1.9.3 after it has been installed. Did you mean rvm install 1.9.3?
Have you installed all the dependencies? Try rvm requirements.
Check the output of rvm info, and make sure everything looks sane.
To uninstall XCode: https://stackoverflow.com/a/7960899/128421