Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Risberg
committed
Apr 3, 2012
1 parent
2c90566
commit 1f5ce8a
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
JRuby Rails Sample App | ||
====================== | ||
|
||
Usage Guide | ||
------------ | ||
|
||
This app is intended to show the changes you need to make to a Rails app when using JRuby in order to be able to deploy it to Cloud Foundry. | ||
|
||
### Running locally | ||
|
||
This application is configured to use MySQL so you would need to have this running locally. You would also need to have a working installation of JRuby. | ||
|
||
Clone this repository and run the application locally using: | ||
|
||
jruby -S rake db:create | ||
jruby -S rake db:migrate | ||
jruby -S rails server | ||
|
||
|
||
### Running on Cloud Foundry | ||
|
||
In addition to a working installation of JRuby you would also need to have the Warbler and vmc gems installed. | ||
|
||
Now we need to package the war using: | ||
|
||
jruby -S bundle install | ||
jruby -S rake assets:precompile | ||
jruby -S warble | ||
|
||
Then to deploy we need to do that from a different directory so we can configure rbenv or RVM to use C Ruby instead of JRuby which is needed by vmc | ||
|
||
mkdir deploy | ||
mv bookshelf.war deploy/. | ||
cd deploy | ||
rbenv local 1.9.2-p290 (if you use RVM the command should be 'rvm ruby-1.9.2-p290') | ||
|
||
Now we are ready to push the app to Cloud Foundry | ||
|
||
vmc target api.cloudfoundry.com | ||
vmc login cloud@mycompany.com | ||
vmc push bookshelf |