I'm using the eb CLI to deploy my RoR API to Beanstalk, and although the deploy works, the app degrated. I can see that it fails with:
+ bundle install
/opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/rubygems.rb:284:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /var/app/ondeck/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
from /opt/rubies/ruby-2.5.7/lib/ruby/site_ruby/2.5.0/rubygems.rb:303:in `activate_bin_path'
from /opt/rubies/ruby-2.5.7/bin/bundle:23:in `<main>'.
I'm not finding in the AWS docs what I should do to fix this and prevent from happening again. Has anyone experienced the same, or knows why it's happening, and more important, how to fix it.
The bundler version of your elastic beanstalk is not 2.1.4 which is required by your project. Add an elastic beanstalk config file to upgrade the pre-installed bundler of elastic beanstalk.
#.ebextensions/bundler_update.config
commands:
update_bundler:
command: /opt/rubies/ruby-2.5.7/bin/gem install bundler -v 2.1.4
Ruby and Bundler version should match yours.
Related
I'm trying to deploy my Ruby 2.6.2 with Rails 6.0.3.4 and I'm getting GemNotFoundException with Bundler:
Running bundle check
`find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /home/site/wwwroot>/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
Running 'gem list bundler' on my local machine returns, I remove the defualt version.
bundler (2.1.4)
I've tried updating gem and it's 3.1.4.
I'm pretty sure I'm correctly pushing it to Azure, as I made a new app service and pushed my Rails app with bundler 2.1.4 and I've tried restarting the VM.
Quite new to Azure, so am pretty stuck on this.
I'm pushing code on Heroku as usual.
But this message appear :
Warning: the running version of Bundler (1.15.2) is older than the
version that created the lockfile (1.16.1). We suggest you upgrade to
the latest version of Bundler by running gem install bundler.
So I run:
heroku run gem install bundler
Running gem install bundler on ⬢ myapp... up, run.3401
(Standard-1X)
Fetching: bundler-1.16.1.gem (100%)
Successfully installed bundler-1.16.1
Parsing documentation for bundler-1.16.1
Installing ri documentation for bundler-1.16.1
Done installing documentation for bundler after 11 seconds
1 gem installed
But when I retry to push code:
heroku run bundle install
Running bundle install on ⬢ myapp... up, run.9532 (Standard-1X)
Warning: the running version of Bundler (1.15.2) is older than the
version that created the lockfile (1.16.1). We suggest you upgrade to
the latest version of Bundler by running gem install bundler.
In the gem Gemfile.lock I got:
BUNDLED WITH
1.16.1
I don't understand why this bundler release doesn't want to be install on Heroku.
Bundler 1.15.2 is the version that is pre-installed on Heroku dynos. Changing Bundler to 1.16.1 on your machine doesn't change the version installed on Heroku.
Furthermore, you cannot update Bundler on Heroku by running bundle install. And even if that was possible it would take effect on the next run of Bundler - and usually, you only bundle once on a Heroku dyno.
My advice is: It is just a warning, just ignore it and let's hope that Heroku updates Bundler more ofter in the future.
You also want to make sure you're using a standard Heroku buildpack for this.
When I attempted to upgrade my app from Cedar to Heroku-20, it kept failing with this same bundler error. But, eventually, I remembered that I had install a custom buildback and that turned out to be the source of the incorrect bundler version.
Once I switched back to the default Heroku Ruby buildpack, I was finally able to deploy without any issues.
I am working application of ruby-1.8.7 for client.
I got error when tried to deploy on staging using cap staging deploy command.
Right now, installed capistrano-3.2.1 version. Now, i want to remove it and install capistrano-2.5.19 version.
How to change version of capistrano or uninstall it and install new.
How to install capistrano for ruby-1.8.7 compatible verions.
I got every time ERROR: error installing capistrano. highline required ruby version >= 1.9.3
Thanks
/.rvm/gems/ruby-1.8.7-p374/gems/capistrano-3.2.1
$ gem uninstall capistrano
Select gem to uninstall:
1. capistrano-2.12.0
2. capistrano-3.5.0
3. All versions
> 2
Successfully uninstalled capistrano-3.5.0
I have tried Elastic Beanstalk for rails. When I run eb deploy I got this error. I need to install at least bundler 1.8.4. Any idea how to resolve this?
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (>= 1.8.4) ruby
Current Bundler version:
bundler (1.7.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`? (Executor::NonZeroExitStatus)
I am upgrading the pre-installed bundler by adding an elastic beanstalk config file to my project. I am running an older version of Elastic beanstalk box, so feel free to change the ruby paths to fit your box.
file name:
.ebextensions/upgrade_bundler.config
file content:
commands:
update_bundler:
command: /opt/rubies/ruby-2.1.5/bin/gem install bundler -v 1.8.4
I have 2 Rails 3.2.11 apps running on an Ubuntu 12.04 server with Nginx, Unicorn and Postgresql. Deployment is by git and capistrano.
After I installed the second app I found that Capistrano would fail during cap deploy because it "could not find a gem source" and I needed to install each missing gem using sudo. After this, cap deploy worked fine and so did the apps. Running bundle install from the current dir in either app reported using all the correct gems.
I am perplexed that Capistrano needs to find the gems before updating my app as my past experience (I think) was that I could run bundle install from the current dir to install any new or updated gems after cap deploy.
Today, I decided to update my Ruby version using rbenv on my dev laptop. I needed to run git pull from .rbenv/plugins/ruby-build and then rbenv rehash then I could install the new Ruby version. All good, ruby-v reports the new version 19.3-p374.
Now, when I run rails server (rails s) from my app dev dir I get rbenv: rails: command not found. The rails' command exists in these Ruby versions: 1.9.3-p327. rbenv version reports
1.9.3-p374. Rbenv which rails and bundle install both report "command not found: with rbenv error "Therails' command exists in these Ruby versions: 1.9.3-p327".
So, two issues which I believe are related:-
How to make each app on my server independently run its own gems using bundle install? I don't want to freeze the gems and am quite happy to keep both apps up to date simultaneously. Should I just keep installing the required gems using sudo?
How to fix the rbenv issue of not finding rails in the new version?
I needed to reinstall all gems again. Gem install bundler and then bundle update from each application directory.