need help: bundler / gems > method missing

5 views
Skip to first unread message

tom

unread,
Jun 29, 2016, 12:18:36 PM6/29/16
to Ruby on Rails: Talk
hi,

im trying to deploy an app via cap3/bundler/rvm on debian , user-rvm

i go the app-code on the server, but when i test it via:
 bundle exec rails s -b 0.0.0.0 -p 3000 -e staging

it throws an error that a method is missing. 

gem list shows all gems , i have tried to install gems via bundle install ( --system & path vendor/plugins)

where is my problem??? what should i do?


thx for any pointers

ps the app runs just fine locally


radhames brito

unread,
Jun 29, 2016, 12:38:31 PM6/29/16
to Ruby on Rails: Talk
You have to check the scope of the gems you are using, since you are using bundle exec, bundler will only load the gems you have not specified in the given environment, in this case staging, so if you have something like this

group :test, :development, :staging do

gems in that group only load in the specific environment, so if you have a something like this

group :test, :development do
  gem 'foo'

Foo will not load in staging environment. 

Another thing is that is you are using capistrano/bundler, gems are not in stalled in the system or $GEMHOME, they are in shared/bundle/ruby/RUBY_VERSION/gems, so they might not show up when you do gems list outside the current folder. Pay attention to your capistrano recipe.rb so check how you are loading the application.

Please provide more details about your Gemfile, and your capistrano recipe.rb to be able to help you more.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMdSb2peZ2fZ07qV868msmSKOVZ551v-kGcoWt8ciwtKbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

tom

unread,
Jun 29, 2016, 2:29:02 PM6/29/16
to Ruby on Rails: Talk
Hi Radhames,

running webrick (3000) on the server is fine, app loads.

doing bundle show rails gives:
/home/railsuser/.rvm/gems/ruby-2.3.1@my_gemset/gems/rails-4.1.6

but when i run nginx with staging or production gives me the same error (method not found aka ( i guess) gems not loaded)

so question is how do i tell rvm // bundler / passenger where my gems are? 

ps: gem file
i took all the stages out and listed the gems only


recipe:

require 'capistrano/rvm'
require "whenever/capistrano"
#require "bundler/capistrano"

#require "rvm/capistrano" # Load RVM's capistrano plugin. OLD


set :stages, ["staging", "production"]
set :default_stage, "staging"


set :rbenv_ruby, '2.2.4'
set :rvm_type, :user #system #; user ;  system = rvm system wide install


set :application, 'appname'
set :bundle_binstubs, nil
set :scm, :git
set :repo_url, "railsuser@SOMEIP:/gitrepos/my_repo.git"


set :ssh_options, {:forward_agent => true}
set :keep_releases, 5
set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

SSHKit.config.command_map[:rake]  = "bundle exec rake" #8
SSHKit.config.command_map[:rails] = "bundle exec rails"

set :pty, true

set :format, :pretty
set :tmp_dir, "/home/username/tmp"   

#set the user on our server that we want Capistrano to run commands with:
set :user, "username"



thx 






Colin Law

unread,
Jun 29, 2016, 4:28:36 PM6/29/16
to Ruby on Rails: Talk
On 29 June 2016 at 19:28, tom <toma...@gmail.com> wrote:
> Hi Radhames,
>
> running webrick (3000) on the server is fine, app loads.
>
> doing bundle show rails gives:
> /home/railsuser/.rvm/gems/ruby-2.3.1@my_gemset/gems/rails-4.1.6
>
> but when i run nginx with staging or production gives me the same error
> (method not found aka ( i guess) gems not loaded)

Are you sure it is that? What is the exact error message?

Colin

radhames brito

unread,
Jun 29, 2016, 4:56:33 PM6/29/16
to Ruby on Rails: Talk
uncomment capistrano/bundler, with passenger if you have it correctly configure, passenger will use 'bundle exec rails s passenger' from within the 'current' folder of the app, just remember that the bundler gem has to be accesible from anywhere in the system when you do gem list.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages