Ruby 2.3.1 is not compiling under Arch Linux - ruby

I've got a project using the following specification at Gemfile:
ruby '2.3.1', :engine => 'jruby', :engine_version => 'jruby-9.1.7.0'
and this was working fine under my old Debian 8.1 installation. But I decided to test Arch Linux and now I'm getting an error when I run
$ rvm install 2.3.1
The Error:
Segmentation fault (core file generated)
I've never faced an error like this and got no ideas about how to solve it. Any suggestions?
EDIT => As required, I posted all make.log file as a Github Gist. This is the link to it.

Related

gem install pam ... on Windows

I am trying to install "pam" on Windows. But starting
$ gem install pam
gives me
generating _pam-x64-mingw32.def
compiling pam_handle.c
In file included from pam_handle.c:5:0:
_pam.h:9:21: fatal error: version.h: No such file or directory
compilation terminated.
make: *** [pam_handle.o] Error 1
make failed, exit code 2
Ruby DevKit is installed and the Installation is checked with
$ gem install json --platform=ruby
$ ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect"
[42]
I doubt that version.h is unix/linux specific. Has anybody managed to install this gem on Windows?
It looks like pam gem is not supported anymore.
https://rubygems.org/gems/pam says, that the latest release was about 10 years ago.
I'd offer you to consider using some newer replacements, and the most common advice is Use some unix-based OS for Ruby development, instead of windows.

Trying to install ruby 1.9.3 on Alpine 3.4 fails

I'm trying to build an alpine:3.4 image with ruby 1.9.3 using rvm but I get the following error message:
io.o: In function `linux_iocparm_len':
/home/travis/.rvm/src/ruby-1.9.3-p551/io.c:8086: undefined reference to `_IOC_SIZE'
collect2: error: ld returned 1 exit status
Makefile:165: recipe for target 'miniruby' failed
I've been able to install both ruby 2.2 and 2.3 without any problems, but had no luck with 1.9.3
The command I used for 2.3 is
rvm install 2.3.0 --disable-binary --movable --autolibs=0
I've installed rvm from https://github.com/rvm/rvm/archive/stable.tar.gz
I solved this by backporting the same conditionals the latest version of Ruby has for _IOC_SIZE to ruby/io.c. I was able to compile and install afterwards.
The pull request is https://github.com/ruby/ruby/pull/1485, the fix is https://github.com/rallen-temp/ruby/commit/cbaaf34a0aa3c90f6a43d4383258c14a803bed12.
I also referenced this issue in the PR. Hope this helps anyone else that runs into this.

rbenv build failed on Ubuntu 14.04

