Why faraday dependency not being resolved by bundler? - ruby-on-rails-5.1

I added gem 'bitfinex-rb' in rails gem file, When I do bundle install, I got below mentioned error:
Bundler could not find compatible versions for gem "faraday":
In snapshot (Gemfile.lock):
faraday (= 0.14.0)
In Gemfile:
bitfinex-rb was resolved to 0.1.0, which depends on
faraday (>= 0.9.2, ~> 0.9.2)
kucoin was resolved to 0.1.1, which depends on
faraday (>= 0.13)
Running `bundle update` will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict.
I tried running bundle update but no luck, gives below error.
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
lograge (~> 0.3.1) was resolved to 0.3.6, which depends on
actionpack (>= 3)
pretender was resolved to 0.3.2, which depends on
actionpack
rails (~> 5.1.5) was resolved to 5.1.6, which depends on
actionpack (= 5.1.6)
rspec-rails (~> 3.6) was resolved to 3.7.2, which depends on
actionpack (>= 3.0)
simple_form was resolved to 4.0.1, which depends on
actionpack (>= 5.0)
Bundler could not find compatible versions for gem "actionview":
In Gemfile:
rails (~> 5.1.5) was resolved to 5.1.6, which depends on
actionview (= 5.1.6)
web-console was resolved to 3.6.2, which depends on
actionview (>= 5.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
dynamoid (~> 2) was resolved to 2.2.0, which depends on
activemodel (>= 4)
paperclip (~> 5.3.0) was resolved to 5.3.0, which depends on
activemodel (>= 4.2.0)
rails (~> 5.1.5) was resolved to 5.1.6, which depends on
activemodel (= 5.1.6)
simple_form was resolved to 4.0.1, which depends on
activemodel (>= 5.0)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
annotate was resolved to 2.7.4, which depends on
activerecord (< 6.0, >= 3.2)
rails (~> 5.1.5) was resolved to 5.1.6, which depends on
activerecord (= 5.1.6)
rails-erd was resolved to 1.5.2, which depends on
activerecord (>= 3.2)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
bullet was resolved to 5.7.5, which depends on
activesupport (>= 3.0.0)
formulaic was resolved to 0.4.0, which depends on
activesupport
lograge (~> 0.3.1) was resolved to 0.3.6, which depends on
activesupport (>= 3)
paperclip (~> 5.3.0) was resolved to 5.3.0, which depends on
activesupport (>= 4.2.0)
rails (~> 5.1.5) was resolved to 5.1.6, which depends on
activesupport (= 5.1.6)
rails-erd was resolved to 1.5.2, which depends on
activesupport (>= 3.2)
rspec-rails (~> 3.6) was resolved to 3.7.2, which depends on
activesupport (>= 3.0)
shoulda-matchers was resolved to 3.1.2, which depends on
activesupport (>= 4.0.0)
spring was resolved to 2.0.2, which depends on
activesupport (>= 4.2)
time_difference was resolved to 0.7.0, which depends on
activesupport (~> 5.1)
Bundler could not find compatible versions for gem "aws-sdk-resources":
In Gemfile:
aws-sdk (= 2.10.47) was resolved to 2.10.47, which depends on
aws-sdk-resources (= 2.10.47)
dynamoid (~> 2) was resolved to 2.2.0, which depends on
aws-sdk-resources (~> 2)
Bundler could not find compatible versions for gem "faraday":
In Gemfile:
bitfinex-rb was resolved to 0.1.0, which depends on
faraday (>= 0.9.2, ~> 0.9.2)
kucoin was resolved to 0.1.1, which depends on
faraday (>= 0.13)
Bundler could not find compatible versions for gem "json":
In Gemfile:
bitfinex-rb was resolved to 0.1.0, which depends on
json (>= 1.8.3, ~> 1.8.3)
cryptocompare was resolved to 0.14.0, which depends on
json
simplecov was resolved to 0.16.1, which depends on
json (< 3, >= 1.8)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.1.5)
devise_token_auth was resolved to 0.1.43, which depends on
rails (< 6)
sparkpost_rails was resolved to 1.5.1, which depends on
rails (< 5.3, >= 4.0)
suspenders was resolved to 1.45.0, which depends on
rails (~> 5.1.3)
title was resolved to 0.0.7, which depends on
rails (>= 3.1)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
devise_token_auth was resolved to 0.1.43, which depends on
devise (< 4.5, > 3.5.2) was resolved to 4.4.3, which depends on
railties (< 6.0, >= 4.1.0)
dotenv-rails was resolved to 2.5.0, which depends on
railties (< 6.0, >= 3.2)
factory_bot_rails was resolved to 4.10.0, which depends on
railties (>= 3.0.0)
jquery-rails was resolved to 4.3.3, which depends on
railties (>= 4.2.0)
lograge (~> 0.3.1) was resolved to 0.3.6, which depends on
railties (>= 3)
rails (~> 5.1.5) was resolved to 5.1.6, which depends on
railties (= 5.1.6)
rspec-rails (~> 3.6) was resolved to 3.7.2, which depends on
railties (>= 3.0)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
railties (< 6, >= 4.0.0)
web-console was resolved to 3.6.2, which depends on
railties (>= 5.0)
Bundler could not find compatible versions for gem "ruby":
In Gemfile:
ruby
suspenders was resolved to 1.46.0, which depends on
ruby (>= 2.5.0)
I tried deleting Gemfile.lock and bundle installed but getting above long listed error. What can be the solution for this type of scenario. Thank you all.

