0
votes

I am a beginner about setup VPS for rails app, to start I am trying Nginx + Unicorn with Digital Ocean as provider (specifically the One Click install https://www.digitalocean.com/community/tutorials/how-to-1-click-install-ruby-on-rails-on-ubuntu-12-10-with-digitalocean) .

I configured all the environment (unicorn.conf, nginx.conf, capistrano, git, ... ) quite easily, but now I am stuck in an error.

The log file /home/unicorn/log/unicorn.log is continuously getting this error (therefore it is grooowing) :

E, [2014-10-19T19:09:24.117472 #24110] ERROR -- : Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound) /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/spec_set.rb:92:in block in materialize' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/spec_set.rb:85:in map!' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/spec_set.rb:85:in materialize' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:132:in specs' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:177:in specs_for' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/definition.rb:166:in requested_specs' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/environment.rb:18:in requested_specs' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/runtime.rb:13:in setup' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler.rb:121:in setup' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler/setup.rb:17:in ' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in require' /var/www/inphrase/releases/20141018133126/config/boot.rb:4:in' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' /var/www/inphrase/releases/20141018133126/config/application.rb:1:in <top (required)>' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' /var/www/inphrase/releases/20141018133126/config/environment.rb:2:in ' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' config.ru:4:in block in <main>' /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in instance_eval' /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/builder.rb:55:in initialize' config.ru:1:innew' config.ru:1:in <main>' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn.rb:48:in eval' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn.rb:48:in block in builder' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in call' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in build_app!' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:628:in init_worker_process' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:651:in worker_loop' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:525:in spawn_missing_workers' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:536:in maintain_worker_count' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:294:in join' /usr/local/rvm/gems/ruby-2.1.3/gems/unicorn-4.8.3/bin/unicorn:126:in <top (required)>' /usr/local/rvm/gems/ruby-2.1.3/bin/unicorn:23:in load' /usr/local/rvm/gems/ruby-2.1.3/bin/unicorn:23:in <main>' /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in eval' /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in ...

I've run already Bundle install in the folder's app in the server, and all gems has been installed successfully, so why I get the infamous Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound) ?

Thank you for any help

1

1 Answers

2
votes

You are using two different rubies. Bundler installs Rake in one gemset, Rails is looking in another. See the bottom of the stack trace:

load' /usr/local/rvm/gems/ ruby-2.1.3 /bin/unicorn:23:in '
/usr/local/rvm/gems/ ruby-2.0.0-p353 /bin/ruby_executable_hooks:15:in eval'
/usr/local/rvm/gems/ ruby-2.0.0-p353 /bin/ruby_executable_hooks:15:in ...

Set a default Ruby version to use:

rvm use --default 2.1.3

Open your Gemfile and specify a matching Ruby version

# Gemfile
source 'https://rubygems.org'
ruby '2.1.3'
# ...

Then run bundle install again.