How to install capistrano v2.13.5 with ruby 1.8.7? - ruby

I am using ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin14]. When I try to install the capistrano gem I get the following error:
sudo gem install capistrano -v2.13.5
ERROR: Error installing capistrano:
net-ssh requires Ruby version >= 2.0.
AFAIK capistrano 2.13.5 should be compatible with ruby 1.8.7
How can I install capistrano v2.13.5 with ruby 1.8.7 (<2.0) installed?

I have sorted this problem out manually installing the capistrano dependencies. Execute the following commands if you have the same problem:
sudo gem install net-sftp -v2.0.0
sudo gem install net-scp -v1.0.0
sudo gem install net-ssh-gateway -v1.1.0
sudo gem install capistrano -v2.13.5

I had the same error message when installing Capifony in Ubuntu 14.04.
I did this:
# gem install net-ssh -v 2.9.2
And then this:
# gem install capifony
It worked.
I found the solution described here.

Even after installing the dependancies the capistrano installation process was asking for net-ssh that required ruby >= 2.
I had to download the source that I wanted from https://github.com/capistrano/capistrano/releases. Unzip, cd into the directory, and run:
gem build capistrano.gemspec
gem install --local capistrano-2.15.5.gem

Capistrano is trying to install latest version of its dependency (net-ssh) which is not compatible with ruby versions prior v2.0. The solution is to install proper version of that dependency prior to installing capistrano. Proper version means the dependency is compatible with both Ruby and capistrano. In this case that is net-ssh v 2.6.5. So following sequence works:
gem install net-ssh -v 2.6.5
gem install capistrano -v 2.13.5

Related

Rvm version error

I have installed many flavors of ruby on rvm, and using following command to change rvm ruby versions.
rvm use 1.9.3
then ruby -v gives me following result
ruby 1.9.3p551 (2014-11-13 revision 48407) [i686-linux]
but when i try to run any commands like rails s or bundle install
it gives me following error
Your Ruby version is 2.3.1, but your Gemfile specified 1.9.3
Using
rvm list
you can get list of ruby version on your system along with current & default versions.
If ruby version is not specified in Gemfile, then it is generally considering default rvm version.
But if it is specified in Gemfile, then that version of ruby should be installed in your system along with its bundler.
First make sure ruby version either installing or using it,
rvm install '1.9.3'
rvm use '1.9.3'
To install bundle of required ruby version, run this command
gem install bundler
That's can happens, when you trying to use fresh installed ruby without bundler, all newest installed ruby should also include bundler installation.
$> rvm use 1.9.3 && gem install bundler # may terminal reload needed
$> bundle install
$> bundle exec rails s

Cannot install 'github-pages'

I tried installing github-pages using gem:
sudo gem install 'github-pages'
However, I get the following error:
ERROR: Error installing github-pages:
public_suffix requires Ruby version >= 2.0.
But when I checked my ruby version using ruby --version, it shows:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
So, my understanding is that gem is somehow referencing an older version of Ruby(previous was 1.9.3). How can I fix this problem? My OS is Ubuntu 14.04 and I upgraded ruby using ruby-install.
I believe you do not need to install github-pages globally, as you are trying.
Just removing sudo in front of your command will do the trick:
gem install 'github-pages'

Cannot find gem after bundle install

I'm trying to setup my environment to do development on Travis CI's dpl project.
I installed rbenv to manage my Ruby versions and I use Ruby 2.2.3.
Then I do bundle install and the gems are installed.
Then when I try to do bundle exec rake I get this error:
Could not find CFPropertyList-2.2.8 in any of the sources
Run `bundle install` to install missing gems.
This gem is installed. Can you tell me why it is not found by Bundler?
Here is a gist of the output of my commands: https://gist.github.com/cotsog/7bb87c84a636bcd3de65
Thanks for your help!
Update:
Additional info about my environment:
$ which ruby
/Users/me/.rbenv/shims/ruby
$ which bundler
/usr/bin/bundler
$ ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
$ bundler --version
Bundler version 1.10.6

bundle install against an older version of ruby for one gem

I can install the linecache (0.46) gem against ruby v 1.8.x, but not 2.0.0. When I run bundle install, I want to specify that I want to install all gems against 2.0.0 except linecache, which I want to install against 2.0.0. How can I do that?
I ended up just installing using an older version of ruby for all the gems. I used rvm use "ree-1.8.7-2012.02" and bundle install, and that worked.

gem install rails does not work

I am working on ubuntu and rvm. In any case I tried to use sudo gem (any command) it does not recognize gem as command. In addition if I use gem seperately as:
gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: Possible alternatives: rails
I got that error. I cannot see the reason.
rvm version 1.10.3
ruby version 1.8.7
gem version 1.6.7
What is the possible reason behind this?
Re-install all rvm and ruby and the gems, solved my problem.

Resources