Heroku system cannot find path specified - heroku

I'm doing the tutorial on Heroku Dev Center (found here: https://devcenter.heroku.com/articles/getting-started-with-scala#introduction). I got through all the steps leading up to running my app locally (as far as I can tell the app is deployed properly and I have installed the app dependencies), but when I run the command 'heroku local web -f Procfile.windows' it gives me back an error on web.1 saying "the system cannot find the path specified"... I double checked that web.1 is up using 'heroku ps' command.
Help!

Seems to be related to the JDK version. I was trying to use JDK 10.0.1 and encountered the same problem. When I changed to point to JDK 1.8.0_121 which (I think) Heroku installed, I was able to continue.

The file specified at the Procfile.windows is not available, yet.
web: target\universal\stage\bin\play-getting-started.bat
To solve this, run:
sbt compile stage
in the root of the project directory to produce the required files.

Related

What could be the reason why "heroku open" command is not working?

I have successfully deployed a django app on heroku using this guide. The heroku cli is installed as a snap application on my system - I'm running Fedora 32 on a Dell xps 15 - and everything seems to be working fine except when I try to run the app locally.
When I attempt to run the app locally, I get the following error:
$ heroku open
▸ Error opening web browser.
▸ Error: Exited with code 4
▸
▸ Manually visit https://[myapp].herokuapp.com/ in your browser.
I tried variations of the command to no avail:
$ heroku open -a [myapp]
$ heroku open -r https://git.heroku.com/[myapp].git
When, instead, I run it with heroku local it runs without any problems.
I look at the logs but couldn't find any clues. Neither was I able to find any useful information.
What am I missing?
Try setting the browser in your ~/.bashrc using export BROWSER=
If someone uses Windows Subsystem for Linux, set the BROWSER environment variable in the corresponding shell configuration file (e.g., ~/.zshrc) to wslview.
export BROWSER=wslview

MODULE_NOT_FOUND in heroku pg:backups

I've got problem with heroku pg:backups capture --app myapp command.
Heroku CLI submits usage information back to Heroku. If you would like to disable this, set `skip_analytics: true` in /home/ubuntu/.heroku/config.json
heroku-cli: Updating to 4.99.0-e5f5ef4... done
heroku-cli: Updating CLI...heroku-cli: Updating to 5.11.8-f58f4fa... done
Starting backup of postgresql-spherical-5948... done
Use Ctrl-C at any time to stop monitoring progress; the backup will continue running.
Use heroku pg:backups:info to check progress.
Stop a running backup with heroku pg:backups:cancel.
Backing up DATABASE to b598... pending
Backing up DATABASE to b598... !
▸ MODULE_NOT_FOUND: Cannot find module 'bytes'
Does anybody have similar problem? This command is launched with deploy on CircleCI.
I started running into the same problem yesterday and was finally able to come up with a solution that is working for me.
For starters, it looks like bytes is a dependency of heroku-pg, which is the part of Heroku CLI that is being used for the backups command. It seems like the dependency is not being included or installed with the version of heroku-cli that is being used to run the backup command.
I tried CircleCI’s “Rebuild with SSH” to troubleshoot the issue, and encountered similar error messages when attempting the backup command there. While trying to reinstall heroku-cli using npm, I found that the npm and node versions were way behind what heroku-cli wanted, so maybe that is part of the problem? Anyway, reinstalling with npm only produced an even more broken Heroku CLI.
Finally I checked the build environment and it was set to Ubuntu 12.04 (Precise) which probably explains the way out of date npm/node packages. I changed it to Ubuntu 14.04 (Trusty) and pushed a new commit to CircleCI (A rebuild alone is not sufficient to change OS versions) and was able to successfully run the backup command that had been failing!
Solution: Set CircleCI build environment to Ubuntu 14.04

heroku: bash: bundle: command not found

