Undefined method `instance' for Capistrano::Configuration:Class
First of all, there were a couple of changes made in capistrano 3.
See the release notes : http://www.capistranorb.com/2013/06/01/release-announcement.html
Also go through the readme.
https://github.com/capistrano/capistrano/blob/master/README.md
Capistrano 3 has moved out bundler integration into a gem.To solve your problem :
1. Uncomment require 'capistrano/bundler' from capify.
2. add gem 'capistrano-bundler' to your gemfile.
3. Go through the comments in capify file and uncomment whichever module you require.
Oh and if you don't wanna use bundler as of yet, remove the first line : require "bundler/capistrano". easy as that.
Also you can't use variables like the previous way now.Instead of directly reading it, use fetch(:application) to read a variable.
I would be easier for you to move back to capistrano v2.
Rails Error: NoMethodError: undefined method `instance' for Capistrano::Configuration:Class Did you mean? instance_of?
- Uncomment
require 'capistrano/bundler'
fromCapfile
- Add gem
'capistrano-bundler'
to yourGemfile
. - Run
bundle install
and then try again deploy.
Undefined method `instance' for Capistrano::Configuration:Class on `cap deploy:setup`
I am fairly new to capistrano but have used it successfully in the past without this amount of problems. Does anyone know a fix for this?
I guess you need to stay on Version 2, modify the line in your Gemfile
, to read something like:
gem "capistrano", "~> 2.15.0"
Capistrano rails | undefined method `already_invoked' for Rake::Task when setting rails_env while migrations during gitlab deploy
My guess is that because you are installing the Capistrano Gems in the CI environment manually, there is a version mismatch. If you run bundle install
and bundle exec
on the CI server, or pin the installed versions, it will probably start working.
One solution I've used for this is to add all of the required deployment gems to a :deployment
group in my Gemfile. Then you need to add the following to your deploy.rb
:
set :bundle_without, %w{development test deployment}.join(' ')
Then change your script to be:
bundle install --except development test default production ...
bundle exec cap $CI_BUILD_REF_NAME deploy
Undefined method [] for nil when trying to run cap deploy:restart
A wild guess: I had a similar problem and I could solve it by upgrading capistrano-passenger
to >= 0.2.1
Looks like the version change of passenger from 6.0.7 to 6.0.8 has introduces a problem. I see you are also on 6.0.8, so it might affect you, too!
Link to the capistrano-passenger issue
NoMethodError: undefined method `map' for :roles:Symbol in Capistrano 3
This is happening because Capistrano tasks are now Rake tasks and Rake expects a construct like this:
task :name, [:arg, :arg] => :dependency do
...
end
Judging from your stack trace you have custom Capistrano tasks defined in /Users/carro/Sites/193/capistrano/lib/capistrano/tasks/
. You need to convert those to the Capistrano 3 on ... roles
syntax to make them work.
For example, you would change a Capistrano 2 task like this:
task :dump, :roles => :db do
...
end
to this for Capistrano 3:
task :dump do
on primary roles :db do
...
end
end
See here for more details.
Related Topics
Post Redirect Get Pattern in Rails
Upsert Multiple Records with Mongodb
How to Create a Custom Method for the Rails Console
Accessing the Child Instance in a Rabl Template
How to Make a Ruby Script Using Trollop for Command Line Parsing
Ruby/Rails Array of Strings to Postgresql Insert
Is Ruby Any Good for Gui Development
Trouble Installing Ruby 1.9.2 with Rvm MAC Os X
How to Define a Simple Global Variable in an Rspec Test That Can Be Accesed by Helper Functions
How to Install Libksba on MAC Osx
Error When Installing Libv8 3.11.8.3
Array#Rotate Equivalent in Ruby 1.8.7
Can't All or Most Cases of 'Each' Be Replaced with 'Map'