ruby on rails - Capistrano fails to deploy due to a bundler error: "An error occurred while installing json...", but I am able to install that manually -


i rails , capistrano novice , whole day today i've ruined trying make stuff work.

for have problem don't have idea how solve.

syptom:

cap staging deploy  ... lots of stuff goes here , then...  info [ba405350] running /usr/bin/env bundle install --path /home/ftpusers/my-server.com/rails/stage/shared/bundle --without development test --deployment --quiet rreimche@my-server.com debug [ba405350] command: cd /home/ftpusers/my-server.com/rails/stage/releases/20150414185146 && /usr/bin/env bundle install --path /home/ftpusers/my-server.com/rails/stage/shared/bundle --without development test --deployment --quiet debug [ba405350]    error occurred while installing json (1.8.2), , bundler cannot continue. debug [ba405350]    make sure `gem install json -v '1.8.2'` succeeds before bundling. (backtrace restricted imported tasks) cap aborted! sshkit::runner::executeerror: exception while executing rreimche@my-server.com: bundle exit status: 5 bundle stdout: error occurred while installing json (1.8.2), , bundler cannot continue. make sure `gem install json -v '1.8.2'` succeeds before bundling. bundle stderr: nothing written  sshkit::command::failed: bundle exit status: 5 bundle stdout: error occurred while installing json (1.8.2), , bundler cannot continue. make sure `gem install json -v '1.8.2'` succeeds before bundling. bundle stderr: nothing written  tasks: top => deploy:updated => bundler:install (see full trace running task --trace) deploy has failed error: exception while executing rreimche@my-server.com: bundle exit status: 5 bundle stdout: error occurred while installing json (1.8.2), , bundler cannot continue. make sure `gem install json -v '1.8.2'` succeeds before bundling. bundle stderr: nothing written 

but when login rreimche , 'gem install json -v 1.8.2' – ok. i've tried run whole failing command rreimche , runs perfect: (i've removed "--quite" end of command, supposing makes run non-verbose)

rreimche@la:/home/ftpusers/my-server.com/rails/stage/releases/20150414185146$ /usr/bin/env bundle install --path /home/ftpusers/my-server.com/rails/stage/shared/bundle --without development test --deployment using rake 10.4.2 using i18n 0.7.0 using json 1.8.2 using minitest 5.5.1 using thread_safe 0.3.5 using tzinfo 1.2.2 using activesupport 4.1.6 using builder 3.2.2 using erubis 2.7.0 using actionview 4.1.6 using rack 1.5.2 using rack-test 0.6.3 using actionpack 4.1.6 using mime-types 2.4.3 using mail 2.6.3 using actionmailer 4.1.6 using activemodel 4.1.6 using arel 5.0.1.20140414130214 using activerecord 4.1.6 using execjs 2.4.0 using autoprefixer-rails 5.1.8 using sass 3.2.19 using bootstrap-sass 3.3.4 https://github.com/twbs/bootstrap-sass.git (at next) using climate_control 0.0.3 using cocaine 0.5.7 using orm_adapter 0.5.0 using ckeditor 4.1.1 using coffee-script-source 1.9.1 using coffee-script 2.3.0 using thor 0.19.1 using railties 4.1.6 using coffee-rails 4.0.1 using hike 1.2.3 using multi_json 1.11.0 using jbuilder 2.2.12 using jquery-rails 3.1.2 using paperclip 4.2.1 using bundler 1.9.4 using tilt 1.4.1 using sprockets 2.12.3 using sprockets-rails 2.2.4 using rails 4.1.6 using rdoc 4.2.0 using sass-rails 4.0.5 using sdoc 0.4.1 using sqlite3 1.3.10 using turbolinks 2.5.3 using uglifier 2.7.1 bundle complete! 14 gemfile dependencies, 48 gems installed. gems in groups development , test not installed. bundled gems installed /home/ftpusers/my-server.com/rails/stage/shared/bundle. 

i running ubuntu 12.04 on server , here's more info:

rreimche@la:/home/ftpusers/my-server.com/rails/stage/releases/20150414185146$ ruby -v ruby 2.1.3p242 (2014-09-19 revision 47630) [i686-linux] rreimche@la:/home/ftpusers/my-server.com/rails/stage/releases/20150414185146$ bundle -v bundler version 1.9.4 

capfile:

require 'capistrano/setup' require 'capistrano/deploy' require 'capistrano/rails' dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } 

gemfile:

source 'https://rubygems.org'  gem 'rails', '4.1.6' gem 'sqlite3' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0',          group: :doc gem 'spring',        group: :development gem 'ckeditor' gem 'paperclip' gem 'bootstrap-sass', :git => 'https://github.com/twbs/bootstrap-sass.git', :branch => 'next' gem 'autoprefixer-rails' group :development   gem 'capistrano-rails', '~> 1.1.1' end 

deploy.rb

lock '3.4.0'  set :application, 'kariera-centr.ru' set :repo_url, 'https://github.com/mygit/myrepo.git'   namespace :deploy    after :restart, :clear_cache     on roles(:web), in: :groups, limit: 3, wait: 10     end   end  end 

staging.rb

server 'my-server.com', user: 'rreimche', roles: %w{web} set :deploy_to, '/home/ftpusers/my-server.com/rails/stage'  set :linked_files, fetch(:linked_files, []).push('config.yml')  set :linked_dirs, fetch(:linked_dirs, []).push('uploads')  set :ssh_options, {     keys: %w(/home/rreimche/.ssh/id_rsa),     forward_agent: false,     auth_methods: %w(publickey) } 

my local system mac os x 10.8.

i grateful help. thank you.

try running below commands:

$ sudo apt-get install libgmp3-dev

and install json

$ gem install json

reference: https://www.digitalocean.com/community/questions/how-do-i-fix-this-error-when-deploying-rails-with-capistrano-using-nginx-and-puma


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -