`
sillycat
  • 浏览: 2487505 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

buildr(1)Introduce and Install

阅读更多
buildr(1)Introduce and Install

1. Install on Linux
>wget http://buildr.apache.org/scripts/install-linux.sh
>sudo sh install-linux.sh

It told me that I need these things as follow:
No package ruby available.
No package rubygems available.
No package ruby-devel available.
No package gcc available.

Hard to believe that. So many things to do on redhat.

message:
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package httpd-devel available.
Nothing to do

solution:
>vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-$releasever – Base
baseurl=http://mirror.centos.org/centos/4/os/x86_64/
gpgcheck=1

[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/4/os/x86_64/
gpgcheck=1

>sudo yum clean all
>sudo yum update --skip-broken

Install gcc, git on my system.
>sudo yum install glibc-kernheaders --skip-broken

Some cycle dependency here.

try to prepare rvm and install ruby1.9.2, and install gem then.

2. Install on Ubuntu
Install ruby related things
>sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential

make sure I installed gem on my system
>gem --version
1.8.6

make sure JAVA is there on my system
>echo $JAVA_HOME
/usr/lib/jvm/java-6-sun

Install buildr
>sudo env JAVA_HOME=$JAVA_HOME gem install buildr

Other commands to upgrade a new version or install a specific version:
>sudo env JAVA_HOME=$JAVA_HOME gem update buildr
>sudo env JAVA_HOME=$JAVA_HOME gem install buildr -v 1.4.3

>sudo buildr test
error message:
RuntimeError : Are we forgetting something? JAVA_HOME not set.

solutions:
>sudo env JAVA_HOME=$JAVA_HOME buildr test

3. Install on windows
Install ruby tools on windows first http://rubyinstaller.org/downloads/archives, download the file with version 1.8.6
http://rubyforge.org/frs/download.php/71066/rubyinstaller-1.8.6-p398.exe

set JAVA_HOME

execute the install command
>gem install buildr --platform nswin32

error message:
'make' is not recognized as an internal or external command, operable program or batch file.

solution:
Install the DEVKIT, update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

Add this directory to path: D:\tool\devkit\bin

Fix this problem, but other problem accured. My windows system is 64bit win7.

error message:
jniwrap.h:24: error: 'long long long' is too long for GCC
jniwrap.h:24: error: 'long long long' is too long for GCC
jniwrap.h:24: warning: useless type name in empty declaration

Solutions:
try install MinGW via this URL http://sourceforge.net/projects/mingw/files/

>gem install buildr --platform x86-nswin32

The problem is still there, maybe that is something related to my 64-bit system. I fail to install this on windows.

I tried to update my ruby to 1.9.2 and update my gem.

Using this command to check the envrionment
>gem evn
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.13
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i386-mingw32]
  - INSTALLATION DIRECTORY: D:/tool/Ruby192/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: D:/tool/Ruby192/bin/ruby.exe
  - EXECUTABLE DIRECTORY: D:/tool/Ruby192/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32

>gem install rjb --platform x86-mswin32
>gem install buildr --platform x86-nswin32

edit the file in this directory D:/tool/Ruby192/lib/ruby/gems/1.9.1/gems/rjb-1.3.3/ext/jniwrap.h, change the line
from
typedef long long __int64;
to
typedef long long long64;

>cd D:/tool/Ruby192/lib/ruby/gems/1.9.1/gems/rjb-1.3.3/ext
>make
>make all
>make install
>cd ..
>gem spec ../../cache/rjb-1.3.3.gem --ruby > ../../specifications/rjb-1.3.3.gemspec

try again
>gem install buildr --platform x86-nswin32
>buildr --version

successful here. but error message in next steps
>buildr compile
error message:
Buildr aborted!
RuntimeError : can't create Java VM

solutions:
>gem install rjb -v 1.3.8 --platform x86-mswin32-60 
>env JAVA_HOME=D:\tool\jdk1.6 gem install buildr -v 1.4.6 --platform x86-nswin32-60

>cd d:\tool\Ruby192\lib\ruby\gems\1.9.1\gems\rjb-1.3.8-x86-mswin32-60\test
>ruby test.rb
new error message:
The program can't start because msvcrt-ruby18.dll is missing from your computer.
Try reinstalling the program to fix this problem.
>gem uninstall rjb -v 1.3.8
>gem uninstall rjb -v 1.3.4

>gem install rjb -v 1.3.8 --platform x86-mswin32-60 
>gem uninstall rjb -v 1.3.3

rollback my ruby to 1.8.6, and gem 1.3.7
>gem install rjb -v 1.3.8 --platform x86-mswin32-60 
>env JAVA_HOME=D:\tool\jdk1.6 gem install buildr -v 1.4.6 --platform x86-nswin32-60

new error message:
The procedure entry point rb_str_set_len could not be located in the dynamic link library msvcrt-ruby18.dll

solutions:
>gem uninstall rjb -v 1.3.3
>gem list
>gem install rjb -v 1.3.3 --platform mswin32
In the mean time, change the file jniwrap.h
>gem uninstall buildr -v 1.4.6
>gem install buildr -v 1.4.6 --platform mswin32
>ruby -v -e "p ENV['JAVA_HOME']"
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
"D:\\tool\\jdk1.6"
>ruby -v -e "p ENV['LD_LIBRARY_PATH']"

C:\Ruby186\lib\ruby\gems\1.8\gems\rjb-1.3.4\ext/rjb.c:1135: undefined reference to `rb_str_set_len'

rollback back to 1.9.2
>gem install rjb -v 1.3.4 --platform ruby

>cd D:/tool/Ruby192/lib/ruby/gems/1.9.1/gems/rjb-1.3.4/ext
>make
>make all
>make install
>cd ..
>gem spec ../../cache/rjb-1.3.4.gem --ruby > ../../specifications/rjb-1.3.4.gemspec

Fail at last, I give up here.

4. Check the Installation
>sudo buildr --version
Buildr 1.4.6

5. Running Buildr
put a buildfile on that directory. Something like ant,
#clean and rebuild
>sudo buildr clean build
>sudo buildr install

The related things are ruby, rake, antwrap, yaml.

references:
http://buildr.apache.org/
http://rubyinstaller.org/
http://sillycat.iteye.com/blog/1133322
http://sillycat.iteye.com/blog/1156180
http://sillycat.iteye.com/blog/1154490
http://ryang.iteye.com/blog/1147759
http://www.cesclub.com/bw/jishuzhongxin/Webjishu/2011/0813/3504.html
http://devjete.wordpress.com/2011/01/31/installing-rjb-1-3-4-on-windows-7-32bit-wo-vc/
http://devjete.wordpress.com/2011/01/31/ruby-1-9-2-rails-3-sqlite3-rjb-1-3-4-on-windows-7-32bit/
http://devjete.wordpress.com/author/somehi/
https://issues.apache.org/jira/browse/BUILDR-549
http://www.shaunambrose.com/2010/11/11/how-to-fix-the-msvcrt-ruby18-dll-is-missing-from-your-computer-error-message-in-ruby-on-rails/
http://stackoverflow.com/questions/3250406/msvcrt-ruby18-dll-was-not-found-with-ruby
http://rjb.rubyforge.org/


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics