-2

I am stuck with a problem for a very long time and i have hit a dead end with desperate need of a solution. I have a web application which has to to be ported to WAR on Windows 7.The database I am using is Sqlit3.
Ruby Version :- ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]
JRuby Version :- jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 24.45 -b08 on 1.7.0_45-b18 +jit [Windows 7-amd64]
Rails Version :- Rails 4.2.6

Before porting it to WAR ,these are the steps i do.These steps has worked in many Systems,But for few systems I am not able to get through,
1)I installed JRuby.
2)I installed rails on Jruby by running gem install rails -N
3)I removed the gem sqlite3 and add gem 'activerecord-jdbcsqlite3-adapter' (to make it java compatible)

After bundle install,

When I run rails c command ,

I get the below Exception,

*activerecord-jdbc-adapter is for use with JRuby only C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-jdbc-adapter-1 .3.20/lib/arjdbc/sqlite3/adapter.rb:1:in <top (required)>': undefined methodl oad_java_part' for ArJdbc:Module (NoMethodError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-j dbc-adapter-1.3.20/lib/arjdbc/sqlite3.rb:2:in require' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-j dbc-adapter-1.3.20/lib/arjdbc/sqlite3.rb:2:in' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-j dbcsqlite3-adapter-1.3.20/lib/activerecord-jdbcsqlite3-adapter.rb:3:in require' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-j dbcsqlite3-adapter-1.3.20/lib/activerecord-jdbcsqlite3-adapter.rb:3:in' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:76:in require' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:76:inblock (2 levels) in require' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:72:in each' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:72:inblock in require' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:61:in each' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:61:inrequire' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler.rb:133:in require' from D:/srikanth-work/simple/config/application.rb:7:in

' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.6 /lib/rails/commands/commands_tasks.rb:78:in require' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.6 /lib/rails/commands/commands_tasks.rb:78:inblock in server' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.6 /lib/rails/commands/commands_tasks.rb:75:in tap' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.6 /lib/rails/commands/commands_tasks.rb:75:inserver' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.6 /lib/rails/commands/commands_tasks.rb:39:in run_command!' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.2.6 /lib/rails/commands.rb:17:in' from bin/rails:4:in require' from bin/rails:4:in'*

Any suggestion would be really helpful

user2914486
  • 163
  • 1
  • 15

2 Answers2

1

activerecord-jdbc-adapter is for use with JRuby means you're loading it under non-JRuby (MRI)

Bundler has platform specifiers if you need to run under JRuby and MRI using a single Gemfile :

gem 'activerecord-jdbc-adapte', platform: :jruby

kares
  • 7,076
  • 1
  • 28
  • 38
  • I build the deployed on tomcat.. When opened the application on browser I got the below error, exit from org/jruby/RubyKernel.java:852:in exit' from org/jruby/RubyKernel.java:815 – user2914486 Mar 16 '16 at 18:29
-2

I build the deployed on tomcat..
When opened the application on browser I got the below error,
exit from org/jruby/RubyKernel.java:852:in exit' from org/jruby/RubyKernel.java:815:inexit' from D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/gems/gems/bundler-1.7.7/lib/bundler/setup.rb:14:in (root)' from org/jruby/RubyKernel.java:1040:inrequire' from /D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/lib/jruby-stdlib-1.7.24.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in (root)' from /D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/lib/jruby-stdlib-1.7.24.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:128:inrequire' from org/jruby/RubyKernel.java:1040:in require' from D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/config/boot.rb:3:in(root)' from /D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/lib/jruby-stdlib-1.7.24.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in (root)' from /D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/lib/jruby-stdlib-1.7.24.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54:inrequire' from file:/D:/sotwares/Tomcats/apache-tomcat-8.0.28/webapps/helloworld/WEB-INF/lib/jruby-rack-1.1.20.jar!/jruby/rack/rails/environment3.rb:23:in `load_environment' You're seeing this error because you use JRuby::Rack::ErrorApp::ShowStatus

user2914486
  • 163
  • 1
  • 15
  • the reason i was gettin errors was because i was trying to install rails on jruby.... and run it directly as rails commands. I was successfuly able to by using only jruby -S commands instead of installing rails on jruby – user2914486 Apr 17 '16 at 14:15