This is because kucoin 0.1.1 requires faraday >= 0.13 and bitfinex-rb 0.1.0 requires faraday ~> 0.9.2 (so >= 0.9.2 and <= 0.10). At least in Ruby Gems there is no higher version of bitfinex-rb so that you could update it. And the other version of kucoin (0.1.0) also requires faraday >= 0.13. So you can not install both gems (kucoin and bitfinex-rb) at the same time, because of the dependency. Bundle try to resolve the dependencies, but it can only do it if it is possible.

Related

Django deployment using lightsail site-packages are not updated

I am trying to deploy my Django application on AWS Lightsail.
I've been following the AWS tutorial and thought got it quite well.
I've successfully tested application on 0.0.0.0:8000 and the app is working fine.
However, when I deployed with apache, it keeps giving me the Internal Error 500. Hence, I've gone to look up the error_logs to investigate.
Based on my investigation, it seems like all of pip packages I've installed for my app are not installed on system's python's site-packages.
This is the list of packages when I run pip list
pip list
Package Version
appdirs 1.4.4
argon2-cffi 20.1.0
asgiref 3.2.10
astroid 2.4.2
async-generator 1.10
attrs 20.2.0
backcall 0.2.0
bleach 3.2.1
boto3 1.15.18
botocore 1.18.18
cffi 1.14.3
decorator 4.4.2
defusedxml 0.6.0
distlib 0.3.1
Django 3.1
django-carton 1.2.1
django-extensions 3.0.9
django-storages 1.10.1
entrypoints 0.3
filelock 3.0.12
importlib-metadata 2.0.0
ipykernel 5.3.4
ipython 7.16.1
ipython-genutils 0.2.0
ipywidgets 7.5.1
isort 5.6.4
jedi 0.17.2
Jinja2 2.11.2
jmespath 0.10.0
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.7
jupyter-console 6.2.0
jupyter-core 4.6.3
jupyterlab-pygments 0.1.2
lazy-object-proxy 1.4.3
MarkupSafe 1.1.1
mccabe 0.6.1
mistune 0.8.4
mysqlclient 1.4.6
nbclient 0.5.1
nbconvert 6.0.7
nbformat 5.0.8
nest-asyncio 1.4.1
notebook 6.1.4
packaging 20.4
pandocfilters 1.4.2
parso 0.7.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 8.0.0
pip 20.2.1
prometheus-client 0.8.0
prompt-toolkit 3.0.8
psycopg2 2.8.5
ptyprocess 0.6.0
pycparser 2.20
Pygments 2.7.1
pylint 2.6.0
pyparsing 2.4.7
pyrsistent 0.17.3
python-dateutil 2.8.1
pytz 2020.1
pyzmq 19.0.2
qtconsole 4.7.7
QtPy 1.9.0
s3transfer 0.3.3
Send2Trash 1.5.0
setuptools 46.4.0
six 1.15.0
sorl-thumbnail 12.6.3
sqlparse 0.4.1
terminado 0.9.1
testpath 0.4.4
toml 0.10.1
tornado 6.0.4
traitlets 4.3.3
typed-ast 1.4.1
urllib3 1.25.10
virtualenv 20.0.30
wcwidth 0.2.5
webencodings 0.5.1
widgetsnbextension 3.5.1
wrapt 1.12.1
zipp 3.3.1
However, these are not shown in the site-packages folder.
bitnami#ip-172-26-7-56:/opt/bitnami/python/lib/python3.8/site-packages$ ls
appdirs-1.4.4-py3.8.egg mysqlclient-1.4.6-py3.8.egg-info setuptools-46.4.0-py3.8.egg
asgiref MySQLdb setuptools.pth
asgiref-3.2.10.dist-info pip-20.2.1-py3.8.egg six-1.15.0-py3.8.egg
distlib-0.3.1-py3.8.egg psycopg2 sqlparse
django psycopg2-2.8.5-py3.8.egg-info sqlparse-0.3.1.dist-info
Django-3.1-py3.8.egg-info pytz virtualenv-20.0.30-py3.8.egg
easy-install.pth pytz-2020.1.dist-info
filelock-3.0.12-py3.8.egg README.txt
As a result, when the app is run by apache, there is internal server error and the packages I installed are not recognised.
I have spent about 3 days in a row trying to figure out deployment. For me, deployment is the most difficult task and I don't know where I am going. Would anyone recommend the easiest way to deploy django application?
Thanks a million!!

