Jruby on rails development to the application deployed to tomcat
Environment
- windows XP
- jdk 6u12
- jruby 1.2.0
- rails 2.2.2
- netbeans 6.5.1
- tomcat 5.5
- mysql 5
Upgrade to jruby 1.2.0
jruby not used netbeans own version 1.1.4, due to the need gem version of rails 2.2.2 to 1.3, while the gem comes with jruby 1.1.4 version is 1.2, while prior to my first article which describes how jruby gem version to upgrade, but always failed when the deployment of the system continue to believe that the gem version 1.2, but had no choice but to adopt under the jruby 1.2.0, the download link
netbeans which can easily add and switch the ruby platform, you only need to manually specify the new 1.2.0 file on the list jruby.bat
However, this would have for the next re-install jruby 1.2.0 of the gem of all, among them the rapid installation of the debugger rather special, here the explanatory notes
Netbeans currently do not support automatic installation for rapid jruby debugger, a do-it-yourself, an article describes how to install the wiki
General steps are as follows:
First of all download
And then under the command-line installation
jruby-S gem install-l ruby-debug-base-0.10.3.1-java.gem
Finally, install the debug ide
jruby-S gem install - ignore-dependencies-v 0.3.4 ruby-debug-ide
Note the debug-ide version number, as far as I can test 0.3.1 is used, netbeans which is built-in 0.3.1, 0.4 and higher can not be used
Packaged items with warbler
To enter the subject of the following
First of all you have to install warbler this gem, this time in the establishment of the project has prompted
Then I made reference to an article done on the JE, but more different process http://chengj.javaeye.com/blog/184479
activerecord-jdbc-adapter must be the gem is installed, and activerecord-jdbcmysql-adapter mounted and still I did not pack the success (which I used in the project is to connect JDBC database)
All projects must be used on the jar package under the root directory lib, including projects that comes with mysql-connector-java-5.1.6-bin.jar
(Wrote this when I suddenly thought: Perhaps installed activerecord-jdbcmysql-adapter can be cited after the package of this jar?)
Enviroment.rb modified document will be applied to third-party project to write into the gem, for example, the item I used mislav-will_page, add it in there
config.gem 'mislav-will_paginate', :version => '~> 2.3.8', :lib => 'will_paginate', :source => 'http://gems.github.com'
The following command line into the project directory, the implementation of the order
jruby -S warble config
The following in the config directory warble.rb will generate a document, modify it to open, and his cancellation of such Notes
config.gems = ["activerecord-jdbc-adapter", "jruby-openssl"]
The last directory in the project are still under the command
jruby -S warble war
So there will be a war file in the project root directory, put it in webapps of tomcat on the line below, and you're done!
Special Reminder: jruby as a result there is a BUG, the final step leading to the command in the window under the implementation of such a mistake will be reported
private method `split' called for nil:NilClass Q:/app/codehaus/jruby_1_2_0/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/repaired_system.rb:109:in `find_runnable' (See full trace by running task with --trace)
The reasons for this BUG can be found here
The solution is then modified manually rake their repaired_system.rb the following documents, which will be the PATH line 109 changed to Path, or add a line in the above
ENV["PATH"]=“你的PATH环境变量”







