I'm upgrading my Gitlab install but have an issue: the migration fails because it misses a dependency. Which look installed. That's weird.
$ sudo -u git -H bundle install --without postgres development test --deployment
Using timfel-krb5-auth 0.8.3
# ...
Using vmstat 2.3.0
Using webpack-rails 0.9.9
Using wikicloth 0.8.1
Bundle complete! 187 Gemfile dependencies, 266 gems now installed.
Gems in the groups postgres, development and test were not installed.
Bundled gems are installed into `./vendor/bundle`
Looks like timfel-krb5-auth is installed. But here is the output of migrating:
$ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
Could not find timfel-krb5-auth-0.8.3 in any of the sources
Run `bundle install` to install missing gems.
Any idea how to fix this?
I fixed it by dropping all installed dependencies:
$ rm -rf ./vendor ./.bundle/
Then re-install:
$ sudo -u git -H bundle install --without postgres development test --deployment
And finally, I got errors due to the wrong Gemfile. I found a solution here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11787/diffs
Related
I am using GitLab-CI/CD to build my Rails application. I have noticed my builds are failing due to Using a custom path while using system gems is unsupported error, which were working perfectly fine before.
Tried to check newer update releases but didn't find any issues. Does any one have any idea on recent updates or somthing on mentioned issue?
Bellow is my gitlab-ci.yml
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: ${CI_JOB_NAME}
paths:
- vendor/ruby
before_script:
- apt-get update -qq
- ruby -v
- which ruby
- gem --version
- git --version
- gem update --system 2.7.6
- gem install bundler -v 2.0.1
- bundle -v
- bundle config ${REPO_URL} ${BUNDLE_GITLAB__TOKEN}
- bundle config --global disable_shared_gems true
- bundle install --jobs $(nproc) "${FLAGS[#]}" --path vendor
rubocop:
tags:
- rubocop
script:
- bundle exec rubocop
# rspec:
# stage: test
# script:
# - bundle exec rspec
And bellow is the brief error I'm getting
$ apt-get update -qq
$ ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
$ which ruby
/usr/local/bin/ruby
$ gem --version
3.0.3
$ git --version
git version 2.20.1
$ gem update --system 2.7.6
Updating rubygems-update
Successfully installed rubygems-update-2.7.6
Installing RubyGems 2.7.6
Bundler 1.16.1 installed
RubyGems 2.7.6 installed
Regenerating binstubs
------------------------------------------------------------------------------
RubyGems installed the following executables:
/usr/local/bin/gem
/usr/local/bin/bundle
RubyGems system software updated
$ gem install bundler -v 2.0.1
Successfully installed bundler-2.0.1
1 gem installed
$ bundle -v
Bundler version 2.0.1
$ bundle config https://gitlab.com/dharshannn/test-star.git ${BUNDLE_GITLAB__TOKEN}
$ bundle config --global disable_shared_gems true
$ bundle install --jobs $(nproc) "${FLAGS[#]}" --path vendor
Using a custom path while using system gems is unsupported.
path:
Set for your local app (/usr/local/bundle/config): "vendor"
path.system:
Set via BUNDLE_PATH__SYSTEM: true
disable_shared_gems:
Set for the current user (/root/.bundle/config): true
ERROR: Job failed: exit code 1
The same happened to me today. I am pretty sure that there was no update to bundler or gem. The Docker image however has been updated (I was using ruby:2.6.3). I also added a new dependency when this started happening, so I suspect it was dependent on a gem which was already installed in the system path thus the error message.
You can get around it by specifying the following configuration variables in your .gitlab-ci.yml:
variables:
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_PATH__SYSTEM: "false"
This will configure Bundler to not use shared gems and disable system gems fully.
See https://bundler.io/v2.0/bundle_config.html
disable_shared_gems (BUNDLE_DISABLE_SHARED_GEMS): Stop Bundler from accessing gems installed to RubyGems' normal location.
and
path.system (BUNDLE_PATH__SYSTEM): Whether Bundler will install gems into the default system path (Gem.dir).
I'm deploying a rails app to Google Cloud App Engine. Since adding
config.action_mailer.default_url_options = { host: 'foobar.appspot.com'}
to production.rb, the build fails on deploy. Here are the logs:
INFO[0108] RUN bundle install --deployment --without="development test" && rbenv rehash
INFO[0108] cmd: /bin/sh
INFO[0108] args: [-c bundle install --deployment --without="development test" && rbenv rehash]
/bin/sh: 1: bundle: not found
error building image: error building stage: waiting for process to exit: exit status 127
There are 2 options, which you should to try:
Change bundle to bundler.
install bundler manually with something like gem install bundler -v 1.17.1
I'm struggling to get going with rails, so apologies for being a n00b. I've installed and uninstalled Ruby and all of my gems several times now and am still having problems getting rails to launch. If I do...
$ rails new sample_app
...
$ cd sample_app
...
$ bundle install
...
$ rails s
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
$ gem install rake -v 10.5.0
Successfully installed rake-10.5.0
Parsing documentation for rake-10.5.0
Installing ri documentation for rake-10.5.0
Done installing documentation for rake after 0 seconds
1 gem installed
$ rails s
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
$ rails --version
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
When I do gem list I see rake 10.5 is installed. I'm running Ruby 2.3.0 that I installed using rbenv. Running bundle install or bundle update as it indicates doesn't help. Suggestions?
I encountered that error before, sometimes it needs to put
gem 'rake' to Gemfile, and run bundle install.
Try running
sudo apt-get update
sudo apt-get install rake
I am trying to install gitLab server in my Virtual Machines, When I Execute the command: sudo -u git -H bundle install --deployment --without development test mysql aws, I got this:
Some gems seem to be missing from your vendor/cache directory.
Could not find rake-10.3.2 in any of the sources
And my gem source is:
root#ubuntu:/home/git/gitlab# gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
https://rubygems.org/
When I run gem install rake-10.3.2, I got this:
ERROR: Could not find a valid gem 'rake-10.3.2' (>= 0) in any repository
How do I resolve this problem?
Try installing rake with this command
gem install rake -v 10.3.2
Do one thing. Delete your Gemfile.lock
and run the command:
bundle install
I'm trying to install the newest version of gitlab. When I try
sudo -u git -H bundle install --deployment --without development test mysql was --verbose
It always shows an error Network error while fetching, and re-fetches all the packages again when I retry, then the error appears again because my network is not stable. How to tell the bundler not to fetch packages already fetched?
Try adding the bundle install --retry option:
sudo -u git -H bundle install --retry 4 --deployment --without development test mysql was --verbose
This will retry failed network requests 4 times. From the Bundler Documentation:
--retry: Retry network and git requests that have failed.
Note: if it complains about Unknown switches '--retry', then your bundler version is very old. update it with:
gem update bundler
and then try again.