How to set puma to start on server start/reboot with capistrano? - ruby-on-rails

I was going through puma upstart script and I tried to set it up on my server. But, after some trial and error I realized that I shouldn't be doing this manually and my deployment script i.e. capistrano should be doing this for me.
I google this but I could not much other than 2 lines on capistrano-puma:
For Jungle tasks (beta), these options exist:
set :puma_jungle_conf, '/etc/puma.conf'
set :puma_run_path, '/usr/local/bin/run-puma'
I am not sure how to use this and make capistrano do this rather than me manually doing it.
Work done so far:
I followed this blog- Deploying a Rails App on Ubuntu 14.04 with Capistrano, Nginx, and Puma and it works like a charm, except that I have to remember to run cap production puma:restart if I restart the server (or the puma process dies and I get cloudwatch alarms).
Following the official docs, I made a config file /etc/puma.conf:
/home/deploy/apps/<app_name>/current
but it is unable to find puma.rb- Naturally, as puma.rb is in
<app_name>/shared/puma.rb
and not in
<app_name>/current/config/puma.rb
The actual error I get in the logs:
/home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/dsl.rb:26:in `read': No such file or directory # rb_sysopen - config/puma.rb (Errno::ENOENT)
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/dsl.rb:26:in `_load_from'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/dsl.rb:9:in `load'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:204:in `block in load'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:201:in `each'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:201:in `load'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/launcher.rb:62:in `initialize'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cli.rb:65:in `new'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/cli.rb:65:in `initialize'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/bin/puma:8:in `new'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/gems/puma-3.4.0/bin/puma:8:in `<top (required)>'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/bin/puma:23:in `load'
from /home/deploy/apps/voggle/shared/bundle/ruby/2.2.0/bin/puma:23:in `<main>'

Related

Rails console in production: NameError: uninitialized constant

I have a rails app (rails 5). In development, everything work, when i use
rails console
And enter an instruction, for example User.all , it's working.
In production, my app work perfectly, no problems, no errors, but when i use rails console production and enter for example User.all i have an error :
NameError: uninitialized constant User
from (irb):2
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console.rb:65:in `start'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb:9:in `start'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /home/alexandre/tcheen/bin/rails:9:in `<top (required)>'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `load'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/commands/rails.rb:6:in `call'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/command_wrapper.rb:38:in `call'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application.rb:191:in `block in serve'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application.rb:161:in `fork'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application.rb:161:in `serve'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/alexandre/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
I have the same problem with all my classes, but i repeat, the application work perfectly.
I develop on Mac OS and the app run in production on debian 8.
My models are correctly named i verified.
Thanks
I had this problem and realized it happened after I made a tweak to one of my job files.
What fixed it was restarting the spring loader. Just run
spring stop
Then the next time you run the rails console it should load things as normal.
I had this same issue, rewolf's answer above solved it for me temporarily.
Just to add to his answer:
After stopping the spring gem by running the command below
spring stop
You can also fix this issue permanently by upspringing (removing the spring gem from) your bin/ executables:
bin/spring binstub --remove --all
Or
spring binstub --remove --all
You can now run the command below to get into rails console in production
rails c --environment=production
Also, to avoid this from occurring in subsequent occasions endeavour to make sure that the spring gem is only present in development and test groups in your Gemfile.
Moreso, when you're in production make sure you always provide the --without development test argument to the bundle install command
bundle install --without development test
and not the usual or common
bundle install
Please note: As an indication, whenever you run the command rails c or rails console and you see the output below:
Running via Spring preloader in process 26651
WARNING: Spring is running in production. To fix this make sure the spring gem is only present in development and test groups in your Gemfile and make sure you always use bundle install --without development test in production
It's an indication that the spring gem is running in your production environment, and it should be stopped or removed entirely from your bin executables.
That's all.
I hope this helps

Error while running unicorn for Ruby on Rails

I am trying to run a Ruby on Rails app with nginx and unicorn. After setting up the unicorn configuration file 'unicorn.rb' when I try and execute this command
bundle exec unicorn -c config/unicorn.rb -D
It throws the following error:
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/lib/unicorn/configurator.rb:537:in `working_directory': config_file=config/unicorn.rb would not be accessible in working_directory=/home/vagrant/home (ArgumentError)
from config/unicorn.rb:3:in `reload'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/lib/unicorn/configurator.rb:72:in `instance_eval'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/lib/unicorn/configurator.rb:72:in `reload'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/lib/unicorn/configurator.rb:65:in `initialize'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/lib/unicorn/http_server.rb:76:in `new'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/lib/unicorn/http_server.rb:76:in `initialize'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/bin/unicorn:126:in `new'
from /home/vagrant/.rvm/gems/ruby-2.2.1/gems/unicorn-5.0.0/bin/unicorn:126:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.2.1/bin/unicorn:23:in `load'
from /home/vagrant/.rvm/gems/ruby-2.2.1/bin/unicorn:23:in `<main>'
from /home/vagrant/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
from /home/vagrant/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
master failed to start, check stderr log for details
I am running inside an ubuntu-vagrant setup and my app is in the following directory:
/home/vagrant/home/my-app
And the configuration file(unicorn.rb) is in the following directory:
/home/vagrant/home/my-app/config
And the file(unicorn.rb) contains the following configurations:
working_directory "/home/vagrant/home/"
pid "/home/vagrant/home/temp/pids/unicorn.pid"
stderr_path "/home/vagrant/home/log/unicorn.log"
stdout_path "/home/vagrant/home/log/unicorn.log"
listen "/tmp/unicorn.expertiza.sock"
worker_processes 2
timeout 30
I dont understand where I am going wrong. Even the error statement doesnt make much sense. Can someone provide some assistance.

Pry on the production server - how can I make it work there?

I can debug an app locally with binding.pry just fine. But I need to that on the remote server (webiste) as well, because locally I don't have any error but on production I do. So put binding.pry in the source file on the server and when I made a post request to the website, I didn't return any response and even when I ran rails console on the server didn't change anything and there was no output in rails console.
It's a dev server, so it's visible in the internet but it's a developer server, although for rails it's production because RAIL_ENV is equal to production. I really need to debug it the way I can do locally using pry. How can I do it?
update:
# bundle exec pry-remote
/usr/lib/ruby/1.9.1/drb/drb.rb:736:in `rescue in block in open': druby://127.0.0.1:9876 - #<Errno::ECONNREFUSED: Connection refused - connect(2)> (DRb::DRbConnError)
from /usr/lib/ruby/1.9.1/drb/drb.rb:730:in `block in open'
from /usr/lib/ruby/1.9.1/drb/drb.rb:729:in `each'
from /usr/lib/ruby/1.9.1/drb/drb.rb:729:in `open'
from /usr/lib/ruby/1.9.1/drb/drb.rb:1191:in `initialize'
from /usr/lib/ruby/1.9.1/drb/drb.rb:1171:in `new'
from /usr/lib/ruby/1.9.1/drb/drb.rb:1171:in `open'
from /usr/lib/ruby/1.9.1/drb/drb.rb:1087:in `block in method_missing'
from /usr/lib/ruby/1.9.1/drb/drb.rb:1105:in `with_friend'
from /usr/lib/ruby/1.9.1/drb/drb.rb:1086:in `method_missing'
from /web/my_site.com/releases/201501271120/vendor/bundle/ruby/1.9.1/gems/pry-remote-0.1.8/lib/pry-remote.rb:289:in `run'
from /web/my_site.com/releases/201501271120/vendor/bundle/ruby/1.9.1/gems/pry-remote-0.1.8/bin/pry-remote:4:in `<top (required)>'
from /web/my_site.com/releases/201501271120/vendor/bundle/ruby/1.9.1/bin/pry-remote:19:in `load'
from /web/my_site.com/releases/201501271120/vendor/bundle/ruby/1.9.1/bin/pry-remote:19:in `<main>'
I assume your production app is run by some kind of daemonized application server, such as Puma or Unicorn.
In this setup, pry-remote can help.
add it to your Gemfile
use binding.remote_pry instead of binding.pry
execute bundle exec pry-remote on your server
You'll get a pry shell as soon as the breakpoint has been hit.

Cannot run any commands on my heroku app (migrate, console, etc)

I am running rails 4.0.4 with ruby 2.1.1. app location: https://github.com/ravjohal/dozmia
When I try to run commands on heroku, for instance:
ravjohal$ heroku run rake db:migrate
I get the following error:
Running `rake db:migrate` attached to terminal... up, run.2545
rake aborted!
NoMethodError: undefined method `dump_schema_after_migration=' for ActiveRecord::Base:Class
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.4/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.4/lib/active_record/railtie.rb:166:in `block (3 levels) in <class:Railtie>'...../app/config/environment.rb:5:in `<top (required)>'....
here is part of the heroku logs:
/app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.4/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `dump_schema_after_migration=' for #<Class:0x007fa6e13d76d0> (NoMethodError)
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
2014-03-27T18:30:55.730401+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.4/lib/rails/engine.rb:464:in `each'
2014-03-27T18:30:55.730191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/railties-4.0.4/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
2014-03-27T18:30:55.730191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `require'
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.4/lib/active_record/railtie.rb:165:in `block (2 levels) in <class:Railtie>'
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
2014-03-27T18:30:55.729964+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.4/lib/active_record/railtie.rb:165:in `each'
2014-03-27T18:30:55.730191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:229:in `b
lock in require'
2014-03-27T18:30:55.730191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.0.4/lib/active_record/base.rb:22:in `<top (required)>'
2014-03-27T18:30:55.730191+00:00 app[web.1]: from /app/app/models/playlist.rb:1:in `<top (required)>'
I had deployed my app using 4.1.0rc1 Rails (worked fine) and then changed the Gemfile to use 4.0.4 instead. I also changed my local development database to pg instead of sqllite3. Those are the only two changes I have made and only after those changes did the issue appear on heroku. App works great on localhost.
EDIT: I also want to add that I changed the app name locally (not sure if that would matter though).
So after trying many things, and hitting myself on the head for NOT trying something obvious...I removed the following line from environments/production.rb file:
config.active_record.dump_schema_after_migration = false
It worked fine on heroku thereafter.
The config dump_schema_after_migration didn't exist in Rails 4.0.4 .
You got the error because you deployed initially with Rails v4.1.0rc1 and switched over to v4.0.4 later. What really happened is that when you generated your app with rails 4.1.0rc, the generator put the config dump_schema_after_migration into your config/environments/production.rb and Rails 4.1.0rc1's code has this to support this config :
mattr_accessor :dump_schema_after_migration
Hence everything works fine in v4.1.0rc1. But when you moved back to v4.0.4, the config is still there in config/environments/production.rb , but the Rails code no longer knows how to read this config. To solve this, either stick with Rails 4.1.0rc1 code, or remove the config from config/environments/production.rb when running on Rails 4.0.4.
Btw, I added dump_schema_after_migration config to Rails code.
I don't have an answer, but a reason why the issue will be happening
When using a beta version of a product (Rails), you'll get a lot of new (relatively untested) functionality. This will work, but may cause issues with earlier versions of the software, as new generally means more functionality etc
If you're starting with Rails, I would recommend removing the Rails 4.1.0 gem from your system: gem uninstall rails, and then installing Rails 4.0.4 again - gem install rails
It's going to be an issue with Rails 4.1.0, but I'd need to experiment a little

