I had a Ruby on Rails app up and running with Dokku. When I tried to deploy it again today, I received the following error:
--> Installing dependencies using bundler 2.0.1
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Activating bundler (2.0.2) failed:
Could not find 'bundler' (2.0.2) required by your /tmp/build/Gemfile.lock.
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.2`
Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
To install the version of bundler this project requires, run `gem install bundler -v '2.0.2'`
Bundler Output: Activating bundler (2.0.2) failed:
Could not find 'bundler' (2.0.2) required by your /tmp/build/Gemfile.lock.
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.2`
Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
To install the version of bundler this project requires, run `gem install bundler -v '2.0.2'`
!
! Failed to install gems via Bundler.
Not sure how to resolve this and was unable to find any references to this type of problem with Dokku.
The update didn't change the Bundler version for me.
I solved this by changing the buildpack. Syntax for dokku is:
$ dokku config:set --no-restart YOUR_APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v227
#227 gives Bundler 2.2.16 which works with my installed version 2.2.20.
Here is a list of available buildpacks.
I solved this by updating Dokku using their official documentation. After the update, I had no trouble deploying.
Related
I have an app that I can build the container, but not able to start
The error message when I try to start it:
Activating bundler (~> 2.3) failed:
Could not find 'bundler' (2.3.18) required by `$BUNDLER_VERSION`.
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.3.18`
Checked in 'GEM_PATH=/root/.gem/ruby/2.5.0:/usr/local/lib/ruby/gems/2.5.0:/usr/local/bundle' , execute `gem env` for more information
To install the version of bundler this project requires, run `gem install bundler -v '~> 2.3'`
The Dockerfile already has:
FROM --platform=linux/amd64 ruby:2.5.9-slim-stretch
(...)
ENV BUNDLER_VERSION 2.3.18
RUN gem update --system 3.2.3
RUN gem install bundler -v "$BUNDLER_VERSION"
I had to manually run the bundler install, even it should run on build
docker run bundle install
I'm trying to install my app to heroku. But I'm having an issue with a gem. Its a private gem and we don't have a private gem server setup, so I've cloned the gem locally as a submodule inside the app.
When I push to heroku I get this error:
! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
Detected buildpacks: Ruby,Node.js
See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.1
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
The gemspecs for path gems changed
Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
The gemspecs for path gems changed
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app.
! Push failed
When I removed the locally install gem it all worked fine.
So strong hunch is that bundler 1.15.2 handles local gems differently and it's causing a conflict.
In my Gemfile, not inside any group, I have gem 'portkey', path: './gems/portkey/'
At the top of my Gemfile.lock I have
PATH
remote: gems/portkey
specs:
portkey (0.1.10)
bitly
omniauth-google-oauth2 (~> 0.5.3)
rails (~> 5.2.1)
rebrandly
shortener (~> 0.8.0)
will_paginate
Heroku doesn't support bundler 1.16.2 yet afaik
I'm using rails 5/ruby-2.5 and I don't seem be able to downgrade bundler to 1.15.2 and generate an older version of the lockfile
I can't easily make this gem accessible any other way.
I'm stumped how I can make the install of this gem work, and suggestions would be greatly appreciated.
Had a similar issue, solved by upgrading to Bundler 2.0.1 (which is now supported by Heroku).
For 1.x version they still use 1.15.2 though.
I am new to Rails , I ran bundler as root by mistake & now it is not working correctly. I tried to use gem uninstall bundler then gem install bundler but still it is not fixed.
How to make bundler work again for non root users (after mistakenly using it with root)?
Note:
I have installed and use rbenv, but after installing some gems on the system directly
The error that happens is that bundle doctor shows correct missing gems but sudo bundle doctor doesn't as shown below
~/my_ruby_projects/myblog3$ bundle doctor
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
The following gems are missing
* execjs (2.7.0)
* coffee-script (2.4.1)
* coffee-rails (4.2.2)
* font-awesome-rails (4.7.0.2)
* temple (0.8.0)
using sudo
~/my_ruby_projects/myblog3$ sudo bundle doctor
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run gem install bundler --pre
The Gemfile's dependencies are satisfied
No issues found with the installed bundle
Thanks for your help
update:
I knew that bundle with sudo is correct since it gave the real gems that rails tells me they are missing , if I use bundle install without sudo it gives error as below (even if change it to chmod 777)
~/my_ruby_projects/myblog3$ bundle install
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
There was an error while trying to write to `/home/usrname/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions`. It is likely that you
need to grant write permissions for that path.
for sudo bundle install it says all is installed but then rails throws error that I need to install gems (which bundle doctor gave without sudo)
/my_ruby_projects/myblog3$ sudo bundle install
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Using rake 12.0.0
Using concurrent-ruby 1.0.5
# many other gems
Using redis-rails 5.0.2
Using rails_admin 1.2.0
Bundle complete! 30 Gemfile dependencies, 98 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Update 2:
rails s was giving error that gem files are missing
but **sudo** rails s worked without errors
You should try changing the owner and setting the correct permissions for your ~/.bundle.
Try:
sudo chown -R <youruser> ~/.bundle
Followed by:
sudo chmod -R 655 ~/.bundle
I am new with ruby on rails. I have successfully installed ruby on rails 4.2 on Ubuntu 14.04 and created a new app, but when I started the server to see if it is working by writing:
rails server
I get this error message:
Could not find gem 'sass-rails (~> 5.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
And when I start to install bundle I get other packages that need to be installed before bundle.
Error message for bundle install
Gem::RemoteFetcher::FetchError: Errno::EHOSTUNREACH: No route to host - connect(2) for "rubygems.global.ssl.fastly.net" port 443 (https://rubygems.org/gems/minitest-5.5.1.gem)
An error occurred while installing minitest (5.5.1), and Bundler cannot
continue.
Make sure that `gem install minitest -v '5.5.1'` succeeds before bundling.
then after I installed minitest and run bundle install
I got this error message
Gem::RemoteFetcher::FetchError: Errno::EHOSTUNREACH: No route to host - connect(2) for "rubygems.global.ssl.fastly.net" port 443 (https://rubygems.org/gems/debug_inspector-0.0.2.gem)
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.
It keeps showing me packages that I need to install before bundle.
I'm not on Ubuntu, but I find with Rails 4+ this step-wise gem install is the rule rather than the exception. It doesn't seem to handle dependency gem installs very well with bundle. For each of the "missing" dependency gems, run the single gem install, and then the bundle again to see what's next It may reveal another dependency with each step, just install that. (The caveat is if you're seeing the same gems show up as not being installed on every bundle exec, then that's another problem altogether. Once you single-install the gem it should be locked in and available)
$gem install bundle
$gem install name-of-flagged-gem
$gem install bundle
$gem install next-missing-gem
Hope this helps.
Your solution should be right here: SSL Error
I had the same exact problem. Each time I did a "bundle install" it told me to make sure "gem install .... succeeds before bundling" And when I did what it said, it just told me about another gem.
I am trying to install a ruby project, which has a dependency like in Gemfile
nokogiri (1.6.1)
bundlr fails
An error occurred while installing nokogiri (1.6.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.
I followed the instructions to install nokogiri manually and succeeded (OSX 10.9.2)
which nokogiri
/usr/bin/nokogiri
nokogiri
Nokogiri: an HTML, XML, SAX, and Reader parser
Usage: nokogiri <uri|path> [options] ...
but, how can I install nokogiri to the expected path by the app (vendor/bundle , like the other dependencies, not in system folder). I tried an option --path vendor/bundle with gem install, but it is not recognized
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
I am running gem install as another user, that is why no permission to write to system folder. still, it is not trying to install at vendor/bundle.
It is also ok if I can find a way to use bundle (instead of gem) to install nokogiri. But, I am not sure how to specify the dependencies like the installation command below.
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2
--with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib
--with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Try to create config for bundler in ~/.bundle/config:
BUNDLE_PATH: ./vendor/bundle
BUNDLE_BUILD__NOKOGIRI: --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2
--with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib
--with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
and after bundle install --path vendor/bundle.
On Mac I have tried the following and it worked.
bundle config build.nokogiri --use-system-libraries
bundle install --path vendor/bundle