amazon web services - ruby: no such file to load -- ubygems (LoadError) when running cap rubber:create_staging -


i trying launch amazon ec2 instance following instructions of railscast #347 rubber , amazon ec2.

the rails project configured follows. .ruby-version file:

ruby-1.9.3 

here gemfile:

source 'http://rubygems.org'  ruby '1.9.3' gem 'rails', '~> 3.2.13' gem 'rb-readline', '~> 0.5.0' gem 'counter_culture', '~> 0.1.12' gem 'jquery-rails', '~> 3.0.2' gem 'therubyracer', '~> 0.11.4', require: 'v8' gem 'attribute_normalizer', '~> 1.1.0'  group :assets   gem 'sass-rails', '~> 3.2.5'   gem 'coffee-rails', '~> 3.2.2'   gem 'uglifier', '~> 2.1.1' end  group :development   gem 'debugger', '~> 1.6.0' end  group :development, :test   gem 'sqlite3', '~> 1.3.7' end  group :production   gem 'pg', '~> 0.15.1' end  gem 'rubber', '~> 2.5.2' gem 'open4' gem 'gelf' gem 'graylog2_exceptions', :git => 'git://github.com/wr0ngway/graylog2_exceptions.git' gem 'graylog2-resque' 

i run following rubber command:

$ rubber vulcanize complete_passenger_postgresql 

besides other files rubber-ruby.yml generated follows (comments removed):

# config/rubber/rubber-ruby.yml packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline6-dev, libxml2-dev, libyaml-dev] ruby_build_version: 20130501 ruby_version: 1.9.3 ruby_path: "/usr/local/rubies/#{ruby_version}" 

after chatting nirvdrum on irc change ruby_version: 1.9.3 ruby_version: 1.9.3-p448 , gave try. same error though.

i sticked tutorial , configured mandatory settings:

# config/rubber/rubber.yml app_name: ... domain: ... access_key: ... secret_access_key: ... account: ... key_name: ... 

following tutorial test setup running:

$ cap rubber:create_staging 

the script runs while installing , restarting instances after while stops:

 ...   ** [out :: production.foobar.com] identified _site plugin, moving _site structure ...  ** [out :: production.foobar.com] installed head     command finished in 5005ms   * 2013-07-11 01:02:20 executing `rubber:graylog:server:install'     servers: ["production.foobar.com"]  ** sftp upload #<stringio:0x007f2d89221718> -> /tmp/install_graylog_server     [production.foobar.com] /tmp/install_graylog_server     [production.foobar.com] done   * sftp upload complete   * executing "sudo -p 'sudo password: '  bash -l /tmp/install_graylog_server"     servers: ["production.foobar.com"]     [production.foobar.com] executing command     command finished in 2320ms   * 2013-07-11 01:02:23 executing `rubber:graylog:web:install'     servers: ["production.foobar.com"]  ** sftp upload #<stringio:0x007f2d817c2a58> -> /tmp/install_graylog_web     [production.foobar.com] /tmp/install_graylog_web     [production.foobar.com] done   * sftp upload complete   * executing "sudo -p 'sudo password: '  bash -l /tmp/install_graylog_web"     servers: ["production.foobar.com"]     [production.foobar.com] executing command     command finished in 945ms   * 2013-07-11 01:02:24 executing `rubber:apache:install'     servers: ["production.foobar.com"]  ** sftp upload #<stringio:0x007f2d81911800> -> /tmp/install_apache     [production.foobar.com] /tmp/install_apache     [production.foobar.com] done   * sftp upload complete   * executing "sudo -p 'sudo password: '  bash -l /tmp/install_apache"     servers: ["production.foobar.com"]     [production.foobar.com] executing command  ** [out :: production.foobar.com] site default disabled.  ** [out :: production.foobar.com] activate new configuration, need run:  ** [out :: production.foobar.com] service apache2 reload     command finished in 636ms   * 2013-07-11 01:02:25 executing `rubber:setup_volumes'   * 2013-07-11 01:02:25 executing `rubber:setup_gem_sources'     triggering before callbacks `rubber:setup_gem_sources'   * 2013-07-11 01:02:25 executing `rubber:base:install_ruby_build'     servers: ["production.foobar.com"]  ** sftp upload #<stringio:0x007f2d81a7f750> -> /tmp/install_ruby_build     [production.foobar.com] /tmp/install_ruby_build     [production.foobar.com] done   * sftp upload complete   * executing "sudo -p 'sudo password: '  bash -l /tmp/install_ruby_build"     servers: ["production.foobar.com"]     [production.foobar.com] executing command  ** [out :: production.foobar.com] installing ruby-build v20130501  ** [out :: production.foobar.com] installed ruby-build @ /usr/local     command finished in 1475ms     triggering after callbacks `rubber:base:install_ruby_build'   * 2013-07-11 01:02:27 executing `rubber:base:install_ruby'     servers: ["production.foobar.com"]  ** sftp upload #<stringio:0x007f2d81aca638> -> /tmp/install_ruby     [production.foobar.com] /tmp/install_ruby     [production.foobar.com] done   * sftp upload complete   * executing "sudo -p 'sudo password: '  bash -l /tmp/install_ruby"     servers: ["production.foobar.com"]     [production.foobar.com] executing command  ** [out :: production.foobar.com] compiling , installing ruby 1.9.3.  may take while ...     command finished in 1603ms     triggering after callbacks `rubber:base:install_ruby'   * 2013-07-11 01:02:29 executing `rubber:install_gems'     servers: ["production.foobar.com"]  ** sftp upload #<stringio:0x000000033d5920> -> /tmp/gem_helper     [production.foobar.com] /tmp/gem_helper     [production.foobar.com] done   * sftp upload complete   * executing "sudo -p 'sudo password: '  bash -l -c 'ruby /tmp/gem_helper install $capistrano:var$'"     servers: ["production.foobar.com"]     [production.foobar.com] executing command  ** ruby: no such file load -- ubygems (loaderror)     command finished in 851ms  failed: "/bin/bash -l -c 'sudo -p '\\''sudo password: '\\''  bash -l -c '\\'' \   ruby /tmp/gem_helper install open4 aws-s3 bundler rubber:2.5.2 \   gelf graylog2_exceptions graylog2-resque pg fastthread rack \   passenger:3.0.19 puma'\\'''" on production.foobar.com 

checking ruby installation in /usr/local/rubies via ssh on server shows has not been installed.

this posted in freenode irc #rubberec2 comment on problem:

however, cannot figure out how apply onto rubber configuration.

as stated in question generated configuration files rubber including rubber-ruby.yml.

# config/rubber/rubber-ruby.yml ... ruby_build_version: 20130501 ruby_version: 1.9.3 ... 

i repeated whole process same version of rubber (i fixed version 2.5.2 since there update meanwhile). time noticed ruby_version set 1.9.3-p392 can see here. seems if i accidently modified setting?!

reverting change deployment works expected.

as mentioned, in meantime rubber 2.5.3 published contains updated settings:

# config/rubber/rubber-ruby.yml ... ruby_build_version: 20130628 ruby_version: 1.9.3-p448 ... 

i tried new version curious. works well.
big kevin menard , matt conway persevered answering questions in irc channel of project.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -