Faye Gem dependencies issue With Eventmachine - ruby-on-rails

An error occurred while installing eventmachine (1.2.7), and Bundler
cannot continue.
In Gemfile:
faye was resolved to 1.4.0, which depends on
em-http-request was resolved to 1.1.7, which depends on
em-socksify was resolved to 0.3.2, which depends on
eventmachine
I have been facing this issue in my project. I have tried every single solution available on the internet but nothing works. My ruby version is 2.6.8
gem 'faye', '~> 1.2', '>= 1.2.3'

I found this on the October 13th comment on the ticket here, and it worked for me:
gem install eventmachine -v '1.2.7' -- --with-openssl-dir=/usr/local/opt/openssl#3
(Note: A 2020 comment recommends the same command with SSL 1.1 instead of 3.)

Related

install ruby on rails Mac os

hello guys i have checked all people sharing about installing ruby on rails but its the same problem
like this:
Fetching selenium-webdriver 3.4.3
Using listen 3.1.5
Using rails-dom-testing 2.0.3
Using globalid 0.4.0
Using activemodel 5.1.2
Using jbuilder 2.7.0
Using spring 2.0.2
Using rails-html-sanitizer 1.0.3
Using capybara 2.14.4
Bundler::GemspecError: Could not read gem at
/usr/local/lib/ruby/gems/2.4.0/cache/selenium-webdriver-
3.4.3.gem. It may be
corrupted.
An error occurred while installing selenium-webdriver (3.4.3), and
Bundler cannot continue.
Make sure that gem install selenium-webdriver -v '3.4.3' succeeds before
bundling.
In Gemfile:
selenium-webdriver
run bundle exec spring binstub --all
Could not find gem 'sass-rails (~> 5.0)' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.
I have experience with this driver, and downgraded to lower version here is the sample that work with my system, you can delete minitest incase you don't need it. I'm using rails 5.0.2
group :development, :test do
gem 'selenium-webdriver', '2.53.4'
gem 'minitest-rails-capybara'
gem 'minitest-reporters'
end
Bundler is trying to fetch the selenium-webdriverfrom its cache. Also, bundler suggests that the package is probably corrupt. You can try removing it from cache so bundler can install the gem again.
rm -f /usr/local/lib/ruby/gems/2.4.0/cache/selenium-webdriver-3.4.3.gem
bundle install

Force Bundler to install gems supported by the local Ruby version

Is there a way of installing the latest supported version of a dependency without specifying it?
I'm having issues with the activesupport gem. The latest version (5.0.0.1) supports Ruby >= 2.2.2. If I'm specifying that I require the gem like this '~> 4.2' Bundler will try to install version 5 even if I'm on Ruby 2.0. Specifying the exact version 4.2.7.1 or setting a maximum '~> 4.2', '< 5' works, except when using the gem with Rails 5.
Is there a way to manage gem versions based on the current Ruby version?
Apparently the new version of Bundler will do this for you automatically.
I found this comment from André Arko that mentions this is already included in the latest RC version.
I specified Ruby '2.0' in my Gemfile, installed Bundler with gem install bundler --pre (it installed bundler-1.13.0.rc.2) and bundle install successfully installed activesupport 4.2.7.1.
With Bundler 1.12.5 I was getting the following error:
An error occurred while installing activesupport (5.0.0.1), and Bundler cannot continue.
Note that while a bit more manual, you can also include logic in your Gemfiles:
if RUBY_VERSION < "2.2.2"
gem "activesupport", "4.2.7.1"
else
gem "activesupport", "5.0.0.1"
end

Bundler fails because it can't find compatible version of faraday gem

I'm trying to install a the instagram-ruby-gem but bundler keeps failing with this error:
Bundler could not find compatible versions for gem "faraday":
In Gemfile:
instagram (>= 0) ruby depends on
faraday (< 0.9, >= 0.7.4) ruby
instagram (>= 0) ruby depends on
faraday (0.9.0)
Here's my Gemfile:
gem 'instagram', git: 'https://github.com/larrylv/instagram-ruby-gem.git'
I am using this specific fork because it fixes the faraday version to be compatible with Rails 4. See the commit here, but here's the change:
- s.add_runtime_dependency('faraday', ['>= 0.7', '< 0.9'])
+ s.add_runtime_dependency('faraday', '>= 0.7.4', '<= 0.9.0')
I already tried bundle update. That did not work. The only faraday version installed is faraday 0.9.0.
I downloaded the forked gem, built it and then installed it. It looks like it went through without any issues on my end. So it is something to do with the environment or a gem conflict issue. I'd check to make sure you don't have any other versions of the gem installed. Do you use RVM by any chance and use gemsets with RVM? As a last resort you could delete the Gemfile.lock, but that is not really recommended. You could look at the Gemfile.lock file as well and look at the faraday references. Perhaps other gems need a certain version and the forked gem you use requires another version? I have run in to that before. It is not fun to try and resolve.
Mike Riley

Error message: You have requested: bcrypt-ruby ~> 3.0.1 The bundle currently has bcrypt-ruby locked at 3.0.1.

I am running my ruby on rails app on amazone elastic beanstalk but I am having the error as stated in the title.
I am using has_secure_password, hence I've uncommented the following inside my gemfile
gem 'bcrypt-ruby', '~> 3.0.0'
I pushed my code to elastic beanstalk and got the following erorr:
You have requested: bcrypt-ruby ~> 3.0.0
The bundle currently has bcrypt-ruby locked at 3.0.1.
Try running `bundle update bcrypt-ruby` (Bundler::GemNotFound)
I've tried changing my gem to the following but it doesn't work either.
gem 'bcrypt-ruby', '~> 3.0.1'
I managed to solve it by modifying Gemfile.lock file. I changed
specs:
bcrypt-ruby (3.0.1-x86-mingw32)
into
specs:
bcrypt-ruby (3.0.0)
I encountered other library issue, what I did is the same as above, removing mingw32.

Conflict updating to Rails 3.1.10

I am currently running one of my Rails applications on version 3.1.3. My gemfile always listed:
gem 'rails', '3.1.3'
This worked just fine. In an effort to move to 3.1.10, I changed my Gemfile to the following:
gem 'rails', '~> 3.1.10'
Surprisingly, things break when I run bundle update rails after that change:
Bundler could not find compatible versions for gem "multi_json":
In Gemfile:
twitter (>= 0) ruby depends on
multi_json (~> 1.3) ruby
fnordmetric (>= 0) ruby depends on
multi_json (1.2.0)
Just as a test, I tried changing the gem version to '>= 3.1.0' and that installed without any quims, albeit it went to 3.2, which I'm not ready for just yet on this particular application.
Any suggestions for getting this thing running on 3.1.10 which was released today to address a security vulnerability?
Also an update:
I am having absolutely no trouble stashing Gemfile.lock away and starting from Rails 3.1.4. As soon as I try to go to 3.1.5+, this is where all the trouble begins.
Make the change in your Gemfile to
gem 'rails', '3.1.10'
Then try running
bundle update
instead of
bundle install
I can't see your Gemfile but this should will allow the bundler to try and find compatible Gem matches. If you have hard code a Gem revision you might have to relax it and repeat the update. Good luck!
Looking at the gems, it appears that oauth2 lists "multi_json ~> 1.0" and ActiveSupport 3.1.10 lists "multi_json < 1.3, >= 1.0" as the dependencies, so that should resolve. I've run into strangeness like this and fixed it by running
gem uninstall <relevant gems>
then running bundle install again. So maybe try
gem uninstall oauth2 multi_json activesupport
then bundle install
Edit
gem uninstall twitter multi_json fnordmetric

Resources