Will the gem -https://github.com/cequel/cequel (that itself uses https://github.com/datastax/ruby-driver) work with DSE 6.0? - datastax-enterprise

Will the gem https://github.com/cequel/cequel (that itself uses https://github.com/datastax/ruby-driver)  work with DSE 6.0?

As I see in the gemspec file, it requires cassandra-driver ~> 3.0. The existing 3.x cassandra-driver should be compatible with DSE 6.0, so cequel should continue to work with it.

Related

Ransack with Ruby 2.5

I'm trying to use Ransack on RoR app.
https://github.com/activerecord-hackery/ransack
Unfortunately latest ransack only support ruby 2.6+. Mine is 2.5.8.
So what should I do? Any available version is there on Ransack?
You can use an older version, namely 2.4.1.
If you look on rubygems.org, you can quickly see the minimum required ruby version for each version of the gem:
2.4.2 requires ruby >= 2.6
2.4.1 requires ruby >= 2.3
However, you shouldn't even ordinarily need to check this manually!! If you run bundler update ransack on a project, it will automatically fetch the latest compatible version of the gem, given all your other dependencies.

How to change from Ruby On Rails version 6.0.3.2 to Version 5?

I have installed Ruby On Rails version 6.0.3.2 but now I want to change it to Version 5. How can I do it?
Do I uninstall version 6 and install 5? What command should I use please?
You can have multiple versions of a gem installed:
gem install rails -v 5.2.4.4
And all modern rails versions have a way to select which specific one to use when creating a new app:
rails _5.2.4.4_ new application_name
If you want to downgrade an existing app - first search for a commit that upgraded it, if you're very lucky - a simple revert can do the job. But in more general case - you have to make your code compatible with older version (remove new feature usage etc), and fiddle with gem versions inside the Gemfile. Do a bundle update after edit - when a lower version is specified in requirements it will downgrade. Note that rails may be not the only gem requiring downgrade

What can be done about an unsafe/outdated gem dependency of a required gem?

I have bundler-audit (a check for known vulnerable gems) included as a pre-commit and in CI. It comes up with a known vulnerability in a previous version of the nokogiri gem and recommends I upgrade.
But here's the rub: the vulnerable gem is among the transitive dependencies of Rails and a few other gems I can't strip out. Some of them use a pessimistic version specifier which explicitly precludes the version of nokogiri to which I'd need to upgrade.
What does one do in a situation like this? Any advice?
If the current Rails 4.x gem has this dependency, file a bug against Rails.
I'd be very surprised if the current 4.x version of Rails has a dependency on an insecure version of a gem, though.

specify gem version to be used with a specific gem?

This is more of a general question, I'm new to rails.
I trying to use a gem that requires an older version of json, json -v 1.6.5
other gems in my rails application depends on newer version of json, json -v 1.8
I'm wondering if it is possible to specify json version to be used with a specific gem?
Thank you
No it's impossible to use 2 versions of a gem at the same time.
Use 2 versions of gem at same time
If bundle update doesn't resolve the dependencies I would fork on of the gems you need to use the same version as the other and then point to my fork.
gem 'some_gem', git: 'https://github.com/user/My-Fork.git'
Each of your dependencies will have a version constraint and your project can only use one version of each gem.
The answer to your specific question is that yes, you can control the version of an indirect dependency by specifying which version to use directly in your gemfile. However, this version must satisfy the version constraint of the direct dependency.
A brief example. Let's say your gemfile looks like this:
source 'https://rubygems.org/'
gem 'somegem', '~> 1.0'
And your gemfile lock looks something like this (note, some parts omitted for brevity):
GEM
remote: https://rubygems.org/
specs:
somegem (1.0)
json (~> 1.8)
json (1.8)
The Gemfile.lock indicates that somegem is dependent on json and that the json version must be greater than or equal to 1.8 but less than 2.0 (read more about the ~> operator here).
If you want to use lets say json version 1.9, you can modify your gemfile or use bundler commands to update the version used in the lock file.
E.g.
source 'https://rubygems.org/'
gem 'somegem', '~> 1.0'
gem 'json' , '~> 1.9'
In your specific case, if you have two dependencies that use conflicting versions of an indirect dependency, the gems will be incompatible. However, this example is meant to show that you can specify the version of an indirect dependency IF it meets the constraint specified by the direct dependency.
Rails uses Bundler to manage Ruby dependencies. An overview of the gemfile would be a good place to start learning how to manage your project's dependencies.

What version of capybara is compatible with Rails 2.3 and Ruby 1.8.7?

I'm trying to install capybara on a setup with Ruby 1.8.7 and Rails 2.3, but I received this message:
capybara requires Ruby version >= 1.9.3.
I have two questions.
The more relevant question:
What is the latest capybara version compatible with that setup?
The more important question:
How I can check that on my own?
Regarding Capybara's Ruby version dependency, I went to the capybara source code and read its History. Searching for "Ruby" quickly got me to the statement that Capybara dropped support for Ruby 1.8 in version 2.0.0. So the previous version, 1.1.4, is the most recent version compatible with Ruby 1.8.
Unfortunately that file says nothing about Rails versions. My Rails 2 projects used webrat, so I don't have any personal data points. However, Googling '"rails 2" capybara version' turns up examples of using Capybara 1.1 with Rails 2 (for example in the Cucumber documentation), so the most recent Capybara version that is compatible with your Ruby is also compatible with your Rails.
In your gemfile, specify a version so you can install it. Looking at an REE app i have at work, we're using 1.1.4:
gem 'capybara', '~> 1.1.4'
The ~> with 1.1.x will ensure it always stays at a 1.1.x patch level. Similarly if you use ~> 1.2 it will always stay at a 1.x patch level.

Resources