文档章节

by-2.2.0/ruby/backward/rubysig.h:14:2: warning: #w

netmouse
 netmouse
发布于 2015/04/17 14:57
字数 955
阅读 287
收藏 0

I was trying to upgrade Codetriage to use Ruby 2.2.0-preview, the latest Ruby version. The project is hosted on Heroku. So to upgrade I changed Rubyversion in Gemfile:

# Gemfile ruby '2.2.0' 

After that I tried to do bundle install:

bundle install 

And boom. Got error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.     /Users/prathamesh/.rbenv/versions/2.2.0-preview1/bin/ruby -r ./siteconf20141002-23644-1wbcnhc.rb extconf.rb ..... creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling accept.c In file included from accept.c:90: /Users/prathamesh/.rbenv/versions/2.2.0-preview1/include/ruby-2.2.0/ruby/backward/rubysig.h:14:2: warning: rubysig.h is obsolete [-W#warnings] #warning rubysig.h is obsolete  ^ accept.c:101:2: error: use of undeclared identifier 'TRAP_BEG'         TRAP_BEG;         ^ accept.c:103:2: error: use of undeclared identifier 'TRAP_END'         TRAP_END;         ^ 1 warning and 2 errors generated. make: *** [accept.o] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/prathamesh/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/gems/kgio-2.8.0 for inspection. Results logged to /Users/prathamesh/.rbenv/versions/2.2.0-preview1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/kgio-2.8.0/gem_make.out An error occurred while installing kgio (2.8.0), and Bundler cannot continue. Make sure that `gem install kgio -v '2.8.0'` succeeds before bundling. 

kgio gem is dependency of unicorn which is the application server used by Codetriage. Looking at documentation of kgio, I found out that latest gem version is 2.9.2 while as our Gemfile.lock still had 2.8.0.

The exact changelog entry is:

commit 6243d74cc8296d40a66969594e42963c896968ee Author: Eric Wong <e@80x24.org> Date:   Sat Feb 15 09:21:07 2014 +0000     kgio 2.9.2 - avoid deprecated/removed function     This release is for compatibility with future releases of mainline ruby,     as rb_thread_blocking_region is removed in r44955 of ruby trunk     This also avoids deprecation warnings fo rb_thread_blocking_region     2.0 and 2.1. 

So looks like this is the version that should be used with new versions of Ruby.

Solution

Replaced 2.8.0 with 2.9.2 for kgio gem in Gemfile.lock:

# Gemfile.lock       multi_json (>= 1.5)     kgio (2.9.2)     kramdown (1.3.2) 

After updating Gemfile.lock and running bundle install again, it completed successfully. I was able to run the app using Unicorn on Ruby 2.2.0-preview1.

See this PR to see more details.

Happy Hacking!

Update

After i submitted the PR, the tests could not be run on Travis because of error related to installing raindrops gem which is also dependency of Unicorn:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.     /home/travis/.rvm/rubies/ruby-2.2.0-preview1/bin/ruby -r ./siteconf20141002-1677-1g08hg8.rb extconf.rb .... linux_inet_diag.c:28:2: error: ‘TRAP_BEG’ undeclared (first use in this function) linux_inet_diag.c:28:2: note: each undeclared identifier is reported only once for each function it appears in linux_inet_diag.c:30:2: error: ‘TRAP_END’ undeclared (first use in this function) linux_inet_diag.c: At top level: linux_inet_diag.c:22:1: warning: ‘rb_thread_blocking_region’ defined but not used [-Wunused-function] make: *** [linux_inet_diag.o] Error 1 

I did not had this problem locally when I did bundle install. But to fix this, I again checked documentation for raindrops. Turns out that the latest release of raindrops is 0.13.0 whereas Gemfile.lock was still pointing to 0.11.0. Also this release is specific to 2.2.0 according to changelog.

commit d24900b305a02cdedc4a532253798117f9686b5c Author: Eric Wong <e@80x24.org> Date:   Tue Feb 18 20:57:46 2014 +0000     raindrops 0.13.0  several minor fixes and improvements     Most notably, this release is necessary for Ruby 2.2 (dev).     Thanks to Koichi Sasada for the bug report!     Eric Wong (5):           Rakefile: remove raa_update task           last_data_recv: do not assume Unicorn includes all constants           raindrops.gemspec: add wrongdoc dev dependency           linux_inet_diag: fix Ruby 2.2 (dev) build           license: use LGPLv2.1 or later (was LGPL (2.1|3.0)-only)     Hleb Valoshka (1):           Remove Scope IDs from IPv6 addresses. 

Again applied same fix by changing Gemfile.lock and now raindrops is installed on Travis.

After effects of updating openssl on Mac OS X

26 Sep 2014

Today, my openssl library on Mac OS X Mavericks got updated. After the update, when i tried doing rails s on one of the rails apps, it gave following error:

/Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.2.0.beta1/lib/rails/app_rails_loader.rb:39: warning: Insecure world writable dir /usr in PATH, mode 040777 /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.7.2/lib/bundler.rb:302: warning: Insecure world writable dir /usr in PATH, mode 040777 /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/2.1.0/openssl.rb:17:in `require': dlopen(/Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method (LoadError)   Referenced from: /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle   Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib  in /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle - /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle     from     /Users/prathamesh/.rbenv/versions/2.1.2/lib/ruby/2.1.0/openssl.rb:17:in     `<top (required)>' 

Seems like the link between openssl and Ruby is broken after the update. Fortunately the fix is very simple. Re-install Ruby again. It will re-link the updated openssl and this problem will be gone.

$ rbenv install 2.1.2      [2.1.2] rbenv: /Users/prathamesh/.rbenv/versions/2.1.2 already exists continue with installation? (y/N) y Downloading ruby-2.1.2.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/a5b5c83565f8bd954ee522bd287d2ca1 Installing ruby-2.1.2... 

After installing the Ruby again, rails s started without any complains.

Hope this saves some time to somebody! Happy Hacking :)

