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
Related
I have to build a docker image on my local machine to verify whether it is a building an image or not but I am facing this issue while building the docker image on a local machine.
Installing mime magic 0.3.9 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/bundle/gems/mimemagic-0.3.9/ext/mimemagic
/usr/local/bin/ruby -I/usr/local/lib/ruby/2.7.0/rubygems -rrubygems
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/exe/rake
RUBYARCHDIR\=/usr/local/bundle/extensions/x86_64-linux/2.7.0/mimemagic-0.3.9
RUBYLIBDIR\=/usr/local/bundle/extensions/x86_64-linux/2.7.0/mimemagic-0.3.9
rake aborted!
Could not find MIME type database in the following locations:
["/usr/local/share/mime/packages/freedesktop.org.xml",
"/opt/homebrew/share/mime/packages/freedesktop.org.xml",
"/usr/share/mime/packages/freedesktop.org.xml"]
/usr/local/bundle/gems/mimemagic-0.3.9/ext/mimemagic/Rakefile:25:in `block in
<top (required)>'
Tasks: TOP => default
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /usr/local/bundle/gems/mimemagic-0.3.9 for
inspection.
Results logged to
/usr/local/bundle/extensions/x86_64-linux/2.7.0/mimemagic-0.3.9/gem_make.out
An error occurred while installing mimemagic (0.3.9), and Bundler cannot
continue.
Make sure that `gem install mimemagic -v '0.3.9' --source
'https://rubygems.org/'` succeeds before bundling.
Modify the Dockerfile to install the shared-mime-info package. E.g. on Debian-based images:
RUN apt-get update && apt-get install -y shared-mime-info
If it still won't work, then you may need to update the mimemagic gem. On your host, update mimemagic in the Rails app's Gemfile/Gemfile.lock. You may need to install shared-mime-info first: If the host is macOS, you may need to run brew install shared-mime-info; if the host is Ubuntu, you may need to run apt-get install shared-mime-info. Then run
bundle update mimemagic
If your Dockerfile downloads the Rails app from a repo, push your changes to that repo first. Or, for testing, modify the Dockerfile to copy in the Rails app from the host instead.
If you are using macOS, try the following
brew install shared-mime-info
bundle update mimemagic
And the try to bundle your gem file
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
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'm using a bitnami ruby stack appliance, and trying to set up capistrano to deploy my app from my MS windows laptop to the appliance. During the bundle install portion the deployment fails when native extensions can't be built. This happens for nokogiri and pg gems so far.
For example:
* ←[33mexecuting "cd /opt/bitnami/projects/melvin/releases/20130826221225 && bundle
install --gemfile /opt/bitnami/projects/melvin/releases/20130826221225/Gemfile --path
/opt/bitnami/projects/melvin/shared/bundle --deployment --quiet --without development
test"←[0m
produces:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/opt/bitnami/ruby/bin/ruby extconf.rb --with-pg-config=/usr/pgsql-9.2/bin/pg_config
Using config values from /usr/pgsql-9.2/bin/pg_config
sh: 1: /usr/pgsql-9.2/bin/pg_config: not found
sh: 1: /usr/pgsql-9.2/bin/pg_config: not found
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
But if I open a terminal and ssh in, and issue gem install pg -v '0.16.0' it works fine.
So what is different about what I'm doing from the ssh terminal, and what capistrano is doing (presumably from the same ssh connection)?
I've edited the PATH in my .bashrc to use the same PATH as in the bitnami console.
Anyone ever used capistrano to deploy to a bitnami ruby stack appliance (ubuntu 12.04 I think)?
UPDATE ---
I just tried cap deploy -d and aborted the deploy just before it rm's the release directory. Then I used my ssh terminal and went to the release directory and issued "sudo bundle install" which also gave the error above. So maybe it's not a difference between capistrano and manual ssh, but it must be something in the release directory, since "sudo gem install 'pg'" works, which doesn't matter which directory I'm in.
Also, because I can get the gem to install means the necessary libraries, etc. are installed on my machine somewhere - but bundler seems to have trouble accessing them.
So I'm thinking this is a bundler issue not a capistrano issue, maybe?
Confirmed, I'm bypassing capistrano and it's a problem with bundler.
So why would gem install pg -v '0.16.0' work but bundle install not?
MORE ---
So, bundle install --system works. Then I can do a bundle install --local.
But a bundle install --local --deployment fails, 'could not find pg-0.16.0 in any of the sources'. I don't understand what that means, it's on the system and shows up in a 'gem list'.
I wonder if there's a way to force capistrano to do this?
When I run
$ sudo RAILS_ENV=production rake db:migrate
I get the following error:
missing these required gems:
rubytree >= 0
You're running:
ruby 1.8.7.249 at /usr/bin/ruby1.8
rubygems 1.8.15 at /usr/lib/ruby/gems/1.8, /home/venkat/.gem/ruby/1.8
Run rake gems:install to install the missing gems.
venkat#ubuntu:/var/redmine$ sudo vi config/database.yml
When I try to install the rubytree gem I get the following error:
gem install rubytree --version ">= 0" ERROR: While generating documentation for rubytree-0.8.2 ... MESSAGE: exit ... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/rubytree-0.8.2/ri --files COPYING,API-CHANGES --title Rubytree Documentation --quiet lib History.txt Manifest.txt COPYING API-CHANGES --title rubytree-0.8.2 Documentation --quiet
There's a problem with redmine and the versions of ruby/rubygems. It doesn't detect rubytree, even though it is already installed or exists in vendor directory. See redmine issues #9815 and #9798.
You can fix this by updating redmine to the current trunk or by making the changes from revision 8214.