I am porting a Heroku app from Aspen to Cedar stack at Heroku, following their instructions.
I'm at the last deploy step. I get this error:
2012-10-22T11:23:53+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -p 40310 -e production`
2012-10-22T11:23:54+00:00 app[web.1]: bash: bundle: command not found
I can't see how I can be responsible for telling the Heroku stack where bundle is, or providing it, since bundler is used by it for exactly this job. This command is specified in the Procfile for the app:
web: bundle exec thin start -p $PORT -e $RACK_ENV
Another similar question on stackoverflow suggests that this happens if the app is pushed to Heroku without a Procfile initially, so Heroku gets the wrong idea about what kind of app it is. That poster deleted his app and created a new one and reported success. However, the effort involved in deleting and recreating my ported app is high. Is there some way I can fix this rather than start over?
Heroku's slug build process must have changed with regard to ruby 1.8.7 apps. I'm guessing they started bundling to 1.8 paths instead of 1.9.1 for 1.8 apps. My previously working app stopped working after I tried to push a new revision.
Here's what got it working again:
heroku config:add PATH=bin:vendor/bundle/1.8/bin:/usr/local/bin:/usr/bin:/bin GEM_PATH=vendor/bundle/1.8
I took these paths from a newly created app using the same git repository as I used before.
EDIT: Turns out that heroku published a devcenter article Changing Ruby Version Breaks Path that specifies paths for various ruby versions.
I had the same issue and I solved it by setting the correct heroku config variables
$ heroku config
=== xxxx Config Vars
DATABASE_URL: postgres://(...)
GEM_PATH: vendor/bundle/ruby/1.9.1
HEROKU_POSTGRESQL_CRIMSON_URL: postgres://(...)
LANG: en_US.UTF-8
PATH: bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
PGBACKUPS_URL: https://(...)
RACK_ENV: production
RAILS_ENV: production
you can create an empty rails app, push it to heroku and check the variables it automatically set, then copy (and adapt) them to your application

how to run phantomjs on heroku?

I am trying to run phantomjs on the heroku cedar stack.
I am using a phantomjs buildpack for heroku https://github.com/stomita/heroku-buildpack-phantomjs.
However I followed the instructions but still cannot make it work.
When I run the command heroku run bash and type phantomjs --version it says phantomjs: command not found
I read things about LD_LIBRARY_PATH that needs to be set to "/usr/local/lib:/usr/lib:/lib:/app/vendor/phantomjs/lib", this is what i did but without success.
Is there something that i am missing ?
Where does the buildpack install the phantomjs binary exactly ? Is there a way to know the path where the binary is ?
I am using ruby 1.9.2
Thanks a lot for your help.
EDIT: To be more precise, i want to combine ruby and phantomjs, so i am using this custom buildpack: https://github.com/ddollar/heroku-buildpack-multi, but when i push to heroku i get "Heroku push rejected, failed to compile Multipack app"
Download the 64-bit linux binary file from phantomjs.org here http://phantomjs.org/download.html
Create a bin/ directory in your app if you do not already have one and place the binary file there. You should then be able to test if you can run it with "heroku run 'phantomjs'" or "heroku run 'bin/phantomjs'"
For phantomjs with javascript
I dont know if the previous examples are actually necessary becasue although i am working with javascript it should not be different. For me all i had to do was place the phantomjs buildpack as the first on the list of installed buildpacks on your master.
check available buildpacks
open terminal from the app folder and type:
heroku buildpacks
This wll show the available buildpacks.
eg.
1.heroku/node.js
2.https://github.com/stomita/heroku-buildpack-phantomjs.git
As you can see the buildpack is second on this list. We need tomake it the first in the list.So, what i did was i removed the phantomjs builpack and then add it again but this time made sure its first on the list of all available buildpacks.
So, to remove a buildpack, type:
heroku buildpacks:remove https://github.com/stomita/heroku-buildpack-phantomjs.git
this removes the buildpack.You can check it by typing:
heroku buildpacks
Now, it should only show,
1.heroku/node.js
Great, now we add the phantomjs buildackmaking sure its first . So on terminal type:
heroku buildpacks:add --index 1 https://github.com/stomita/heroku-buildpack-phantomjs.git
You can check if its first by typing:
heroku buildpacks
Now, it should be ,
1.https://github.com/stomita/heroku-buildpack-phantomjs.git
2.heroku/node.js
Thats It!!
now, on terminal , type:
heroku run bash
once you're in bash, type
phantomjs --version
The current verion of phantomjs should be shown on the terminal.
2.1.1

"No such file or directory - getcwd" error on rubygems on Mac Os Lion

I'm trying to launch a heroku console that uses rubygems but I keep getting this error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:471:in `expand_path': No such file or directory - getcwd (Errno::ENOENT)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:471:in `find_files'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:470:in `map'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:470:in `find_files'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1103
from /usr/bin/heroku:9:in `require'
from /usr/bin/heroku:9
I'm using Mac OS Lion 10.7.3. Any ideas on how to fix this? Thanks!
Maybe the current working directory of the shell that's used to start your heroku process doesn't exist (maybe removed by another process, as in my case), and therefore getcwd throws an error.
This happened to me. It turned out I had deleted the folder I was running the command in.
I had that same issue.... running sudo gem update --system fixed the problem... give it a try.
I had the same thing, just type cd in the terminal, then navigate back to where you were and it works.
Tried starting the rails server in another console tab.
cd . solved it for me
Faced a similar issue while setting up rails app locally.
The issue was that the server was running in a directory which i had removed from another terminal window to recreate the app.
Close terminal and do it again or go to some other directory and come back and do it...
Anything should work..It did for me.
I encounter a same one, it happened when the working directory has actually been removed.
This doesn't appear to be Heroku issue as something in your code is requiring this getcwd.
What happens if you run this application locally in production mode? Have you defined all of your dependencies for Heroku (either via a .gems file or Bundler)
In my case, I was in a directory that had "unusual" characters in its name: /Volumes/Members/Finance & Accounting/-MC 2008, 7848/2020.
And also, I was in a remote directory, as Mac users will recognize.
I simply did push ~ and ran the command again, then did popd to get back to my remote directory with odd characters in the name.
It could be that gem is ill-behaved in the face of directory names containing whitespace, or it could be that it doesn't work on networked directories.
The bash built-in pwd worked just fine in the remote directory with the funny name.
This whole thing makes me a bit nervous about gem.
solved for me
cd ..
cd -
you have to go back and return to current directory.
Ended up on this page from searching for the same error on AWS Elastic beanstalk.
The problem with getcwd is because EB is trying to repeat the deployment process endlessly. It changes the /var/app/staging directory before it is able to finish the current action. getcwd fails because the directory was already replaced. Try deploying a stable version or a sample app
This just happened to me while I was running a Sinatra app on my localhost and this is what I found.
Scenario:
I'm using Git as my version control and I switched branches from development to master to merge my branches. After the merge, with an active server running, I made a minor html change which shouldn't have blown up the app and when I went to check the change in my broswer my "request" came back with OP's error - just to note this app isn't deployed to heroku.
My guess:
I'm not familiar with the intricacies of Webbrick (or equivalent programs) but I'm guessing you had an active server running (like me) and it was was looking for specific file(s) in memory and when they were modified on a possible branch change or an important file was modified/deleted - Webbrick freaked out and didn't know where to find it/them and threw up this error.
I'm not sure what version control you're using but I know git is popular for heroku so I think this might have something to do with your issue.
Fixing the issue for myself was as simple as restarting the server, hope this helps future trouble shooters.
I solved this problem by closing and restarting my terminal, setting the correct Ruby version in the new Terminal to
$ rvm use 2.1.1
(or whatever Ruby version is relevant to your program)
as explained by gerardk
you could try this before launching back heroku console
$ pwd #ie: /mywork
$ cd ..
$ cd [pwd] #ie: cd mywork
now go launch back heroku console
Restart system fixed this problem in my case
I worked around this error by shutting down the server, restarting my terminal, then restarting the server.
sudo gem update --system (as Israfil Havilah mentioned) and rebooting the server (Ubuntu 16.04.6 LTS) helped me
Make sure, you are not switching git branches. To me, it happened due to switching between GIT branches deleted my folder.

Resources