Installing ruby-2.0.0-p0 with rbenv BUILD FAILED - ruby

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

Related

Ruby gem show "Invalid argument" error for almost every command

I am working through NativeScript's set-up on OS X El Capitan and I am stuck at the point where I am supposed to install xcodeproj and cocoapods. Almost everything that I try to do with gem shows the same error:
$ sudo gem install xcodeproj
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument
The following commands show the same error, wether I run it with sudo or not:
$ gem update --system
$ gem update
$ gem install whatever
$ gem install cocoapods
I have the following versions:
$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
$ gem --version
2.6.7
I've tried some of the help that I've found online, including reinstalling gem and ruby, restarting but nothing has helped.
I guess that I have a configuration problem with Ruby.
Any suggestions on how to troubleshoot this?
I just had a similar issue after updating everything via Homebrew.
I solved the issue by uninstalling Ruby and installing it via rbenv, then reinstalling cocoa pods.
Steps:
Uninstall ruby
brew uninstall ruby
Install rbenv and ruby-build
brew install rbenv ruby-build
You need to add Ruby to your path.
A. If Terminal is your shell.
Add eval "$(rbenv init -)" to ~/.bash_profile
B. Or if you use another shell
You can find the instruction by entering the command rbenv init NAME_OF_YOUR_SHELL.
Install Ruby
rbenv install 2.3.1
Set the Ruby version
rbenv global 2.3.1
rbenv local 2.3.1
Reinstall Cocoapods
gem install cocoapods

Error installing gems: cannot load such file -- zlib

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

Unable to install bcrypt-ruby, blocks upgrade of devise, "Failed to build native gem extension"

I'm on Mac OSX 10.10.2. In attempting to upgrade devise from 2.1.2 to 2.2.8 (by updating the version in the Gemfile), bundle install attempts to install bcrypt 3.1.10 and crashes with this output:
/Users/username/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling bcrypt_ext.c
make: *** [bcrypt_ext.o] Segmentation fault: 11
make failed, exit code 2
I have attempted some fixes found in searching, such as:
`gem install bcrypt -v '3.1.10'ยด
(same error)
Download gem source from github (https://github.com/codahale/bcrypt-ruby) and attempt to install from the local gemfile (same error).
Uninstall bcrypt-ruby with gem uni bcrypt, reinstalling with gem i bcrypt-ruby --platform=ruby (same error)
If I set user to root with sudo su -, I am able to run the install with the following output:
root# gem install bcrypt -v '3.1.10'
Building native extensions. This could take a while...
Successfully installed bcrypt-3.1.10
Parsing documentation for bcrypt-3.1.10
unable to convert "\xCA" from ASCII-8BIT to UTF-8 for lib/bcrypt_ext.bundle, skipping
1 gem installed
However, if I exit out of root, bundle install still fails.
Running rvm 1.25.3, ruby 1.9.3, gem 2.2.2, Bundler version 1.9.4, Xcode 6.3, Command Line Tools 6.3
Any ideas?
Finally, this worked:
Updating RVM to head with rvm get head
Uninstall rvm 1.9.3 with rvm uninstall 1.9.3
Re-install rvm 1.9.3. Tried running rvm install 1.9.3, which advised to run rvm install ruby-1.9.3-p551 instead. Did that.
rvm use 1.9.3
Reinstalled bundler with gem install bundler
Now, finally bundle install works.
It seems likely that previous steps (particularly running updates on Xcode & Command Line Tools) have contributed to success.

Trying to install bro pages: mime-types requires Ruby version >= 1.9.2

I've been trying to install bro pages, but I'm hitting a wall.
I've managed to upgrade to Ruby 2.1.0:
craig#Craig-loaf:~$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
craig#Craig-loaf:~$ gem -v
2.2.1
But I try to install bro pages, like so:
craig#Craig-loaf:~$ sudo gem install bropages
ERROR: Error installing bropages:
mime-types requires Ruby version >= 1.9.2.
Which to me makes no sense.
I found some where on Stackoverflow a similar problem, where another gem had issues with being installed at they recommended adding --pre --no-ri --no-rdoc to the end, but I get this error instead:
craig#Craig-loaf:~$ sudo gem install bropages --pre --no-ri --no-rdoc
[sudo] password for craig:
ERROR: Could not find a valid gem 'bropages' (>= 0) in any repository
ERROR: Possible alternatives: bropages
craig#Craig-loaf:~$ sudo gem install mime-types --pre --no-ri --no-rdoc
ERROR: Could not find a valid gem 'mime-types' (>= 0) in any repository
ERROR: Possible alternatives: mime-types
So how can I get round this, and install bropages?
Is the sudo user set up to use a different ruby version (or any ruby version at all)? I've seen this happen before on UNIX machines where the main user is configured but the sudo user isn't. For example, the way I have things set up right now, > gem install {something} works fine, but > sudo gem install {something} claims it can't find the 'gem' command.
You might also try running without sudo. I don't sudo on my Linux machine, and I'm pretty sure my Mac doesn't require me to, either.
Try running 'sudo ruby -v' and 'sudo gem -v'. If that doesn't give you what you need to solve the issue, post the output to those commands here on the thread.
I got the above mentioned errors as well
I'm using Ubuntu 12.10 64bit.
bropages requires Ruby version 1.9.2, I had 1.8.7 installed. What fixed it for me is to install the latest version of ruby and install bropages gem in that so I could use it.
Here are the steps I took to install the latest version, and specify that as the one to use and to install bropages in that.
sudo apt-get update
sudo apt-get install curl
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
rvm install ruby
rvm use ruby --default
rvm rubygems current
gem install rails
gem install bropages
Then finally I can use is like this:
bro curl
9 entries for curl -- submit your own example with "bro add curl"
# get the contents of a web page
curl http://bropages.org
bro thanks to upvote (22)
bro ...no to downvote (2)
Source: https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
And http://bropages.org/

bcrypt-ruby won't install with bundler but works fine with gem install

I just recently began having trouble with bundler - bcrypt-ruby will not install when doing a bundle install or sudo bundle install and exits with the following error:
Installing bcrypt-ruby (2.1.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
Gem files will remain installed in /home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4 for inspection.
Results logged to /home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
An error occured while installing bcrypt-ruby (2.1.4), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '2.1.4'` succeeds before bundling.
However, gem install bcrypt-ruby -v '2.1.4' runs just fine (and in fact has already been run on this box). Running /usr/bin/ruby1.8 extconf.rb manually works just fine, and the resulting Makefile also runs with make just fine.
I'm using Ruby 1.8.7 and bundler 1.0.21 on Ubuntu 10.04.1 LTS. Other gems seem to be working fine through bundler. Though this is probably obvious, I've confirmed that the ruby-dev, gcc, etc packages are installed. I've tried using the --deployment option with bundler with no different behavior. The only thing I can think that has changed recently is I did a bundle update a couple days ago, so bundle got a minor version change (1.0.10 -> 1.0.21) and bcrypt appears to have gotten a major version change (2.1.4 -> 3.0.1).
Any help is appreciated!
Have you upgraded to Lion since you installed Ruby 1.9.2? If so it is probably linked to the wrong gcc.
Try uninstalling and reinstalling 1.9.2, I would suggest using rvm
rvm uninstall 1.9.2
rvm install 1.9.2
If that does not work you might have to implode rvm
rvm implode
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source ~/.bash_profile
rvm install 1.9.2
try:
sudo apt-get install build-essential

Resources