Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't bundler install JSON gem?

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.

like image 965
Thomas Avatar asked Jan 13 '14 15:01

Thomas


People also ask

Where are bundler gems installed?

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.

Is bundler a Ruby gem?

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.


1 Answers

$ bundle update json $ bundle install 
like image 172
dnvtrn Avatar answered Oct 13 '22 00:10

dnvtrn