Phoenix: Running mix ecto.create Error Compiling Ranch Dependency - phoenix-framework

I'm trying to go through the Up And Running tutorial on the Phoenix framework site. I have the following setup :
macOS 10.14.5
Phoenix 1.4.6
Elixir 1.8.2
Erlang/OTP 22
I create the project with the mix phx.new command. I get prompted to fetch and install the dependencies. I type Y. The dependencies get fetched and installed successfully.
I go to my project directory and enter the following command :
mix ecto.create
The following error appears :
(Mix) Could not compile dependency :ranch, "/Volumes/Macintosh HD/Users/mark/.mix/rebar3 bare compile --paths "/Code/hello/_build/dev/lib/*/ebin"" command failed.
You can recompile this dependency with "mix deps.compile ranch", update it with "mix deps.update ranch" or clean it with "mix deps.clean ranch"
I get the same error if I run mix phx.server.
If I run mix deps.clean ranch and mix deps.update ranch, it lists the following unchanged dependencies:
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
connection 1.0.4
cowboy 2.6.3
cowlib 2.7.3
db_connection 2.0.6
decimal 1.7.0
ecto 3.1.4
ecto_sql 3.1.3
file_system 0.2.7
gettext 0.16.1
jason 1.1.2
mime 1.3.1
phoenix 1.4.6
phoenix_ecto 4.0.0
phoenix_html 2.13.2
phoenix_live_reload 1.2.0
phoenix_pubsub 1.1.2
plug 1.8.0
plug_cowboy 2.0.2
plug_crypto 1.0.0
postgrex 0.14.3
ranch 1.7.1
telemetry 0.4.0
So ranch has been compiled. But when I run mix ecto.create again, I get the same error about being unable to compile dependency :ranch.
I did an Internet search to see if anyone else had the same issue. Every issue someone had with mix ecto.create involved creating database users. No one else had an issue with ranch.
What do I have to do to get the Up and Running tutorial running properly?

I've run into this problem under Ubuntu, and the issue was that the ~/.configure folder was unreadable by my current user. Changing the owner and group on that folder and it's contents solved the problem for us.
I was able to recreate this problem under MacOS, using Elixir 1.7.4 and Erlang 20.1 by changing the permissions on my ~/.config folder to 600. Setting the permissions back to 755 allowed the compile.

Related

Beam Dataflow job stuck after upgrading the Apache Beam version from 2.27.0 to 2.32.0

Currently I am in a process of upgrading the Apache Beam version from 2.27.0 to 2.32.0 but when I start my jobs on Dataflow runner the job stucks during the worker-startup and it never finish installing dependencies. The python version is 3.7
This is what I see in the logs
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime
After initial analysis it looks like this is the issue with pip dependencies backtracking and it keeps on downloading and installing dependencies. These are some warnings in the logs
INFO: pip is looking at multiple versions of google-auth to determine which version is compatible with other requirements.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead:
This is the setup.py for the Beam
import setuptools
REQUIRED_PACKAGES = [
"numpy==1.21.4",
"pandas==0.25.3",
"dateparser==1.1.0",
"python-dateutil==2.8.2",
"pytz==2021.3",
"google-api-core==1.14.0",
"google-cloud-storage==1.36.1",
"fastavro==0.22.10",
]
setuptools.setup(
name="data-workflows",
version="0.1.0",
install_requires=REQUIRED_PACKAGES,
packages=setuptools.find_packages(),
)
The pipelines used to run fine in the Beam version 2.27.0. I am not sure if these warnings are the cause of the issue. Could someone please help me to identify the root cause of this problem?

Nativescript Error: Executing webpack failed with exit code 1

I've done a fresh install of Nativescript on a new iMac (running Big Sur) following the instructions carefully (from https://docs.nativescript.org/environment-setup.html#macos-ios).
It was working fine after the install yesterday, but today I cannot run apps in ios simulator (or in an Android virtual device).
The ns doctor command in terminal gives me this initially:
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.5.1 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.0.2 version and is up to date.
However, when I create a new app (ns create) and then try to run in (ns run ios), I get this error: Executing webpack failed with exit code 1.
The error messages start with this: TypeError: Cannot read property 'resolved' of undefined.
The same thing is also happening when I try to run it on Android.
After trying to run it on both ios and Android, ns doctor adds these lines:
✔ Component #nativescript/core has 8.0.8 version and is up to date.
✔ Component #nativescript/ios has 8.0.0 version and is up to date.
✔ Component #nativescript/android has 8.0.0 version and is up to date.
So it seems like the platforms are being added properly.
Any help would be greatly appreciated!
The full error message is:
Searching for devices...
Preparing project...
webpack is watching the files...
/Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:817
if (entry.resolved !== undefined) return entry.resolved;
^
TypeError: Cannot read property 'resolved' of undefined
at getResolvedTimestamp (/Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:817:12)
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:1167:21
at /Users/student/Desktop/testApp/node_modules/webpack/lib/util/AsyncQueue.js:352:5
at Hook.eval [as callAsync] (eval at create (/Users/student/Desktop/testApp/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/student/Desktop/testApp/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
at AsyncQueue._handleResult (/Users/student/Desktop/testApp/node_modules/webpack/lib/util/AsyncQueue.js:322:21)
at /Users/student/Desktop/testApp/node_modules/webpack/lib/util/AsyncQueue.js:305:11
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:3098:21
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:3010:22
at /Users/student/Desktop/testApp/node_modules/neo-async/async.js:2830:7
at done (/Users/student/Desktop/testApp/node_modules/neo-async/async.js:2925:13)
at /Users/student/Desktop/testApp/node_modules/webpack/lib/FileSystemInfo.js:2994:23
at Array.<anonymous> (/Users/student/Desktop/testApp/node_modules/webpack/lib/util/fs.js:311:21)
at runCallbacks (/Users/student/Desktop/testApp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:27:15)
at /Users/student/Desktop/testApp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:200:4
at callback (/Users/student/Desktop/testApp/node_modules/graceful-fs/polyfills.js:299:20)
Executing webpack failed with exit code 1.
Thank you for reporting this, we have confirmed a breaking change in the latest webpack release:
https://github.com/webpack/webpack/releases/tag/v5.51.1
You can switch your package.json to use the rc as follows to resolve this right now:
"devDependencies": {
...
"#nativescript/webpack": "rc"
},
Then ns clean and you should be able to run your app now.
We also published another beta tag pinning webpack to 5.50.0 so doing ns clean without making any other dependency change in your own package.json should also work now.

Issue installing Tax4Fun

I'm trying to install the package "Tax4Fun" but keep failing.
I've tried 2 different ways:
install.packages("devtools")
devtools::install_url("http://tax4fun.gobics.de/Tax4Fun/Tax4Fun_0.3.1.tar.gz")
library(Tax4Fun)
The error that I get is:
ERROR: dependency 'biom' is not available for package 'Tax4Fun'
I've also tried installing biom directly
BiocManager::install("biom")
which does not work either
Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installing package(s) 'biom'
Installation path not writeable, unable to update packages: boot, foreign, KernSmooth,
mgcv, nlme, survival
Warning message:
package ‘biom’ is not available (for R version 3.6.1)
The other way I've tried to install Tax4Fun directly is
BiocManager::install("Tax4Fun")
I get the following error code:
Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.1 (2019-07-05)
Installing package(s) 'Tax4Fun'
Installation path not writeable, unable to update packages: boot, foreign, KernSmooth,
mgcv, nlme, survival
Warning message:
package ‘Tax4Fun’ is not available (for R version 3.6.1)
Please help :)
You need to install it by downloading the packages from source (http://tax4fun.gobics.de). Then it depends whether you are running on Linux/Mac or Windows.
From the command line, you navigate to the folder containing the .tar.gz downloaded package. Then you should install it using:
R CMD INSTALL Tax4Fun_0.3.1.tar.gz
But dependancies are not installed by default. So you need to install dependancies manually, Qiimer and Biom, which are both deprecated on Cran. You install them using the same command, after you have downloaded the packages from the Cran archives.
Before that, you need to also install their dependancies in R:
install.packages("pheatmap")
install.packages("RJSONIO")
Then you should be able to proceed as mentioned above: install Qiimer and Biom from the command line first. Then Tax4Fun from the command line too.
If you are running on Windows you should have quite the same issues, but the installation of the different packages and dependancies is different. You can have a look at the readme at http://tax4fun.gobics.de

How to deploy Elm and Phoenix Elixir to Heroku?

When trying to deploy a Phoenix/Elm project to Heroku I run into the following issue:
Running default compile
Elm compile: Main.elm, in web/elm, to ../static/vendor/main.js
/bin/sh: 1: elm: not found
17 Jul 15:58:21 - error: Compiling of web/elm/Main.elm failed. Command failed: elm make --yes --output ../static/vendor/main.js Main.elm
/bin/sh: 1: elm: not found
Check your digested files at "priv/static"
I'm using the buildpacks for Phoenix found in the guides and brunch/elm-brunch.
The error is caused by the elm binaries not being installed. One way to install elm is by using npm, which is already available as the Phoenix buildpack uses it.
Solution: Add elm as a dependency in package.json. This will cause the Phoenix buildpack to install elm before executing the brunch script.
Note that a local computer may have a separate installation of the elm binaries, potentially causing confusion. As long as versions match, this ought not be a problem. Note that to use the elm binaries installed by npm above, one has to include ./node_modules/.bin in ones PATH (which the phoenix buildpack does). E.g. if one has a separate elm installation which is included in PATH since before, this will be used when running commands from the prompt.

play20 app (v. 2.0.2) deployment on heroku

Trying to get a play 2.0.2 application going on heroku and it seems it is not yet supported.
Has anyone had any luck with this?
Error:
http://s3pository.heroku.com/maven-scala-tools-snapshots/org/scala-tools/sbt/sbt_2.9.1/0.11.3/sbt_2.9.1-0.11.3.pom
-- artifact org.scala-tools.sbt#sbt_2.9.1;0.11.3!sbt_2.9.1.jar:
http://s3pository.heroku.com/maven-scala-tools-snapshots/org/scala-tools/sbt/sbt_2.9.1/0.11.3/sbt_2.9.1-0.11.3.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-tools.sbt#sbt_2.9.1;0.11.3: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-tools.sbt#sbt_2.9.1;0.11.3: not found
Error during sbt execution: Error retrieving required libraries
(see /tmp/build_7sg3kay36u6a/project/boot/update.log for complete log)
Error: Could not retrieve sbt 0.11.3
! Failed to build app with SBT 0.11.0
! Heroku push rejected, failed to compile Scala app
This was happening because of old cache (my app had been deployed on heroku before, hence the old cache)
From the root of your play application, do
heroku config:add BUILDPACK_URL='https://github.com/heroku/heroku-buildpack-scala#cleancache'
then push your app again
This will drop all cached artifacts and the sbt jar and re-download up to date fresh ones.
Just remember to do heroku config:remove BUILDPACK_URL afterwards or each time you push the cache will be dropped and builds will take a while.
Kudos to scott # play googlegroups
https://groups.google.com/forum/#!topic/play-framework/yUDfW2UtBjs
This could be unrelated, but I had some conflicting plugin in myhomedir/.sbt/plugins/build.sbt that messed up my Play 2.0.2 build. Removing that fixed it for me.
I had this exact error on my Mac and it was because MacPorts did not install the correct version of SBT (sudo port install sbt gave me 0.11.2 not 0.11.3) - yes I updated my port tree. So I sudo port uninstalled sbt and used brew install sbt. This (Homebrew) installed 0.11.3 and the problem disappeared. I would suggest checking the sbt version on Heroku.
If you encounter this on play 2.0.4 (I know, this question is for play 2.0.2, but it's first on google):
change the sbt version to 0.11.3:
Change sbt version in project/build.properties to 0.11.3

Resources