Elixir debugger crashes erlang on macOS - macos

macOS Big Sur 11.3.1 elixir 1.9.4 erlang 22.0
I am brand new to Elixir and I am trying to run a debugger for the first time. I run my webserver's development environment with iex -S mix and get the interactive elixir prompt. Then I type :debugger.start() and receive an immense output and then erlang crashes.
This is a small snippet, but the actual output is huge.
== NULL" failed in Register(): Class "wxTextValidator" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?
I have to use the versions listed at the top of the post, the project is version locked. Does anyone have any insight into what is causing this? It may be related to what I had to do to install erlang to begin with. But I'm not sure.
Thank you in advance.

I have never used the debugger, but I believe it relies on some of the same components as the observer. I would recommend installing Elixir and Erlang via asdf -- that makes it easier to install specific versions.
Once you've got things installed, you can use homebrew to install wxmac
brew install wxmac
Then to your mix.exs, add :observer, :wx to your extra_applications, e.g.
extra_applications: [:logger, :observer, :wx]

Related

Trouble with pod install of hermes engine on m1 mac

I've created a React-Native application as of 0.70.6, went through the grief of cocoapods and everything that comes with development on Apple's silicon chips (M2) and got it working and have done quite a bit of work on the project, and then (after creating a GitHub repo) handed it off to a coworker to do some design work (who is on an M1) ...had many issues on their machine as well, but eventually got it working. Now, React-Native 0.71.0 has been released and I ran through all of the steps to upgrade it and got it working on my M2 machine, no issues at all, but after pushing and getting it on their machine, I have not been able to find a solution to the pod install failing due to the hermes-engine not being able to load, a couple of the errors that pop up are,
[!] Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined method 'exists?' for FileClass.
I have been searching all day for what this means (I am fairly new to React-Native ...and mobile development in general) and I've gathered that 'exists?' has been deprecated as of certain versions of ruby (I'm on 3.2.0) although, it runs fine on my machine, so I am confused as to what could be missing. I've been using chruby to install ruby, and the only difference there is that I have ruby versions 2.7.5 and 2.7.7 on my machine ... but of course, there are flags that I had to set in order to actually be able to install them on my machine and I don't believe they affect my project since bundle install and pod install works using 3.2.0.
To list out what all I have installed on these machines:
bundler -> 2.4.1
cocoapods -> 1.11.3
ruby -> 3.2.0
node -> 18.13.0
xcode -> 14.2 (with command line tools)
Another bit of error reporting, in case it is useful:
Command `pod install` failed.
└─ Cause: Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined method `exists?' for File:Class.
# from /Users/<user>/projects/<app_dir>/node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec:46
# -------------------------------------------
# source[:http] = "file://#{destination_path}"
> elsif File.exists?(hermestag_file) && isInCI
# Pod::UI.puts '[Hermes] Detected that you are on a React Native release branch, building Hermes from source but fetched from tag...'.yellow if Object.const_defined?("Pod::UI")
# -------------------------------------------
If there is any information that I need to include for clarity, I will update this post as need-be.
I've tried removing the Pods file, and then pod install... same error
Removed Podfile.lock, cache clean AND removing Pods... same error
Removing node_modules/ npm cache clean --force && npm install
then doing npx pod-install to hopefully let node handle things... same error
Ran pod deintegrate and pod install... was scary, broke things, so reverted, back to square 1
There are other things that I've tried earlier today that I cannot remember, and they've gone home, so I can't access all the commands I ran, but these were the freshest, and until I get a more clear view, I'll be trying to get those flags that need to be set to install the older versions of ruby to see if that does anything
One last mention though, we also recently got an M1 Mac Mini, and I ran through all of the steps to get the project working...ended up in the same rut as the other M1, but again, will be trying those LD_FLAGS or whatever it may be and update this thread if that is what fixes the issue
Looking at older issues related to these, people found work-arounds using -x86_64 commands, and I've managed to get this far without any since maintainers have released newer versions with arm64 support, but if I need it anywhere, so be it, I'll take what I can get at this point
Without needing to install other versions of ruby or anything, I got it install the hermes-engine pod by doing something I find dirty...which is just go into that file it mentions and remove the 's' in exists? so it just says exist? and then I also downgraded cocoapods from 1.11.3 to 1.11.2 and seeing how that .podspec file is laid out, it conditionally loads the engine by first seeing if is downloaded on the machine, and then once it sees that it is not, that's where it eventually hits this problem code with the exists conditional...so it downloaded everything and worked fine and I was able to build and run my app on the mac mini...but when trying the same steps on the other m1 machine, I got a very useful error -- Oh no, an error occured ...perfect, and now I am questioning if these changes I have made will effect the M2 pod commands
If there is no better answer provided in the next few days, I'll assume this is the best possible fix until react-native upgrades their ruby version to 3.2.0 which after some more digging...is the exact release that this exists? file method was removed
But would still love feedback for anyone else using an M1 MacBook who has had these issues on the stable release of React-Native 0.71.0

How to solve "VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated"?

When I use iPython to run some scripts, I've got the following warning message in iTerm:
/Users/###/anaconda3/lib/python3.6/site-packages/ipykernel/displayhook.py:12:
VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated in pyzmq 14.0 and will be removed.
Install tornado itself to use zmq with the tornado IOLoop.
When I try to run my code in Visual Studio Code, I've got the following error message:
Error message in VSCode
I have already tried to update Anaconda, I have already tried to install nomkl with conda as well, without any success.
iTerm and VisualStudio on Mac OS 10.14.6, Anaconda up to date (4.7.12)
Remedy Option A)
Use anaconda-tools to separate an environment, say aLastWorkingENV, where you make use of anaconda-tooling to roll-back all components to a last working state, which does not whine about future deprecations. In such aLastWorkingENV environment, all thus synchronised programs will work smooth (as they did before a first component update, that has moved the stick)
Remedy Option B)
Use anaconda-tools to update all current components and all their supporting modules and all packages versions [ python, ipython, pyzmq, jupyter, ..., ] to their most recent versions, where products QA coverage ought either confirm the PASS, or provide a remedy or workaround or the last-trouble-free version ( to eventually downgrade one such package, based on such exception, if present and relevant )
Either way, your code would stop throwing the soft-warnings and remain in such state, until any un-coordinated package update takes place.

Installation of asciidoctor on osx 10.11.5 for newbie?

I tried to follow the installation process defined at: http://asciidoctor.org/docs/install-asciidoctor-macosx/#rvm-procedure-recommended but it failed with the error message
Error running 'requirements_osx_brew_update_system ruby-2.3.0',
showing last 15 lines of
/Users/richardcoffre/.rvm/log/1466510618_ruby-2.3.0/update_system.log
Because I am a newbie, but want to use asciidoc format, I need an updated and detailed installation process to install asciidoctor.
Best regards
Richard
Install Homebrew
brew install ruby
Open new terminal tab/window
which gem, it should print /usr/local/bin/gem
gem install asciidoctor
We should probably create a Homebrew package for Asciidoctor, it's unnecessary complicated now.
I am aware this does not exactly answer your question...
An alternative to this installation approach is to use an Application like AsciidoctorFX:
Or even simpler the preview extension for chrome:
If you are a developer, there is a good integration with several build system (maven, gradle, rake, gulp, grunt...). In that case the package manager will download Asciidoctor and the dependencies for you.

How do I debug a Ruby gem? (Compass)

I am in the early stages of learning Ruby and want to learn how to debug a gem, but am having trouble finding learning resources around this. A simple example would go a long way for me.
Is debugger the preferred debugger? Where do I require it? How do I set breakpoints with it?
Note: I am making an educated guess that the debugging process may be different depending on the gem that needs debugging, so for reference I am particularly interested in debugging certain issues with Compass.
OK, figured this out on my own. Here were the steps I took..
I am running Ruby 1.9.3 (determined by running ruby -v), so after testing ruby-debug and ruby-debug19, I determined these debuggers were no longer maintained, or at least didn't work properly with my install of ruby1.9.3-p125. This lead me to debugger.
The install instructions that worked were:
$ gem install debugger -- --with-ruby-include=PATH_TO_HEADERS
The PATH_TO_HEADERS on my machine, was simply the source location of ruby:
/Users/myusername/.rvm/src/ruby-1.9.3-p125/
Since I was particularly determined to debug the Compass compiler, I did the following:
Cloned the source: $ git clone git://github.com/chriseppstein/compass.git
Checked existing compass version first $ compass -v which was 13.0
Edited VERSION.yml and increased the patch number (to 13.1) so it didn't conflict with my existing install.
Edited the .rb of the file I wanted to debug, which was lib/compass/compiler.rb and added this line at the top: require 'debugger'; debugger
Built the gem: gem build compass.gemspec
Installed the newly compiled gem: sudo gem install compass-0.13.2.058ead2.gem
Compiled an existing compass based project that I was experiencing problems with, and started debugging.
When I was done debugging, I uninstalled the debugging version with sudo gem uninstall compass and chose the number corresponding to Compass 13.2.
Note about step 7: Since debugger has the same debugging commands as ruby-debug/ruby-debug19, I was able to follow existing tutorials around debugging steps..
Such as this RailsCast:
http://railscasts.com/episodes/54-debugging-with-ruby-debug
And this blog (and linked cheat sheet):
http://pivotallabs.com/users/chad/blog/articles/366-ruby-debug-in-30-seconds-we-don-t-need-no-stinkin-gui-
If you have other debugger tutorials, pointers, tips, etc, please post them.

How to avoid installing unnecessary dependencies with MacPorts?

I've tried to get postgresql 8.4 via MacPorts (on Snow Leopard) but it seems that the dependencies are endless - including getting older version of stuff that is already available in Snow Leopard, kitchen-sink and who knows if eventually I end up with windows 7 ...
Is there a way to get only those dependancies absolutely necessary to run stuff from command line in Mac?
Especially I'm trying to avoid installing old version of python, Xorg packages and so on.
Any ideas? So far it seems that it is better to avoid MacPorts altogether.
Looking at the port file for postgresql84, the +python variant for it actually means python2.5. Most of the dependencies you find annoying are probably being brought in by the python tkinter module dependency on Tk which by default builds an X11 version of Tk rather than the +quartz variant. You can change that by specifying that variant and reinstalling. The easy way to deal with variants is to add the options you normally want to use as defaults to those in /opt/local/etc/macports/variants.conf.
Unfortunately, at the moment, the tk +quartz variant build is broken on Snow Leopard. So, if you are not planning to use tkinter (or IDLE) with the MacPorts python2.5, you can force the removal after the fact of the unwanted modules:
port installed
port -f uninstall tk Xft2 xorg-libX11 ...
You might want to first do a dry-run by adding the -y option to see exactly what the effects of the uninstall will be.
Note, the python26 port has a handy +no_tkinter variant which could be useful once the portgresql ports are upgraded to python2.6.
It's potentially a bit of grunt work (and definitely violates Occam's razor for this particular scenario)... but if you're positive you know which dependencies you don't want/need, they can always be passed as hyphen-delimited args after the port call:
port install sweetPort -depYouDontWant -depYouDontNeed ...
I know it's been a while since the OP, but I hope this helps... somebody.

Resources