Comments (7)
Thanks for the heads up!
This will be a bit tricky, because airbrussh needs to support Ruby as old as Ruby 1.9. Module#prepend
was introduced in 2.0. If you have any suggestions, let me know!
from airbrussh.
@benebrice can you test the branch in this PR to see if it solves the problem? #152
from airbrussh.
Thanks @mattbrictson !
Actually, I'm not able to test it properly. I cannot even run the cap
command.
root@f627dd4a0252:/tss_rails# cap staging deploy --trace
Traceback (most recent call last):
8: from /usr/local/bundle/bin/cap:23:in `<main>'
7: from /usr/local/lib/ruby/2.7.0/rubygems.rb:297:in `activate_bin_path'
6: from /usr/local/lib/ruby/2.7.0/rubygems.rb:297:in `synchronize'
5: from /usr/local/lib/ruby/2.7.0/rubygems.rb:298:in `block in activate_bin_path'
4: from /usr/local/lib/ruby/2.7.0/rubygems/specification.rb:1371:in `activate'
3: from /usr/local/lib/ruby/2.7.0/rubygems/specification.rb:1389:in `activate_dependencies'
2: from /usr/local/lib/ruby/2.7.0/rubygems/specification.rb:1389:in `each'
1: from /usr/local/lib/ruby/2.7.0/rubygems/specification.rb:1400:in `block in activate_dependencies'
/usr/local/lib/ruby/2.7.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'airbrussh' (>= 1.0.0) among 312 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/root/.gem/ruby/2.7.0:/usr/local/lib/ruby/gems/2.7.0:/usr/local/bundle', execute `gem env` for more information
I've simply update the Gemfile with
# Gemfile
gem 'airbrussh', git: 'https://github.com/mattbrictson/airbrussh.git', branch: 'features/use-prepend-if-supported'
# Gemfile.lock
GIT
remote: https://github.com/mattbrictson/airbrussh.git
revision: 6a9b7ac68521d37d59285c10155e2e922807fc56
branch: features/use-prepend-if-supported
specs:
airbrussh (1.4.2)
sshkit (>= 1.6.1, != 1.7.0)
...
GEM
remote: https://rubygems.org/
specs:
capistrano (3.17.3)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
...
DEPENDENCIES
airbrussh!
It seems not to be properly installed. Maybe it's a version conflict somehow?
from airbrussh.
@benebrice can you try bundle exec cap
?
from airbrussh.
It worked with bundle exec cap
@mattbrictson
Could you explain me why?
from airbrussh.
@benebrice thanks for verifying!
It worked with
bundle exec cap
Could you explain me why?
When you run the bare cap
command, Ruby executes the version of Capistrano and its dependencies that are installed globally on your system for that version of Ruby. It completely ignores Gemfile.lock
.
To install a gem from a git branch, the easy way to do it is via Bundler, by adding it to a Gemfile
and then running bundle install
, which updates Gemfile.lock
. Installing a gem from a git branch does not install it globally. This is a Bundler-specific feature.
So when you run the bare cap
command, Ruby is unaware of the airbrussh
gem that Bundler obtained from git. The only way Ruby knows about it is if you run cap
via Bundler. When you run bundle exec cap
, Bundler steps in and looks at the Gemfile.lock
, and uses that to find the gems. That is why you need bundle exec
to be able to use git-sourced gems.
from airbrussh.
Wonderful explanation. Thanks a lot for this and for the fix!
from airbrussh.
Related Issues (20)
- AppVeyor CI (Windows) builds failing with net-ssh 4.0.0
- command_output HOT 9
- Colors in the capistrano.log file HOT 3
- Circular dependency warning
- Empty console output HOT 9
- Customize output to show server hostname HOT 1
- Mocha::NotInitializedError on stubbed tests when running minitest locally HOT 2
- "invalid byte sequence in UTF-8" when rsyncing files with international character
- Make rake a gem dependency HOT 3
- Make ConsoleFormatter's context configurable HOT 5
- Console error only when using Spring HOT 1
- Test on ruby 3
- Travis-CI builds are no longer working HOT 3
- Replace Travis with CircleCI HOT 1
- unsupported Ruby version 1.9 in `TargetRubyVersion` parameter (in vendor/bundle/ruby/3.3.0/gems/airbrussh-1.5.2/.rubocop.yml) HOT 3
- .github/, .rubocop.yml, bin/, etc. should not be published in the gem
- Vague and unhelpful error message if log cannot be created HOT 4
- Hostname in output HOT 1
- Tests fail under Ruby 2.4.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airbrussh.