重建DSpace更新站点语言时遭遇Maven构建失败求助
Hey there, let's work through this DSpace Mirage2 build failure together. You're hitting two linked issues: an unavailable rubygems proxy service and an outdated Ruby version that doesn't meet the rb-inotify gem's requirements. Here's how to resolve both:
Step 1: Upgrade Your Ruby Version
Ubuntu 16.04 ships with a Ruby version older than 2.2, which is required for rb-inotify-0.10.0.gem. We'll use rbenv (a lightweight Ruby version manager) to install a compatible version:
- First, install dependencies for building Ruby:
sudo apt-get install git curl libssl-dev libreadline-dev zlib1g-dev - Clone
rbenvto your user directory:git clone https://github.com/rbenv/rbenv.git ~/.rbenv - Add
rbenvto your shell's PATH (for Bash):
If you use Zsh, replaceecho 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc.bashrcwith.zshrcin the commands above. - Reload your shell to apply the changes:
source ~/.bashrc - Install the
ruby-buildplugin to simplify Ruby version installation:git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build - Install a Ruby version ≥2.2 (we'll use 2.7.8, a stable, widely compatible release):
rbenv install 2.7.8 - Set this as your global default Ruby version:
rbenv global 2.7.8 - Verify the upgrade worked:
You should see output likeruby -vruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-linux].
Alternative for apt users: If you prefer system packages, use the Brightbox Ruby PPA:
sudo apt-add-repository ppa:brightbox/ruby-ng sudo apt-get update sudo apt-get install ruby2.7 ruby2.7-dev
Step 2: Fix the Rubygems Proxy 503 Error
The rubygems-proxy.torquebox.org service is unreliable (returning 503 errors). Let's switch to the official rubygems source:
- Remove the problematic proxy source:
gem sources --remove https://rubygems-proxy.torquebox.org/ - Add the official rubygems source:
gem sources --add https://rubygems.org/ - Confirm only the official source is listed:
gem sources -l - Install or update Bundler (used by Mirage2 to manage gems):
gem install bundler
Step 3: Re-Run the DSpace Build
Clear cached artifacts to avoid leftover issues before rebuilding:
- Navigate to your DSpace source directory.
- Clean Maven's build cache:
mvn clean - Navigate to the Mirage2 theme directory and clean Ruby gem caches:
cd xmlui/src/main/webapp/themes/Mirage2 bundle clean --force bundle install - Return to the root DSpace directory and run your original build command:
cd ../../../../../ mvn -U clean package -Dmirage2.on=true
This should resolve both the Ruby version mismatch and the rubygems proxy error, letting the Mirage2 theme build successfully.
内容的提问来源于stack exchange,提问作者Wesin Alves

