We are happy to announce a new version of JRuby stack: 1.7.5. For those of you who may not be familiar with the project, JRuby is a 100% Java implementation of the Ruby programming language. It is Ruby for the JVM. JRuby provides a complete set of core “builtin” classes and syntax for the Ruby language, as well as most of the Ruby Standard Libraries.
The goal of JRuby 1.7 point releases is to fill out any missing compatibility issues with Ruby 1.9.3. This version fixed a number of issues related to compatibility and performance. You can find the list of the bugs fixed and new features here.
BitNami JRuby stack is a free self-contained package that simplifies the development and deployment of JRuby applications. This version includes ready-to-run versions of Java 1.7.0_40, Apache Tomcat 7.0.42, MySQL 5.5.32, JRuby 1.7.5 and all required dependencies.
It can be deployed using all-in-one free native installers (for Windows, Linux and Mac OS X), virtual machines and Cloud Images. Check it out!
Showing posts with label jruby. Show all posts
Showing posts with label jruby. Show all posts
Thursday, October 10, 2013
Wednesday, May 22, 2013
Experimental 2.0.0 support in JRuby 1.7.4. BitNami JRuby Stack updated.
We are happy to announce a new release of BitNami JRubyStack which now includes JRuby 1.7.4.
We have also updated other major components of the Stack, including Tomcat 7 and Java 7, Rails 3, bundler and other useful gems. As with all BitNami Stacks, you can get the latest JRuby Stack for free as a native installer or virtual appliance. The cloud images for both the Windows Azure and the Amazon cloud will be available as well.
While the primary goal of 1.7 point releases is to fill out any missing compatibility issues with Ruby 1.9.3, JRuby 1.7.4 already includes experimental Ruby 2.0 support. JRuby 1.7 defaults to 1.9 mode, but it is both Ruby 1.8 & Ruby 1.9 compatible and both versions of Ruby are bundled in a single install. JRuby 1.7.4 also allows you to start testing Ruby 2.0.0. For more details about the new features, see the JRuby Release notes.
Here is how you can use the Ruby 2.0.0 mode in your BitNami JRuby Stack installation. You can also check our quick start guide for getting started with BitNami JRuby Stack.
Then execute:
On Windows use the entry in the Start Menu: BitNami JRubyStack —> Use BitNami JRubySTack
Once you are in the console execute:
The output you receive will include:
On Linux and Mac OS X execute:
On Windows:
Now executing
Notice that once you close the terminal this configuration will be lost.
On Linux and Mac OS X edit the
On Windows edit the
Now if you open the BitNami JRuby Stack console (as explained above) and execute
We have also updated other major components of the Stack, including Tomcat 7 and Java 7, Rails 3, bundler and other useful gems. As with all BitNami Stacks, you can get the latest JRuby Stack for free as a native installer or virtual appliance. The cloud images for both the Windows Azure and the Amazon cloud will be available as well.
While the primary goal of 1.7 point releases is to fill out any missing compatibility issues with Ruby 1.9.3, JRuby 1.7.4 already includes experimental Ruby 2.0 support. JRuby 1.7 defaults to 1.9 mode, but it is both Ruby 1.8 & Ruby 1.9 compatible and both versions of Ruby are bundled in a single install. JRuby 1.7.4 also allows you to start testing Ruby 2.0.0. For more details about the new features, see the JRuby Release notes.
Here is how you can use the Ruby 2.0.0 mode in your BitNami JRuby Stack installation. You can also check our quick start guide for getting started with BitNami JRuby Stack.
1. Open the BitNami JRubyStack console.
On Linux and Mac OS X open a terminal and go to the installation directory.Then execute:
./jrubyconsole
On Windows use the entry in the Start Menu: BitNami JRubyStack —> Use BitNami JRubySTack
Once you are in the console execute:
jruby -v
The output you receive will include:
jruby 1.7.4 (1.9.3p392)
2. Ruby 2.0.0 mode just for this session
If you want to use Ruby 2.0.0 mode just for this session, but use the 1.9.3 mode as the default, just need to add the JRUBY_OPTS environment variable for this session.On Linux and Mac OS X execute:
export JRUBY_OPTS=--2.0
On Windows:
set JRUBY_OPTS=--2.0
Now executing
jruby -v
will show:jruby 1.7.4 (2.0.0)
Notice that once you close the terminal this configuration will be lost.
3. Ruby 2.0.0 mode as default mode
If you want to set Ruby 2.0.0 mode as the default mode (so you don’t need to configure it every time) edit the environment settings for you BitNami JRubyStack by doing the following.On Linux and Mac OS X edit the
setenv.sh
file that you can find in the scripts directory of your installation by adding the line:export JRUBY_OPTS=--2.0
On Windows edit the
setenv.bat
file in the scripts directory of your installation by adding the line:set JRUBY_OPTS=--2.0
Now if you open the BitNami JRuby Stack console (as explained above) and execute
jruby -v
you will see that you are working with the Ruby 2.0.0 mode.
Tuesday, February 26, 2013
JRuby 1.7.3 released on BitNami, fixes security issues
Many popular runtimes and frameworks have been affected by serious security issues, including Ruby on Rails and Django. We have been issuing updated versions of those stacks affected. Now it is the turn for JRuby.
A critical patch update for Java SE and a new Java SE version were released recently to fix multiple security vulnerabilities.
JRuby has also released an updated version to address two address security issues. All users are encouraged to upgrade JRuby to 1.7.3.
BitNami JRuby Stack for JRuby 1.7.3 is already available. It provides free, all-in-one installers for Windows, OS X and Linux, virtual machines and cloud images for both Amazon and Azure clouds. It provides a self-contained JRuby environment which includes JRuby, Rails, Java, Tomcat and MySQL.
If you are a JRuby user, please do update as soon as possible.
A critical patch update for Java SE and a new Java SE version were released recently to fix multiple security vulnerabilities.
JRuby has also released an updated version to address two address security issues. All users are encouraged to upgrade JRuby to 1.7.3.
BitNami JRuby Stack for JRuby 1.7.3 is already available. It provides free, all-in-one installers for Windows, OS X and Linux, virtual machines and cloud images for both Amazon and Azure clouds. It provides a self-contained JRuby environment which includes JRuby, Rails, Java, Tomcat and MySQL.
If you are a JRuby user, please do update as soon as possible.
Tuesday, October 30, 2012
BitNami JRuby Stack 1.7.0 released! Run Your JRuby App in the Cloud
A week ago, JRuby 1.7.0 was released. We have been anxiously awaiting this release and have updated the BitNami JRuby Stack to include this new version. We have also updated other major components of the Stack, including Tomcat 7 and Java 7, rails 3, bundler and other useful gems. As with all BitNami Stacks, you can get the latest JRuby Stack for free as a native installer, virtual appliance or AMI for the Amazon cloud.
The BitNami JRuby Stack now defaults to 1.9 mode, but it is both Ruby 1.8 & Ruby 1.9 compatible and both versions of Ruby are bundled in a single install. JRuby 1.7 is the first release to support the new “invokedynamic” feature of the JVM. For more details, see the JRuby Release notes.
Let's take a quick look at the latest JRuby release. For that, we will launch a BitNami JRuby Stack AMI. Later, we can use this same AMI to host our application in production in the cloud. To follow along, you will need an Amazon account to access the Amazon Web Services (AWS) Console. Instructions on how to create your account can be found here (note that Amazon offers a free tier which provides you with a free micro instance for a year). Once you login to the AWS Console, go to the EC2 tab and launch a new Instance. You can locate the BitNami JRuby Stack image by searching in the Community AMIs tab for "jrubystack-1.7.0-0", which is the latest version at the time of this writing.
Another option is to launch your AMI directly from the BitNami website. Select your preferred region (United States, Europe or Asia) from the drop down menu and the architecture (32 or 64 bits) and click on the appropriate link as shown in the image below.
Then, you can set different parameters from the AWS Console, such as: availability zone, ssh key, the image type (micro, small, medium, etc) and the security group. Once the machine is started, access it by typing the public DNS name in a browser. You should see something similar to the screenshot below.
The next step involves connecting to the machine. You can download the private SSH key from your Amazon account. If you want to connect to the machine from Windows using the popular tool Putty, you will need to convert your private key to the .PPK format. Take a look at this tutorial if you are not sure how to perform this conversion.
On Linux or OS X, you can open a Terminal and run the following command:
$ ssh -i /path/to/your/private/key.pem bitnami@ec2-xx-xx-xx-amazonaws.com
You will see a welcome message similar to:
Below we will follow some of the steps in this guide.
The installation directory of BitNami JRuby in the AMI (and also in the virtual machines) is /opt/bitnami and you will need to login as root.
Now that we have loaded the BitNami environment, we can start using JRuby. Let's check the current version.
As you can see, JRuby is running in 1.9 mode which is the default for JRuby 1.7.
If you want to use Ruby 1.8 mode, you can add
To launch Ruby applications with JRuby you can execute the following:
or
The switch
However, if you want to run the scripts of your application, you will not use the -S switch. In this case, JRuby will look for the script in your actual directory. You can find a demo project in /opt/bitnami/projects/jrubystack.
Note that we are launching the development server in port 80. This is because, by default, port 3000 (the default for rails server) will not be accessible in the AMI if you didn't enable it in the security group (which for security reasons is good).
Once you have developed your application, you can also create a .war file to run it on Tomcat. For that, you can user the warbler gem (also included in the stack).
In the AMI and virtual machines, you will need to change the permissions to the .war file to allow the user tomcat to deploy it.
The jrubystack demo project is configured with MySQL. We now need to make sure that both Tomcat and MySQL are started.
The jrubystack war file should have been deployed in Tomcat and the application should be accessible in
Now that you are running your server in the cloud, you can easily migrate it into BitNami Cloud Hosting and get additional services like scheduled backup, start/stop policy and monitoring. If you want to import your JRuby server to BitNami Cloud Hosting to take advantage of these services, view our tutorial. Our developer plan in BitNami Cloud Hosting allows you to deploy and manage one micro instance for free!
The JRuby team has mentioned that it plans on putting out point releases of 1.7.x every 2-3 weeks for the foreseeable future. Keep an eye on BitNami for getting the read-to-run BitNami Stacks with the latest versions!
The BitNami JRuby Stack now defaults to 1.9 mode, but it is both Ruby 1.8 & Ruby 1.9 compatible and both versions of Ruby are bundled in a single install. JRuby 1.7 is the first release to support the new “invokedynamic” feature of the JVM. For more details, see the JRuby Release notes.
Let's take a quick look at the latest JRuby release. For that, we will launch a BitNami JRuby Stack AMI. Later, we can use this same AMI to host our application in production in the cloud. To follow along, you will need an Amazon account to access the Amazon Web Services (AWS) Console. Instructions on how to create your account can be found here (note that Amazon offers a free tier which provides you with a free micro instance for a year). Once you login to the AWS Console, go to the EC2 tab and launch a new Instance. You can locate the BitNami JRuby Stack image by searching in the Community AMIs tab for "jrubystack-1.7.0-0", which is the latest version at the time of this writing.
Another option is to launch your AMI directly from the BitNami website. Select your preferred region (United States, Europe or Asia) from the drop down menu and the architecture (32 or 64 bits) and click on the appropriate link as shown in the image below.
Then, you can set different parameters from the AWS Console, such as: availability zone, ssh key, the image type (micro, small, medium, etc) and the security group. Once the machine is started, access it by typing the public DNS name in a browser. You should see something similar to the screenshot below.
The next step involves connecting to the machine. You can download the private SSH key from your Amazon account. If you want to connect to the machine from Windows using the popular tool Putty, you will need to convert your private key to the .PPK format. Take a look at this tutorial if you are not sure how to perform this conversion.
On Linux or OS X, you can open a Terminal and run the following command:
$ ssh -i /path/to/your/private/key.pem bitnami@ec2-xx-xx-xx-amazonaws.com
You will see a welcome message similar to:
Below we will follow some of the steps in this guide.
The installation directory of BitNami JRuby in the AMI (and also in the virtual machines) is /opt/bitnami and you will need to login as root.
bitnami@ip-xx-xx-xx-xx:~$ sudo su
root@ip-xx-xx-xx-xx:/home/bitnami# cd /opt/bitnami
root@ip-xx-xx-xx-xx:/opt/bitnami# ./jrubyconsole
Now that we have loaded the BitNami environment, we can start using JRuby. Let's check the current version.
bash-4.2# jruby -v
jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) 64-Bit Server VM 1.7.0_09-b05 [linux-amd64]
As you can see, JRuby is running in 1.9 mode which is the default for JRuby 1.7.
If you want to use Ruby 1.8 mode, you can add
JRUBY_OPTS=--1.8
environment variable (you can find more details in the guide).To launch Ruby applications with JRuby you can execute the following:
jruby -S command-name
or
jruby command-name
The switch
-S
indicates JRuby that should run following command from its binary directory (jruby/bin). For instance:
bash-4.2# jruby -S gem list
*** LOCAL GEMS ***
actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
ActiveRecord-JDBC (0.5)
activerecord-jdbc-adapter (1.2.2)
activerecord-jdbcmysql-adapter (1.2.2)
activerecord-jdbcsqlite3-adapter (1.2.2)
activeresource (3.2.8)
activesupport (3.2.8)
allison (2.0.3)
ansi (1.4.3)
arel (3.0.2)
bouncy-castle-java (1.5.0146.1)
builder (3.0.0)
bundler (1.1.5)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
echoe (4.6.3)
erubis (2.7.0)
execjs (1.4.0)
highline (1.6.15)
hike (1.2.1)
hpricot (0.8.6 java)
i18n (0.6.0)
jdbc-mysql (5.1.13)
jdbc-sqlite3 (3.7.2)
journey (1.0.4)
jquery-rails (2.0.2)
jruby-jars (1.6.6)
jruby-openssl (0.7.6.1)
jruby-rack (1.1.3)
json (1.7.5 java)
json_pure (1.7.5)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
mustache (0.99.4)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-mount (0.8.3)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
ronn (0.7.3)
rubyforge (2.0.4)
rubyzip (0.9.6.1)
sass (3.1.20)
sass-rails (3.2.5)
sprockets (2.4.5, 2.1.3)
therubyrhino (1.73.1)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
turn (0.9.6)
tzinfo (0.3.33)
uglifier (1.2.6)
warbler (1.3.2)
However, if you want to run the scripts of your application, you will not use the -S switch. In this case, JRuby will look for the script in your actual directory. You can find a demo project in /opt/bitnami/projects/jrubystack.
bash-4.2# cd projects/jrubystack/
bash-4.2# jruby script/rails -h
Usage: rails COMMAND [ARGS]
The most common rails commands are:
generate Generate new code (short-cut alias: "g")
console Start the Rails console (short-cut alias: "c")
server Start the Rails server (short-cut alias: "s")
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: "db")
new Create a new Rails application. "rails new my_app" creates a
new application called MyApp in "./my_app"
In addition to those, there are:
application Generate the Rails application code
destroy Undo code generated with "generate" (short-cut alias: "d")
benchmarker See how fast a piece of code runs
profiler Get profile information from a piece of code
plugin Install a plugin
runner Run a piece of code in the application environment (short-cut alias: "r")
All commands can be run with -h (or --help) for more information.
bash-4.2# jruby script/rails server -p 80
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:80
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-10-29 16:59:58] INFO WEBrick 1.3.1
[2012-10-29 16:59:58] INFO ruby 1.9.3 (2012-10-22) [java]
[2012-10-29 16:59:58] INFO WEBrick::HTTPServer#start: pid=2156 port=80
Note that we are launching the development server in port 80. This is because, by default, port 3000 (the default for rails server) will not be accessible in the AMI if you didn't enable it in the security group (which for security reasons is good).
Once you have developed your application, you can also create a .war file to run it on Tomcat. For that, you can user the warbler gem (also included in the stack).
bash-4.2# jruby -S warble config
cp /opt/bitnami/jruby/lib/ruby/gems/1.9/gems/warbler-1.3.2/warble.rb config/warble.rb
bash-4.2# jruby -S warble war
rm -f jrubystack.war
Creating jrubystack.war
bash-4.2# cp jrubystack.war /opt/bitnami/apache-tomcat/webapps/
In the AMI and virtual machines, you will need to change the permissions to the .war file to allow the user tomcat to deploy it.
bash-4.2# chown -R tomcat.tomcat /opt/bitnami/apache-tomcat/webapps/jrubystack.war
The jrubystack demo project is configured with MySQL. We now need to make sure that both Tomcat and MySQL are started.
bash-4.2# /opt/bitnami/ctlscript.sh restart
/opt/bitnami/apache-tomcat/scripts/ctl.sh : tomcat not running
/opt/bitnami/mysql/scripts/ctl.sh : mysql stopped
/opt/bitnami/mysql/scripts/ctl.sh : mysql started at port 3306
/opt/bitnami/apache-tomcat/scripts/ctl.sh : tomcat started
The jrubystack war file should have been deployed in Tomcat and the application should be accessible in
http://ec2-xx-xx-xx-amazonaws.com/jrubystack
Now that you are running your server in the cloud, you can easily migrate it into BitNami Cloud Hosting and get additional services like scheduled backup, start/stop policy and monitoring. If you want to import your JRuby server to BitNami Cloud Hosting to take advantage of these services, view our tutorial. Our developer plan in BitNami Cloud Hosting allows you to deploy and manage one micro instance for free!
The JRuby team has mentioned that it plans on putting out point releases of 1.7.x every 2-3 weeks for the foreseeable future. Keep an eye on BitNami for getting the read-to-run BitNami Stacks with the latest versions!
Friday, May 4, 2012
JRuby 1.6.7.2
We have released an updated BitNami JRuby Stack. According to the official JRuby site all users are encouraged to upgrade to this new JRuby version:
"This is a special release of JRuby which only updates our shipped copy of RubyGems to version 1.8.24. This version of RubyGems is the first version to verify that a RubyGems server certficate is valid. This helps to prevent a “man in the middle” style of attack when someone controls a portion of the network between you and the RubyGems server. All users are encouraged to upgrade to JRuby 1.6.7.2."
Apart from JRuby, this stack also includes updated Tomcat and Java versions.
If you haven't started with JRuby yet and you want to give it a try, take a look at our Quick Start Guide.
Enjoy!
Tuesday, February 21, 2012
New BitNami JRuby 1.6.6 all-in-one installer and VMs released
Thanks to JRuby and the Warbler gem you can easily make a .war file from your rails projects that can be deployed with Tomcat. The rest of this post shows you how easy it is to do so. It assumes you have installed BitNami JRubyStack previously:
Here are the steps:
1 . Open a rubyconsole and move to your Rails application directory:
cd jrubystack
2. Use the Warbler gem to generate a config/warble.rb file:
jruby -S warble config
3 . Generate the .war file and copy it to the Tomcat's webapps directory.
On Unix systems:
jruby -S warble war
cp jrubystack.war ../../apache-tomcat/webapps
jruby -S warble war
cp jrubystack.war ../../apache-tomcat/webapps
On Windows:
jruby -S warble war
copy jrubystack.war c:\Program Files\BitNami JRubyStack\apache-tomcat\webapps
Once Tomcat is started you can point your browser to http://localhost:8080/jrubystack
It's that easy!
Subscribe to:
Posts (Atom)