文档章节

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

netmouse
 netmouse
发布于 2015/04/17 14:57
字数 955
阅读 266
收藏 0
点赞 0
评论 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
博文 84
码字总数 32193
作品 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
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
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
Note, however, that nokogiri is not fully compatible with arbitrary

ruby 2.2 执行 gem install rails -v '4.2.0' -V 报错 IMPORTANT NOTICE: Building Nokogiri with a packaged version of libxml2-2.9.2 with the following patches applied: 0001-Revert-M......

jingdor
2015/04/09
450
2
TorqueBox 2.2.0 发布,Ruby 应用平台

TorqueBox 2.2.0 发布了,该版本包含很多新特性,以及修复了 2.1.2 中发现的 bug,建议升级,详细的改进记录请看这里。 相关链接: Download TorqueBox 2.2.0 (ZIP) Browse Getting Started ...

红薯
2012/12/08
373
1
装ekho的过程中始终不能安装成功

@黄冠能 你好,想跟你请教个问题: 我们在安装ekho的过程中始终不能安装成功,能否指教下,谢谢! configure: error: in config.log' for more details 如果 --without-pulseaudio 后 make 报...

fidelhuang
2012/10/26
930
1
学习ibatis,希望有共同方向的朋友。

最近在学习ibatis,真是很不错的东西。 目前已经是 apache下的开源项目。 不但有for java版本,甚至有for .net ,for ruby的版本。 ibaits将sql映射成对象。和hibernate的orm不同。非常灵活,...

晨曦之光
2012/03/09
0
0
ubuntu下配置hadoop的状态监控页面

一、配置Hadoop $ cd /usr/local/hadoop/etc/hadoop $ vim core-site.xml 将下面的内容复制到 <configuration> 标签内 <property><name>fs.default.name</name><value>hdfs://localhost:9000......

孟飞阳
2016/06/25
21
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

conda 换源

https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels https://mir......

阿豪boy
3分钟前
0
0
Confluence 6 安装补丁类文件

Atlassian 支持或者 Atlassian 缺陷修复小组可能针对有一些关键问题会提供补丁来解决这些问题,但是这些问题还没有放到下一个更新版本中。这些问题将会使用 Class 类文件同时在官方 Jira bug...

honeymose
13分钟前
0
0
设计模式:代理模式

代理模式可以分为三种:静态代理,动态代理,cglib代理 1.静态代理:被代理的类需要实现一接口或是继承一父类 委托类(被代理的类): package com.java.pattern.proxy.staticdemo;publ...

人觉非常君
16分钟前
0
0
非常实用的IDEA插件之总结

1、Alibaba Java Coding Guidelines 经过247天的持续研发,阿里巴巴于10月14日在杭州云栖大会上,正式发布众所期待的《阿里巴巴Java开发规约》扫描插件!该插件由阿里巴巴P3C项目组研发。P3C...

Gibbons
21分钟前
0
0
Tomcat介绍,安装jdk,安装tomcat,配置Tomcat监听80端口

Tomcat介绍 Tomcat是Apache软件基金会(Apache Software Foundation)的Jakarta项目中的一个核心项目,由Apache、Sun和其他一些公司及个人共同开发而成。 java程序写的网站用tomcat+jdk来运行...

TaoXu
22分钟前
0
0
TensorFlow,从一个 Android Demo 开始

TensorFlow Android Demo 项目地址 Machine Learning 既然提到了 TensorFlow,那是不是得神经网络、机器学习了解下? 如果你能坚持把 机器学习速成课程 给啃完了,觉得还挺有兴趣的,那可以考...

孟飞阳
23分钟前
0
0
JVM学习笔记二:内存结构规范

1、JVM基本结构图 2、java堆(Heap) 3、方法区(Method Area) 4、程序计数器 5、JAVA栈图解 局部变量表:八大基本类型,还可以存储引用类型 上一篇:JVM学习笔记一:类加载机制介绍...

刘祖鹏
29分钟前
0
0
mui集成微信H5支付(返回白屏问题已经解决)

一.项目需求 因为公司人员缺少,没有专门开发安卓和ios的人员,为了项目尽早上线采用了混合APP开发的方式,我选择了MUI混合开发框架,项目中需要在用户购买VIP会员的时候进行支付,所以需要在项目...

银装素裹
33分钟前
0
0
SpringBoot集成Redis--配置自定义的RedisCacheManager

配置自定义的RedisCacheManager--1自定义键生成规则 默认的键生成器 当不指定缓存的key时,SpringBoot会使用SimpleKeyGenerator生成key。 SimpleKeyGenerator SimpleKey 查看源码可以发现,它...

karma123
52分钟前
0
0
防火墙未来的发展趋势在哪里?

导读 防火墙(Firewall),也称防护墙,是由Check Point创立者Gil Shwed于1993年发明并引入国际互联网。当下互联网时代,无论是大小企业,大部分都会部署有防火墙的设备,但这些防火墙往往并不...

问题终结者
54分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部