Re: Struggling with Jruby Rails + jdbc driver

117 views
Skip to first unread message
Message has been deleted

Joseph Li

unread,
Feb 14, 2013, 5:41:38 PM2/14/13
to rubyonra...@googlegroups.com
Now this is cheating. I finally decided to add the derbyclient.jar from the maven repo to my CLASSPATH env var in my bash profile. Which get things going for now. However, I am still baffled at what made it all work before I did the whole MacPort & RVM reinstall routine as my bash_profile hasn't been touched for quite some time already. Which only means things was working without adding anything to the CLASSPATH. 

I said my work around is cheating since the whole Gem + bundle + Gemfile should have made the rail app kinda self contained and shouldn't rely on external setting like CLASSPATH? Please correct me if I am wrong. 

Anybody have similar experience? 

Thanks,
Joseph

Joseph Li

unread,
Feb 14, 2013, 11:13:34 PM2/14/13
to rubyonra...@googlegroups.com
I give up. But found a better workaround and that might just actually be what I have done in the first place to get it working. 

Turns out the jdbc-derby gem doesn't have the derbyclient network driver but only the embedded driver. Thus the class not found. I tried many things and thinking some combinations of the gems that I added trying to get it work corrupted something. But still no dice. I ended up cleaning out the jruby again from RVM. And then go  on to manually removing the corresponding gem directory (.rvm/gems). 

One thing I encountered amid the removal and reinstall was getting the following err when trying to run bundle command:
     ......ruby_noexec_wrapper:7:in `require': no such file to load.......
Solution was to set the default ruby again from rvm with the "--default" option.


And finally the workaround is..... just stick the derbyclient driver in the ".rvm/rubies/jruby-1.7.2/lib" directory and that loaded automatically and I don't have problem with intellij anymore that way.


If anyone knows how to solve this more elegantly, please let me know. My gut feeling tells me it might involve a new gem or something, which I don't know how to make yet.

Joseph 



Jordon Bedwell

unread,
Feb 14, 2013, 11:16:35 PM2/14/13
to rubyonra...@googlegroups.com
On 02/14/2013 10:13 PM, Joseph Li wrote:
> I give up. But found a better workaround and that might just actually be what I
> have done in the first place to get it working.
>
> Turns out the jdbc-derby gem doesn't have the derbyclient network driver but
> only the embedded driver. Thus the class not found. I tried many things and
> thinking some combinations of the gems that I added trying to get it work
> corrupted something. But still no dice. I ended up cleaning out the jruby again
> from RVM. And then go on to manually removing the corresponding gem directory
> (.rvm/gems).
>
> One thing I encountered amid the removal and reinstall was getting the following
> err when trying to run bundle command:
> / ......ruby_noexec_wrapper/:/7:in/ `/require/': /no such file to load......./
> /Solution was to set the default ruby again from rvm with the "--default" option./

That sir, is caused by rubygems-bundler in @global.

Joseph Li

unread,
Feb 14, 2013, 11:41:20 PM2/14/13
to rubyonra...@googlegroups.com, envy...@gmail.com
Thank you Jordon, for the extra info. I have not yet master enough knowledge of how rvm works yet. I just know enough commands to monkey it around til it works. :> Guess a visit to the rvm / bundler page will be needed soon. 

Thanks,
Joseph

Reply all
Reply to author
Forward
0 new messages