package jruby gems in one jar for embedded used in java

jruby -S gem install jdbc-mysql activerecord-jdbcmysql-adapter
java -jar jruby-gems.jar -S rake -T
java -jar jruby-gems.jar -S gem install -i tmp jdbc-mysql activerecord-jdbcmysql-adapter jruby-openssl jdbc-sqlite3 activerecord-jdbcsqlite3-adapter activerecord-jdbchsqldb-adapter activerecord-jdbch2-adapter jdbc-h2 jdbc-hsqldb jdbc-postgres activerecord-jdbcpostgresql-adapter builder
java -jar jruby-gems.jar -S gem install -i tmp buildr
java -jar jruby-gems.jar -S gem update --system -i tmp
rm /home/mlzboy/jruby-gems-jar/tmp/cache/builder-3.0.0.gem
java -jar jruby-gems.jar -S gem install builder -i tmp
java -jar jruby-gems.jar -S gem list|grep build
java -jar jruby-gems.jar -S rake jruby:repackage
  mvn install:install-file -Dfile=/home/mlzboy/jruby-gems-jar/jruby-gems.jar -DgroupId=org.jruby -DartifactId=jruby-all -Dversion=1.6.7.2 -Dpackaging=jar

 

#coding:utf-8
require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
:adapter=> "jdbcmysql",
:host => "10.10.10.182",
:database=> "db",
:username => "root",
:password => "yy"
)

class OP < ActiveRecord::Base
  self.table_name="opponent_product"
end

op=OP.last
print op.id

 

 

https://github.com/watkyn/jruby-gems-jar

你可能感兴趣的:(package)