Talk at RubyKaigi

25 Sep 2014

Recently, I gave a talk at RubyKaigi 2014. It was pretty awesome to talk at RubyKaigi. Here are my slides for the talk.

And here is the video.

© 著作权归作者所有

共有 人打赏支持
netmouse
粉丝 4
博文 85
码字总数 32292
作品 0
青岛
部门经理
私信 提问
ELK—>logstash—>ruby·plugin—>实现精彩的功能(term模板抽取)

ELK—>logstash—>ruby·plugin—>实现精彩的功能(term模板抽取) --- 效果展示 抽取之前这样出图 抽取之后这样出图 甚至我们之后还想出更花哨的图~唯一的方式就是我们去抽取索引(当然如果...

杨春炼
2016/04/27
418
0
Ruby 2.2.0-preview1 发布

Ruby 2.2.0-preview1 发布,此版本是 Ruby 2.2.0 的第一个预览版,包括许多新特性和改进,更多多样化改进和 Ruby 要求的提升。比如,Symbol GC 增加 Symbol 垃圾回收,降低 Symbols 的内存使...

oschina
2014/09/19
1K
2
puppet自动化运维之puppet安装篇

puppet自动化运维之puppet安装篇 注:要在安装软件以前先设置主机名,因为生成证书的时候要把主机名写入证书,如果证书生成好了再改主机名,就连不上,这是很多初学者遇到问题。每个客户端的证...

perofu
2014/04/23
0
2
Deep learning 1.4 作業1

Building your Deep Neural Network: Step by Step Welcome to your week 4 assignment (part 1 of 2)! You have previously trained a 2-layer Neural Network (with a single hidden layer......

zzbb
05/09
0
0
rake stats 自定义文件目录代码统计及 UTF-8 编码问题解决

1、修改文件C:Ruby22-x64librubygems2.2.0gemsrailties-4.2.3librailstasksstatistics.rake,增加自定义统计代码的目录。 2、某些文件中有UTF-8编码的异常问题。运行rake stats显示异常。 D:...

haibor
2017/11/23
0
0

没有更多内容

加载失败,请刷新页面

加载更多

jquery通过id显示隐藏

var $div3 = $('#div3'); 显示 $div3.show(); 隐藏 $div3.hide();

yan_liu
今天
3
0
《乱世佳人》读书笔记及相关感悟3900字

《乱世佳人》读书笔记及相关感悟3900字: 之前一直听「荔枝」,后来不知怎的转向了「喜马拉雅」,一听就是三年。上班的时候听房产,买房了以后听装修,兴之所至时听旅行,分手后听亲密关系,...

原创小博客
今天
3
0
大数据教程(9.6)map端join实现

上一篇文章讲了mapreduce配合实现join,本节博主将讲述在map端的join实现; 一、需求 实现两个“表”的join操作,其中一个表数据量小,一个表很大,这种场景在实际中非常常见,比如“订单日志...

em_aaron
今天
3
0
cookie与session详解

session与cookie是什么? session与cookie属于一种会话控制技术.常用在身份识别,登录验证,数据传输等.举个例子,就像我们去超市买东西结账的时候,我们要拿出我们的会员卡才会获取优惠.这时...

士兵7
今天
3
0
十万个为什么之为什么大家都说dubbo

Dubbo是什么? 使用背景 dubbo为什么这么流行, 为什么大家都这么喜欢用dubbo; 通过了解分布式开发了解到, 为适应访问量暴增,业务拆分后, 子应用部署在多台服务器上,而多台服务器通过可以通过d...

尾生
今天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部