I have JRuby web app which is running in a Tomcat server on the deployment box. I used Warble to pack it up into a WAR file, and deploy on a server on which I also have JRuby installed. I run rbenv and JRuby 1.6.4 on both the development box and the deployment box.
My Gemfile looks like this:
source 'http://rubygems.org'
gem 'rails', '3.0.10'
gem 'rake', '0.8.7'
gem 'jquery-rails'
gem 'rest-client', '~> 1.6.7'
platforms :mri do
gem 'mysql2', '~> 0.2.11'
end
platforms :jruby do
gem 'jruby-openssl'
gem 'activerecord-jdbcmysql-adapter'
gem 'warbler'
end
I would like to run some of my custom Rake tasks. When I run my rake tasks in my development environment where I use ("rails server"), it works fine (I am using rbenv, and "rails server" does invoke JRuby 1.6.4, and I run "bundle exec rake abc:help").
My local list of gems looks like this:
user@ubuntu:~/abc$ gem list --local
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.10)
actionpack (3.0.10)
activemodel (3.0.10)
activerecord (3.0.10)
activerecord-jdbc-adapter (1.2.0)
activerecord-jdbcmysql-adapter (1.2.0)
activeresource (3.0.10)
activesupport (3.0.10)
arel (2.0.10)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
bundler (1.0.21)
erubis (2.6.6)
i18n (0.5.0)
jdbc-mysql (5.1.13)
jquery-rails (1.0.16)
jruby-jars (1.6.4)
jruby-openssl (0.7.4)
jruby-rack (1.0.10)
json (1.6.1 java)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.2)
rack (1.2.4)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.10)
railties (3.0.10)
rake (0.9.2, 0.8.7)
rdoc (3.11)
rest-client (1.6.7)
rubyzip (0.9.4)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.30)
warbler (1.3.2)
user@ubuntu:~/abc$
When the app is in the Tomcat tomcat/webapps/abc/* on a separate box, (which was exploded by Tomcat), and I go to the root directory, I get the following:
jgodse@host:~.../webapps/abc/WEB-INF$ bundle exec rake bcp:help --trace
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:2377:in `raw_load_rakefile'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/gems/rake-0.8.7/bin/rake:31:in `(root)'
org/jruby/RubyKernel.java:1073:in `load'
/home/jgodse/.rbenv/versions/jruby-1.6.4/lib/ruby/gems/1.9/bin/rake:19:in `(root)'
jgodse@host:~.../webapps/abc/WEB-INF$
My local gem list looks like this on the deployment box (where the Rails app is deployed in a WAR file).
jgodse@host:~/webapps/abc/WEB-INF$ gem list --local
abstract (1.0.0)
actionmailer (3.0.10)
actionpack (3.0.10)
activemodel (3.0.10)
activerecord (3.0.10)
activerecord-jdbc-adapter (1.2.0)
activerecord-jdbcmysql-adapter (1.2.0)
activeresource (3.0.10)
activesupport (3.0.10)
arel (2.0.10)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
bundler (1.0.21)
erubis (2.6.6)
i18n (0.5.0)
jdbc-mysql (5.1.13)
jquery-rails (1.0.16)
jruby-jars (1.6.4)
jruby-openssl (0.7.4)
jruby-rack (1.0.10)
json (1.6.1 java)
mail (2.2.19)
mime-types (1.17.2, 1.16)
polyglot (0.3.2)
rack (1.2.4)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.10)
railties (3.0.10)
rake (0.9.2.2, 0.8.7)
rdoc (3.11)
rest-client (1.6.7)
rubyzip (0.9.4)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.30)
warbler (1.3.2)
jgodse@host:~/webapps/abc/WEB-INF$
What am I missing to get my rake tasks to run out of my exploded WAR file directory?
Also, I am using Rake 0.8.7 because 0.9.2 caused me grief.
Warbler doesn't include your Rakefile by default, so you'll have to add it to config/warble.rb
. (Use warble config
to generate the file if you don't have it already.)