Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (31 sloc) 1.51 KB
* make sure you use maven3:
freshly generated rails application
* start the webrick server:
$ mvn rails2:server
* point your browser for further info to: http://localhost:3000/maven.html
manage the gem dependencies with maven
* add all gems in the pom.xml
* remove the version from the config.gem elements in config/environment.rb to avoid conflicts, maven takes care that only one version is present and available for the application
* install all the gems in target/webgems
$ mvn gem:initialize
* if you freeze rails or unpack your dependencies you get some (or all) gems twice inside the war file. so either make sure you remove the respective copy parts from WEB-INF/gems configuration in pom.xml or remove the copy parts on the vendor directory to avoid duplications.
using the application without maven again
just run
$ mvn gem:initialize
and set
$ export GEM_HOME=target/webgems
$ export GEM_PATH=target/webgems
or the other way around, let maven use your system rubygems and set in $HOME/.m2/settings.xml
with this maven will install gems in the system rubygems (maybe you need to sudo the mvn command to do so).
Jump to Line
Something went wrong with that request. Please try again.