If you are new to this, you pretty much have to do this exactly to get everything to work. If you miss something you’ll run into problems!
$ rvm get stable && rvm install jruby
$ rvm use jruby $ rvm gemset create torquebox $ rvm jruby-1.6.7.2@torquebox
Install Torquebox-Server via RVM and jruby gem install
$ jruby -S gem install torquebox-server
$ jruby -S gem install rails --pre --no-rdoc --no-ri
Use the torquebox template for creating a new rails app :), it puts it in a subfolder just like normal rails new myapp
$ torquebox rails myapp
$ cd myapp
$ jruby script/rails server
You should get something like this:
=> Booting WEBrick => Rails 3.2.8.rc2 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2012-08-27 21:19:01] INFO WEBrick 1.3.1 [2012-08-27 21:19:01] INFO ruby 1.9.3 (2012-08-07) [java] [2012-08-27 21:19:01] INFO WEBrick::HTTPServer#start: pid=31454 port=3000
Run this and verify that your ENV vars are set properly, if not torquebox deploy/undeploy won’t work
$ torquebox env
Make sure your environment variables look something like this, your username instead of “username”
TORQUEBOX_HOME=/Users/username/.rvm/gems/jruby-1.6.7.2@torquebox/gems/torquebox-server-2.1.1-java JBOSS_HOME=/Users/users/.rvm/gems/jruby-1.6.7.2@torquebox/gems/torquebox-server-2.1.1-java/jboss JRUBY_HOME=/Users/users/.rvm/rubies/jruby-1.6.7.2
Set your JRUBY Options: run with 1.9.x, turn on jit logging (turn off to make quieter in term)
JRUBY_OPTS="--1.9 -Xjit.logging=true" JRUBY_OPTS="--1.9 -Xjit.logging=false"
If you added Gems Bundle Install to make sure we’re all set up, if not torquebox rails already handled this¶ ↑
$ jruby -S bundle install
$ torquebox deploy .
$ torquebox run Browse localhost:8080 and there it is!
**NOTE: remember to run “$ rvm jruby-1.6.7.2@torquebox” if you leave the folder (with a .rvmrc) and come back, or you can set up your own .rvmrc but make sure you don’t lose your ENV vars or have them reset**
If you are still running app in Torquebox, CTRL-C to get out and continue
$ jruby -S gem install jcouchbase
gem 'jcouchbase'
$ jruby -S bundle install
Voila!