I get the following error when attempting to run cap production deploy
.
DEBUG [dc362284] Bundler::GemNotFound: Could not find json-1.8.1.gem for installation DEBUG [dc362284] An error occurred while installing json (1.8.1), and Bundler cannot continue. DEBUG [dc362284] Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
It may be important to note that this deployment was working, than I upgraded to Ruby 2.1.0 to remove an encoding error. I upgraded locally which worked fine. I ran rvm install 2.1.0
and rvm use 2.1.0
then changed my .ruby-version
file to reflect this Ruby upgrade.
The bundle install
command works locally, but produces the same above error when I ssh onto the destination server and run this command.
If I run gem list
I can see this in the list of gems.
... jquery-rails (3.0.4) json (1.8.1) less (2.3.2) ...
If I try the recommended solution gem install json -v '1.8.1'
Locally and on the destination server I get the following output:
Building native extensions. This could take a while... Successfully installed json-1.8.1 Parsing documentation for json-1.8.1 Done installing documentation for json after 0 seconds 1 gem installed
So it appears the gem is installed, right? Why is this happening? How can I solve this? Any help would be greatly appreciated.
In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them. As a result, bundle install --deployment installs gems to the vendor/bundle directory in the application. This may be overridden using the --path option.
Bundler: The best way to manage a Ruby application's gems. Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed.
$ bundle update json $ bundle install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With