views:

93

answers:

1

I'm trying to unpack all the system gems to end up with a standalone Rails directory including all the rails gems and all the system gems.

I'm starting with a bare rails setup; just did a jruby -S rails and a 'generate jdbc'. I then add a config.gem 'jdbc-mysql' to environment.rb and do the jruby -S rake gems:unpack:dependencies.

After unpacking, if I do a rake I get:

no such file to load -- jdbc-mysql

Is there something else you need to do to get the jdbc gem unpacked?

I'm using jruby 1.4.0 (and moving to 1.5 is on my todo list) and rails 2.3.8.

+1  A: 

Here is what I do:

1) Install gems to a local repository 2) Set my load environment to use a gemrc.yml file from inside the local repository

To instal gems locally do this from your project folder: gem install {gemname} -i gems (the "-i gems" tells rubygems to install the gem in the folder gems and the {gemname} is a placeholder for the name of the gem you want to install.)

To set your gemrc.yml make a file in the newly created gems folder called gemrc.yml with something like the following content: http://gist.github.com/430339

Then you need to tell your app to use your local gems at startup by adding the following to your config/boot.rb http://gist.github.com/430343

Good luck... and for extra credit you could setup the ability to install a gem if it is needed. I did this through a method called dependency which is a helper method for the require command... This function receives a name and options... This way I simply say something like: (dependency 'extlib') and it does this if it cannot require the gem.

puts gem install --config-file gems/gemrc.yml #{'-v "'+options[:version].gsub(' ','')+'"' if options[:version]} #{options[:gem] || name}

Joshaven Potter