" Failed to find Chrome binary." in system spec gitlab-ci

Context:
Rails 6.0.3.4
Ruby 2.7.1
In my gitlab CI, I run a system spec using RSpec and Selenium. The test runs well locally but throw the following error in gitlab CI
Failure/Error: driven_by :selenium, using: :chrome
Webdrivers::BrowserNotFound:
Failed to find Chrome binary.
# ./spec/rails_helper.rb:35:in `block (2 levels) in '
Could anyone kindly advise me how to fix this error ?
Here is my .gitlab-ci.yml
image: "ruby:2.7.1-buster"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/bundle
- .bundle
- node_modules/
- .yarn
stages:
- build
- test
variables:
POSTGRES_HOST: xxxx
POSTGRES_USER: xxxx
POSTGRES_DB: xxxx
POSTGRES_PASSWORD: xxxx
before_script:
- gem install bundler
- bundle install -j $(nproc) --deployment
job_0_build:
stage: build
script:
- ruby -v
job_3_tests:
stage: test
cache:
paths:
- node_modules/
- .yarn
services:
- postgres:12.1
before_script:
- apt-get update -qq && apt-get install -y -qq nodejs
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
- yarn install --cache-folder .yarn
- yarn --version
- gem install bundler
- bundle install -j $(nproc) --deployment
script:
- bundle exec rake assets:precompile RAILS_ENV=test
- bundle exec rspec
Here is an extraction of my Gemfile.lock on (I think) relevant gems, I can provide others if you find useful
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
chromedriver-helper (2.1.1)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
capybara (3.33.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
webdrivers (4.4.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)

sunspot solr complains bout unsupported major.minor version 51.0

2.5 and ruby 2.1.6, with the latest version of sunspot_solr and sunspot_rails, when I run
rake sunspot:solr:run
it gives this error:
rake sunspot:solr:run
Please require the stackprof gem falling back to fast_stack
Starting Solr on port 8982 from /Users/nikso/.rvm/gems/ruby-2.1.6#sync/gems/sunspot_solr-2.2.3/solr/server
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jetty/start/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I read a few posts and followed their suggestion of updating JAVA to the latest version 8 update 20, and JRE version 8 update 71, to no avail. Any anyone shed some light on this please?
I addition to updating Java to latest version, I had to also set a correct path for JAVA_HOME environment variable.
In my case I edited ~/.bash_profile and added:
export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.i386/
Make sure the path matches the Java version you're running.

delayed_job version for active records?

I can't do rake db:migrate, it throws an error
Run rake gems:install to install delayed_job
I think the delayed_job version is the problem.
These are the Gemfile.lock relevant lines
delayed_job (2.1.4)
activesupport (~> 3.0)
daemons
delayed_job_data_mapper (1.0.0.rc)
delayed_job (~> 2.1)
dm-aggregates
dm-core
dm-observer

Google app engine return error log: unsupported major.minor version 51.0

I've just build a sample application to test out google app engine and google web toolkit feature, using a RPC service and google app engine with JDO. The service works on local. But after i deploy it to GAE and run, it show me the error as title says.
I use JRE7 to complie the application.
Here is my error log:
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: com/gwt/myexample/server/EmployeeServiceImpl:
Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-e8c21a25e91f709f(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext
(TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run
(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.
runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at java.lang.Thread.run(Thread.java:679)
My application link: http://jdodemo02.appspot.com/
Any suggestion please ):
Compile your application with Java SE 6. GAE doesn't support Java SE 7. Locally it works, because the GAE simulator runs on top of your local JDK.
One thing is to set the JRE 6 to the Build Path and the Compiler as well.
Dont forget, once you created your GAE Web Application project with a different JRE or JDK, always check the java version in the org.eclipse.wst.common.project.facet.core.xml in your .settings folder.
instead of directly editing the org.eclipse.wst.common.project.facet.core.xml in your .settings folder It will be better review it in eclipse as bellow
Right click on your eclipse project
Select Properties
Select "Project Facets" in the left panel
Select the Java version appropriately
I've been fighting for days. I have a Mac and needed to use GCM developing an Android app. The only way I could get GAE working in Android Studio, and also compatible with the installed JVM that I had was:
Install Homebrew.
Customize it with Homebrew Cask (brew install caskroom/cask/brew-cask).
Install Java using homebrew cask (brew cask install java).
Install Android Studio using homebrew cask (brew cask install android-studio).
Update Studio to the latest version.
Go to settings of the project in Studio and change the target JDK to the one that homebrew installed (1.8 located in /Library/Java/Home, which is actually a symlink).
Hope non of you guys run in the same path as I did, One just doesn't walk into Mordor, It has been 5 long days of fighting.
Too run creatjs project from Flash devlop you must downlod:
google compiler from link:
https://developers.google.com/closure/compiler/
haxe compiler from
http://haxe.org/download
jave jre 7

Resources