Fix Thrift 0.2.0 Installation with Ruby 1.9.1
2010-02-28 01:41
225 查看
When I try the command "gem install thrift" with Ruby 1.9.1, I got a compilation error with something related to a C function "strlcpy()".
Then I searched the web. It seems I am not alone and the community know it.
However I do not want to wait for official update, I want to try Cassandra and Thrift is a dependency I have to use now.
So, read on if you want a dirty fix.
Start command line console and run:
$ gem install thrift
If you got the error with "strlcpy", you should have thrift code downloaded in your ruby gems folder.
It is "C:/Ruby/lib/ruby/gems/1.9.1/gems/thrift-0.2.0" for my computer on Windows.
$ cd C:/Ruby/lib/ruby/gems/1.9.1/gems/thrift-0.2.0/ext
If you are using linux, check the lib/.../ext folder.
Open "extconf.rb" and "struct.c" with a text editor. Comment out HAVE_STRLCPY in "struct.c" like this:
/*
#ifndef HAVE_STRLCPY
static
size_t
strlcpy (char *dst, const char *src, size_t dst_sz)
{ ...
}
#endif
*/
Comment out have_func line in "extconf.rb" like this:
# have_func("strlcpy", "string.h")
Then run:
$ cd C:/Ruby/lib/ruby/gems/1.9.1/gems/thrift-0.2.0
$ ruby setup.rb
$ gem spec C:/Ruby/lib/ruby/gems/1.9.1/cache/thrift-0.2.0.gem --ruby > /
C:/Ruby/lib/ruby/gems/1.9.1/specifications/thrift-0.2.0.gemspec
$ gem list
You should see "thrift (0.2.0)" is in your local installed gem list.
Then I searched the web. It seems I am not alone and the community know it.
However I do not want to wait for official update, I want to try Cassandra and Thrift is a dependency I have to use now.
So, read on if you want a dirty fix.
Start command line console and run:
$ gem install thrift
If you got the error with "strlcpy", you should have thrift code downloaded in your ruby gems folder.
It is "C:/Ruby/lib/ruby/gems/1.9.1/gems/thrift-0.2.0" for my computer on Windows.
$ cd C:/Ruby/lib/ruby/gems/1.9.1/gems/thrift-0.2.0/ext
If you are using linux, check the lib/.../ext folder.
Open "extconf.rb" and "struct.c" with a text editor. Comment out HAVE_STRLCPY in "struct.c" like this:
/*
#ifndef HAVE_STRLCPY
static
size_t
strlcpy (char *dst, const char *src, size_t dst_sz)
{ ...
}
#endif
*/
Comment out have_func line in "extconf.rb" like this:
# have_func("strlcpy", "string.h")
Then run:
$ cd C:/Ruby/lib/ruby/gems/1.9.1/gems/thrift-0.2.0
$ ruby setup.rb
$ gem spec C:/Ruby/lib/ruby/gems/1.9.1/cache/thrift-0.2.0.gem --ruby > /
C:/Ruby/lib/ruby/gems/1.9.1/specifications/thrift-0.2.0.gemspec
$ gem list
You should see "thrift (0.2.0)" is in your local installed gem list.
相关文章推荐
- Install Cassandra with Ruby 1.9.1 on Windows
- QT Opensource Edition for Windows CE Installation with Visual Studio 2005
- 小米系列手机调试Installation failed with message Failed to establish session
- andriodStudio真机运行 installation failes with message INSTALL_CANCELED_BY_USER 错误
- 安装LoadRunner时提示缺少vc2005_sp1_with_atl_fix_redist解决方案
- First Mac Installation on VMWare with XP host
- Installation failed with message:INSTALL_CANCELED_BY_USER
- 比较文件清单(Everyday Scripting with Ruby第三章试译)
- How to open and sort a CSV file with Ruby
- CentOS 6.0 fix for VBoxGuestAdditions installation for VirtualBox
- Installation failed with message Failed to finalize session : INSTALL_FAILED_NO_MATCHING_ABIS: Faile
- How to Get Started With JMeter: Part 1 - Installation & Test Plans
- Ruby on Rails Installation on windows xp
- pycuda installation error: command 'gcc' failed with exit status 1
- Installation failed with message null
- Installation with CocoaPods
- .NET with Ruby and ASP.NET vs. Rails [转载]
- 小米5调试Installation failed with message Failed to establish session.
- Pragmatic.Bookshelf.Enterprise.Integration.with.Ruby