By pggraphite
Hello,
I’m attempting to deploy my rails app from a bitbucket repo using the following tutorial: https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma
I have done everything in the tutorial, but when I get to deployment using “cap production deploy:initial”, I receive an error message. The deploy:install first pulls down the repo and sets up the capistrano stuff, but when it gets to bundling my gems, I get the following error:
DEBUG [1a250078] [31mAn error occurred while installing json (1.8.2), and Bundler cannot continue.
DEBUG [1a250078]
DEBUG [1a250078] Make sure that gem install json -v '1.8.2' succeeds before bundling.[0m
DEBUG [1a250078]
I have tried everything from “making sure that gem install json -v 1.8.2” works on the server (which it does) to wiping the server and starting again.
Also, if I want to retry the deploy using capistrano I get an error because the symbolic link for nginx is not setup, which means I then need to remove the “apps” directory in /home/deploy/ on my server. Once I have done that, attempting to deploy will once again render the json -v ‘1.8.2’ error.
I really do not know what to do. My gemfile works perfectly locally.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If you run rbenv global 2.4.0, gem JSON have issues with 2.4.0. Try to downgrade to 2.3.1:
rbenv global 2.3.1
ruby -v```
**& remember to update your** ```capfile``` to: ```set :rbenv_ruby, '2.3.1'```
Trying installing libgmp3-dev in order to resolve this issue on Ubuntu 14.04 LTS
On your droplet:
$ sudo apt-get install libgmp3-dev
Once that’s installed, install the latest version of the json gem:
$ gem install json
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.