I've successfully installed rbenv (along with the build tools) on my Ubuntu 14.04 desktop, and that appears to be working fine, but as soon as I try to install ruby 2.1.1, the build fails:
daniel#grape:~$ rbenv install 2.1.1
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /home/daniel/.rbenv/versions/2.1.1
Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20140418142258.3543
Results logged to /tmp/ruby-build.20140418142258.3543.log
Last 10 log lines:
installing default ripper libraries
compiling ossl_pkcs7.c
compiling ossl_ssl.c
installing default openssl libraries
linking shared-object openssl.so
make[2]: Leaving directory `/tmp/ruby-build.20140418142258.3543/ruby-2.1.1/ext/openssl'
linking shared-object ripper.so
make[2]: Leaving directory `/tmp/ruby-build.20140418142258.3543/ruby-2.1.1/ext/ripper'
make[1]: Leaving directory `/tmp/ruby-build.20140418142258.3543/ruby-2.1.1'
make: *** [build-ext] Error 2
The contents of the log file can be found here: http://pastebin.com/SXxTeCJY
I've done some searching for help with this issue, including following what is said here: https://github.com/sstephenson/ruby-build/wiki - but I've not had any joy.
UPDATE: Use Ruby 2.1.2, it fixes this issue.
14.04 is probably shipping with readline 6.3, which uses rl_hook_func_t instead of Function.
This bug has already been reported and fixed in Ruby (https://bugs.ruby-lang.org/issues/9578), but not released yet.
Until Ruby 2.1.2 comes out (which I assume will contain this fix), you can use a patch to properly support the new rl_hook_func_t method. Use this to install Ruby 2.1.1:
curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1
(Source: http://gorails.com/setup/ubuntu/14.04)
UPDATE: Ruby 2.1.2, fixes this issue. If you need to patch ruby with Chef for another reason follow the example here.
Chef installation of Ruby 2.1.1 on to Ubuntu 14.04 using LWRP
Code to patch Ruby 2.1.1 on Trusty Ubuntu (14.04) using Riotgames rbenv cookbook - cut and pasted - no warranty :-) I have a wrapper cookbook which is tested on Ubuntu 14.04 (release 1.0.4). Easiest way is get this going is to clone the repository and converge it on test kitchen. The main gotcha is that the cookbook uses Berkshelf 3.1.1 and most people are probably on 2 still. The pasted code should work on Berkshelf 2.x and 3.1.1.
Berksfile
cookbook 'rbenv', github: "RiotGames/rbenv-cookbook"
Metadata
depends 'rbenv'
Attributes (attributes/default.rb)
default['ruby']['version'] = '2.1.1'
Recipe (recipes/default.rb)
# patchutils is required to patch Ruby version
package 'patchutils'
include_recipe "rbenv::default"
include_recipe "rbenv::ruby_build"
# Installs a patched, global, ruby
rbenv_ruby node['ruby']['version'] do
global true
patch "https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45225/diff?format=diff"
end
Discussion for patch
Rich

Jekyll on Windows Liquid Exception: Failed to get header

I'm trying to use Jekyll on my windows 7 (64bit) PC.
I have installed Ruby, Ruby Devkit, Python 2.7, Jekyll and Pygments but getting this error
E:\jekyll\my-site>jekyll serve
Configuration file: E:/jekyll/my-site/_config.yml
Source: E:/jekyll/my-site
Destination: E:/jekyll/my-site/_site
Generating... Liquid Exception: Failed to get header. in 2013-07-19-welcome-to-jekyll.markdown
error: Failed to get header.. Use --trace to view backtrace
I also got this error, and a couple of other similar errors too, and finally got to a solution: you need to have a couple of compatible versions of the required Ruby, Python and Pygments.
Install Ruby 1.9.3-p448 version (download here);
Install Python 2.7.5 version (download here);
Install Pygments 0.5.0
gem uninstall pygments.rb
gem install pygments.rb --version "=0.5.0"
I hope it helps.
Edited: Don't forget to add the correct PATHs to your system variables. In my case, it was:
C:\Python27;C:\Ruby193
In order to improve this content, there is a simple tutorial (written in Portuguese, but I guess you can understand the steps, always considering the versions of software/plugins listed above) - view tutorial.
Another possible cause for this error message on Windows is that the path to the Pygments scripts contains spaces. Took me a while to figure this one out...
For my situation, install pygments 0.5.0 or 0.5.4 both have problem. I fixed by re-install python 2.7.6. Please refer to following answer:
https://github.com/jekyll/jekyll/issues/1181#issuecomment-35963876
I had two versions of python installed on my system.(Windows 8.1)
Python22 and Python27.
I removed Python22, added Python27 to System variables and issue got fixed.

Ruby OSA gem install problem

Trying to install rubyOSA on my iMac
sudo gem install rubyosa
I get the following error:
ERROR: Error installing rubyosa:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rubyosa-0.4.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rubyosa-0.4.0/gem_make.out
I've had this error show a lot of times while installing gems. I found out later that I needed the development package that included all the needed headers for compilation. On a debian machine they are in the ruby-dev package.
I was reading on the Internet that OS X ships the headers with XCode, so you might need to get them from there.
I found this link that might be of help to you: http://www.fngtps.com/2009/08/missing-ruby-headers-after-snow-leopard-upgrade [EDIT: original link broken, here's the internet archive of the page:
https://web.archive.org/web/20100327201647/http://www.fngtps.com/2009/08/missing-ruby-headers-after-snow-leopard-upgrade
I just found this GitHub project that allows compiling and installation on Snow Leopard. It installed cleanly for me and I was able to check a quick "require 'rbosa'" in irb:
irb(main):001:0> require 'rbosa'
=> true
irb(main):002:0> app = OSA.app('iTunes')
=> <OSA::ITunes::Application:0x102aae648 desc="'sign'($6B6F6F68$)">
irb(main):003:0> puts app.current_track.name
The Pipeline 3: Jason Fried
=> nil
irb(main):004:0>

Resources