Heroku clojure repl gives java.lang.RuntimeException: No such var: repl/profile - heroku

I've been running this app for a while, and the web part seems to work fine. The repl did as well. But this morning 'heroku run lein repl' returns
java.lang.RuntimeException: No such var: repl/profile
I have been requiring minimum Leiningen 2.0.0, but if I remove that requirement in project.clj, the repl will load with version 1.7.0 or so.
I've noticed a few changes recently to leiningen/standalone_repl.clj in GitHub, but none that seem to explain the breakage.
Running the repl in the project locally works fine. Creating a clean, empty project and requiring leiningen 2.0.0 causes the same breakage.

It's most likely that I'm misunderstanding the question, and if so please forgive, though just to clear up a potential misconception: You almost never need to include leiningen in a project's dependencies unless you are developing a lein plugin.

It's a heroku problem. Leningen creator (and Heroku employee) left a comment about it on the clojure google group:
This is due to the release of Leiningen 2.0.0; the buildpack currently
back-ports a bugfix to the repl via an alias in a way that only works
in the preview. For the time being you can use lein trampoline repl
explicitly; I'll push a fix for the alias tomorrow. Thanks for
bringing this to my attention.

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

cannot install lein (Leiningen) for Clojure on macOS Catalina (10.15)

I've been unable to install Leiningen on macOS 10.15; I've followed the install instructions at leiningen.org.
The error I get is
gw#MacBook-Pro bin % sh lein
Error: -classpath requires class path specification
My classpath is
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/gw/usr/bin
and the lein install script (from leiningen.org) is in /Users/gw/usr/bin
Could the problem be leftover dirs/files from previous installations of lein?
My Macbook Pro is fairly new (< 1 year). Could it be that I don't have some software or package that's needed somewhere?
I've been banging about the Internet and the CLI for several hours and can't find a solution. Thanks in advance for your help.
I presume in your question above, you meant shell path and not classpath, and your PATH environment variable is set to what you showed in your question. If you installed lein as per the instructions, you should not need sh lein. Just lein should work.
I presume you've installed the lein from leiningen.org into /Users/gw/usr/bin and that it is executable.
Make sure that the new lein is in your path. See what which lein says. Does it point to the new lein? If you had a different version of lein installed via brew, it might be in /usr/local/bin which is first in your PATH.
Is java installed on your Macbook? Try java -version and see that it returns what you expect.
Make a new empty directory and cd to it.
Then run lein. It should show you the usage, if all is okay.
I don't know why this worked, but it did. I'm posting this because it may be a clue to someone who reads this.
Solution: I deleted the "empty" directory structure that I had created early (i.e., lein new foo) and recreated it from scratch (lein new foo). Everything worked fine.
My best guess as to why this worked is that I had created the old foo directory structure under an old version of lein (i.e., before I reinstalled lein), and something must have been different after I reinstalled lein. Your explanation may vary ;)

Webpack error "Chunk.entry was removed. Use hasRuntime()" on Heroku

I'm getting a build error when running webpack in trying to deploy a project to Heroku (and only then):
remote: ERROR in chunk webpackManifest [entry]
remote: js/[name]-[chunkhash].js
remote: Chunk.entry was removed. Use hasRuntime()
remote: Child html-webpack-plugin for "../server/views/index.hbs"
It works fine for me locally, it's just on a Heroku dyno that it fails. It seems to have started failing when I started using HTMLWebpackPlugin in my build, and the error message seems to point to that module (as you can see). Googling the error gives a bunch of results, but they all seem to boil down to this issue. That issue points to extract-text-webpack-plugin as the culprit, but the comments are all outdated and the suggestion (to install a beta or rc3 version of the plugin) doesn't work since extract-text-webpack-plugin seems to have passed that now. As far as I can tell, HTMLWebpackPlugin doesn't depend on extract-text-webpack-plugin at all.
EDIT: The Heroku install uses webpack#2.6.1, locally I was on 2.5.1, but manually changing to 2.6.1 locally still wasn't able to reproduce it.
EDIT 2: Explicitly upping the dependency in my package.json to ^2.7.0 seems to have made Heroku happy
I suppose this was some sort of temporary issue, since it seems to work if explicitly using the latest version.

heroku toolbelt command issues

I installed the Heroku Toolbelt following the instructions provided by RailsBridge's Installfest for Windows. I am running Windows 10 64-bit and the Command Prompt with Ruby and Rails provided by RailsBridge.
Each heroku command I attempt to input, be it 'version', 'login', or what have you, I get this:
heroku-cli: Adding dependencies... done
heroku-cli: Installing core plugins...Error reading plugin: heroku-cli addons.
Then I see a list of which plugins that there were reading errors for. The list is:
heroku-apps;
heroku-fork;
heroku-git;
heroku-local;
heroku-run;
heroku-status
Then:
ERROR: runtime error: invalid memory address or nil pointer dereference
Then it repeats this, adding dependencies, attempting to install core plugins, same reading plugin errors, but then after the runtime error runs again, it prints this:
! error getting commands pid 5052 exit 1
Previously, it was 'error getting commands pid 6912' or something like that. I looked around a bit and didn't see anything that specifically dealt with this, but I am sorry if I missed it before asking this question. I'm very new at this.
I would really appreciate any help or advice on how to correct this. I thank you very much ahead of time!
Edit: I now understand what pid is. Using another resource, I was told to check for the pid process in my task manager. I reran this process, got a different pid number, and searched for it in my task manager but to no avail. It isn't storing it.
I had the same problem and Heroku support team was quick to answer with:
can you delete ~/.heroku/heroku-cli and try again?
Next time you run a heroku command it will reinstall the toolbelt. Worked for me.
According to the support team it happened because:
It was a bug that was pushed yesterday we fixed this morning that some users ran into.
Good luck!

De Marzi's Neovigator

I am trying to use De Marzi's Neovigator
(https://github.com/maxdemarzi/neovigator)
and I'm not very successful with that.
I actually followed all the steps to install.
When I run the "neovigator.rb" file ("ruby neovigator.rb"), just nothing happens.
How do i run this, so i got the graph on a html page as a result.
Sry if I sound like I newbie, because I really am one in ruby.
Thanks a lot and Greetings
Schakron
I don't think you're supposed to run neovigator.rb. The instructions say to run rackup. I just went through the steps from the README and it's working
Keep in mind though that it's installing neo4j 1.9.4 which is a relatively old version considering how much neo4j has been developing over the last couple of years.
EDIT:
Posting instructions from the README here to make sure we're on the same page:
git clone git#github.com:maxdemarzi/neovigator.git
cd neovigator
bundle
rake neo4j:install
rake neo4j:start
rackup

Resources