While i am trying install rack gem using ansible, i get an error as :
ERROR: Error installing rack:
rack requires Ruby version >= 2.2.2
I have installed rack along with the gems as :
- name: Install Ruby Gems become: yes gem: name={{ item }} state=latest user_install=no with_items:
- rubygems-update
- r509
- r509-ca-http
- rack
My current version if is see using ruby --version : 2.0.0p648
WHat is the problem , and if I have to update my ruby version and how can I update using ansible for Amazon Linux OS
The error you get while installing says: "rack requires Ruby version >= 2.2.2" Then later you report "ruby --version : 2.0.0p648". The message is telling you that your version of Ruby is too old, you need to upgrade it to at least 2.2.2 to use rack.
You are currently using the system default ruby version, therefore you are bound to the version the operating systems package management is offering you. You can use different package repositories to fetch a newer version of ruby. A better approach might be to use some ruby version management system, that allows you to have several version of ruby on your system and switch those e.g. on project level. To mention two popular of them: RBENV or RVM
Related
When I run:
$ bundle install
I get this response:
Fetching gem metadata from https://rubygems.org/.........
minitest-5.14.1 requires ruby version ~> 2.2, which is incompatible with the
current version, ruby 3.0.0p0
I only have ruby 3.0.0p0 installed.
minitest gem page says:
Required ruby version >= 2.2, < 4.0
I assume this means anything up to Ruby 3.0.0p0 is compatible. However, that isn't what the error message says.
Not sure if this is a solution. I'd call it more of a work around.
Install ruby version 2.7.2
Update .ruby-version file in Jekyll to 2.7.2
That's it :)
Ideal solution would include identifying why Jekyll was dependent on minitest-5.14.1 (when only 5.14.4 was installed based on gem list).
I am following the tutorial on deploying a Rails application on to Heroku, I am trying to install the dependencies, when I type in the command, jruby -S bundle install --binstubs
I get the following
Your Ruby version is 2.3.3, but your Gemfile specified 2.3.1
I've looked through different forums as they where a few people discussing but have tried and have come to no conclusion, specially for Windows as I only have access to that temporarily this week.
Information on the system:
Windows 10
ruby -v ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]
rails -v Rails 5.1.4
gem -v 2.7.1
Do I have to downgrade my Ruby version, or install a concurrent older version? I don't see a 2.3.1 on the Ruby website? Should I use a package manager on Windows(If this is the answer looks like I will be spending a lot longer learning about this), would that solve the problem?
The guide you are following is for JRuby, but it does not look like you are running JRuby on your machine (you are running a different type of Ruby). Make sure you install and are using JRuby per the instructions
I"m using Ubuntu and RVM. I've run the command
rvm use 2.1.2
Running
ruby -v
gives me the 2.1.2 version.
When I start rails I get the following error
Your Ruby version is 2.3.1, but your Gemfile specified 2.1.2
But RVM doesn't even have 2.3.1 installed.
You may have apt installed ruby. For example, when I run apt show ruby, on my system, I get this
$ apt show ruby
Package: ruby
Version: 1:2.3.0+1
Priority: optional
Section: interpreters
Source: ruby-defaults
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
...
Clearly, the ruby version is 2.3.x here. So I suggest you apt remove ruby first. If that doesn't solve the problem, it is possible that there is a problem with your $PATH environment variable.
ruby -v gives you the ruby version installed on your system, not the current ruby version used by RVM.
To see which ruby version is currently used by RVM, use rvm list. Make sure it's using ruby version 2.1.2 by running rvm use ruby-2.1.2
From your question, it seems Rails is using your system ruby instead of RVM ruby.
I am using puppet to install ruby 1.9.3 as the system ruby on an Ubuntu Trusty Vagrant container. I also install Bundler. I am told that "gem" is installed as part of the installation of ruby.
How do I know which versions of gem go with this version of ruby?
How do I know which versions of bundler go with this version of ruby?
Here is a fragment of puppet code:
$other_reqs = [
...
'ruby1.9.3',
'ruby-bundler',
'rubygems-integration',
...
]
package{ $other_reqs: ensure => 'installed'} -> Package['percona-toolkit']
The package declaration will default to using apt-get to download packages. Clearly the line with 'ruby1.9.3' will get the 1.9.3 version of ruby. It also installed gem 1.8.23. Is this a compatible version of gem? How do I know?
The line with 'ruby-bundler' installed Bundler version 1.3.5. Is this a compatible version of Bundler? Or should I indicate a specific version in my requirements array? Where ought I look to find this information?
It might be helpful if you indicate the problem, or what you're trying to do. Nevertheless:
gem is a command that is built-in in ruby from 1.9+, so whatever comes installed with Ruby should be fine.
bunlder is a RubyGem, normally installed by doing gem install bundler. You can specify the version by doing gem install -v <version>. Either it gets installed correctly or you get an error. Can you install bundler doing that?
And lastly, unless you need it for a specific reason, 1.9 is very old :)
On a Joyent accelerator I'm working with, Ruby and Rubygems were installed when the server was initially setup using Cool Stack.
The existing version of Rubygems is version 0.9.2. When it comes to upgrading RubyGems using the 'sudo gem install rubygems-update' and 'sudo update_rubygems' commands, it results in the following error:
./lib/rubygems.rb:124: uninitialized constant Gem::RbConfig (NameError)
from setup.rb:24:in `require'
from setup.rb:24
Without having much success in rectifying this issue, I wanted to install a fresh version of RubyGems alongside this one. As this is a production server, I want to minimize the amount of environment changes I make on the server.
If I install a fresh version of RubyGems from source, how do I set this new installed version of RubyGems as the default version of RubyGems to use?
I think RVM is what you're looking for: http://rvm.io/rvm/install/
And then setting one Ruby install as the default: http://rvm.io/rubies/default/