Trying to deploy a Rails 4 app to WebFaction, using their documentation and getting an error locally

I am trying to deploy a Rails 4 app via github to Webfaction via Capistrano 2.15.5. Initially I installed Capistrano 3 and was getting errors, so I ended up installing Capistrano 2.15.5 and following webfaction's documentation here:
I spoke with webfaction, and they suggested I try the older Cap 2 version since that's what they're familiar with and wouldn't be updating their documentation for Capistrano 3 for awhile.
I get through all the appropriate steps in their tutorial, and I get a bunch of errors when trying to run "cap deploy:setup" or "cap deploy:check" etc.
Errors in a pastebin, here: (and shown below)
/Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require': cannot load such file -- capistrano/setup (LoadError)
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require'
from Capfile:6:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
galactica% cap deploy:check
/Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require': cannot load such file -- capistrano/setup (LoadError)
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require'
from Capfile:6:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
I've tried looking into the files, but I'm unsure really of what the issue is, and I dont know enough ruby to troubleshoot. I was hoping you of you could help me.
Any help would be IMMENSELY appreciated and gittipp'ed!! :)
Thank you in advance!
~Josh
I'm guessing you set up your project's configuration with Capistrano 3, and I think the setup for Capistrano 2 is different.
I'm not too familiar with the differences, but the error you're getting is cannot load such file -- capistrano/setup and this post about capistrano 3 references require 'capistrano/setup' as being in the Capfile that capistrano 3 generates.
So I'm guessing that file doesn't exist for capistrano 2. I don't know if capistrano 2 has generators that you could run and let them overwrite the files you have, but if it does, try that?
Or try taking out that line and see if you get a different error? Or revert the commit(s) where you started setting up capistrano 3 and start the configuration process completely over with capistrano 2?
Have you installed Capistrano 2 using "gem install" under your ruby v2.0?
rvm 2.0.0
gem install capistrano "your version"
Try this first....
I got the same error while deploying my rails 4 application using cap 2.15.5. I did research and found out that the problem was syntax as i switched from cap 3 to cap 2. So if you are using cap v2 only load command work in capfile and Require commands are used only in deploy.rb . So if you are switching from 3 to 2, do keep in mind the syntax as there are lots of changes between cap v2 and cap v3.
Note: For deploying rails 4 application 2.15.5 is the stable capistrano version you can use. Here is the guide link that worked for me : https://gist.github.com/brobertsaz/8660415

Resources