how can i deploy scala on heroku - scala

i am following this link to deploy scala into heroku.
but i got H14 error in heroku - "no web processes running"
i found in internet i must have dyno active heroku ps:scale web=1
but this service is not free. to be valid user, we must enter credit card on heroku.
that meant Heroku is not free anymore ?
so how can i deploy scala API on heroku for free ?
my Procfile : web: target/universal/stage/bin/conspille2
my sbt
did i put Procfile in the right folder. it said on Root.
it is ambigue in root like i did or in root of app ?

Related

How can I host my backend flask app on heroku?

I have a reach app acting as the frontend and a flask app acting as the backend.
I hosted the frontend on heroku. The problem is with the backend.
When ever I deploy it on heroku it builds fine but I always get The below.
when I check the logs, I see the below.
I'm not sure what the issue is but I am thinking its in models file.
database_path = os.environ['DATABASE_URL']
db = SQLAlchemy()
def setup_db(app, database_path=database_path):
if database_path.startswith("postgres://"):
database_path = database_path.replace("postgres://", "postgresql://", 1)
app.config["SQLALCHEMY_DATABASE_URI"] = database_path
engine = sqlalchemy.create_engine(database_path)
if not database_exists(engine.url):
create_database(engine.url)
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.app = app
db.init_app(app)
db.create_all()
Any ideas?
if I didnt include enough information I apologize, I am brand new to running my web pages outside of my local machine.
EDIT:
I created procfile and added
web: gunicorn flaskr:app
new log is
my app structure is
First Try this in while deploying
heroku addons:create heroku-postgresql:hobby-dev
If that doesn't fix it, try the below
It looks from the logs that you have not configured the dynamo properly in your Procfile. Use gunicorn and try adding this to your Profile web: gunicorn app:app. This should fix the problem. If not, as you are using postgresql, it would be helpful if you download the heroku addon for postgresql from here
This should fix your problem. If Not, below listed are all the steps for deploying a heroku app. Please check if you followed all the below steps properly and in order.
For Flask I recommend doing the following things
Download heroku cli
Start a virtual environment with python -m venv . in your project fil
Activate the virtual environment
Login to your heroku account in the cli with heroku login
Install gunicorn pip install gunicorn
In your virtual environment, install the modules again with pip
Create a requirements.txt with pip freeze > requirements.txt
Create "Procfile" with the following info web: gunicorn app:app, this will fix the dynamo problem in the log
Start a empty git repository with git init
Create a appropiate .gitignore, you can find the template here
Create a new heroku app with heroku create my-app-flask
Add files to heroku git, git add .
As You are using postgresql, it would be helpful if you download the heroku addon for your app Get it here
Finally, git commit -m "Message" and git push heroku master
This should fix your problem.

Error in deploying webapp in heroku made by streamlit

I've uploaded all file dependencies of the web app made with streamlit into the github.
Repo link : https://github.com/sagnik1511/Lifely
But when I'm trying to deploy this project into Heroku it deploys correctly and when I am opening the webpage it shows error :
""" Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail """
Please anybody help :(

Scaffolding issue in toy_app

I am working through the rails tutorial online and I've hit a snag.
I worked through the Learn Enough Rails to Be Dangerous course on my native machine (macOS Mojave) and have rails 5.1.6 installed with rbenv. I had no issues working through the Rails Tutorial until lesson 2.2. I made it all the way through the $ rails db:migrate then $ rails server commands without issue but when attempting to load my web app with "the slash" + /users, I get this error:
"The page you are looking for doesn't exist. You may have mistyped the address or the page may have moved. If you are the application owner check the logs for more information."
The normal slash page still brings up "hello, world!" but none of the pages will load with the new files (/users, /users/1, /users/new, etc.).
I've tried deleting the application and the related repos (BitBucket, Heroku) and starting new from the beginning of lesson 2 and I still have the same problem.
Any insight is greatly appreciated.
So, I googled the error message I found in $ heroku logs
and found this:
Heroku Ruby On Rails Server Logs says 'Users' does not Exist
which led me to the command: $ heroku run rake db:migrate
which solved the problem--the /users page et al are now accessable.

Deploying to Heroku with my persistence.xml (JPA) without using Spring

I have an error in application deployment with "git push master heroku" while locally it works fine.
I want to use my persistence.xml for access to my data base of H2 (I will be use maybe PostgreSQL) all with my data source on WildFly 10.
I found no reference other than the Spring. (I can not use it)
Thank you!
I've deployed JavaEE web app (with jsf, javabean, ejb, di etc) on Heroku. Heroku will allow you to run shell script for starting your application like class with a main method or executable .jar file. Not on the pre installed fullstack application server. Also if you gonna run java app on Heroku your project should be maven.
To make it work from command line you can use cloud ready run anywhere tiny servers like payara-micro, wildfly-swarm, spring-boot. It turns your app and server into single executable jar (Uber JAR). Also tomcat and jetty have wrappers for build uberJar.
I use payara-micro and it's great that very little jar can run almost all of JavaEE features with session replication. Follow this link for instructions payara-micro how to (read also maven parts).
When you git push to Heroku(with heroku cli tool) it will automatically builds your project and run script from file called Procfile from your project root directory. Sample procfile:
web: java -jar target/myapp.jar --port $PORT
Consider $PORT part from above snippet. When Heroku runtime (dyno) starts it will open random port (I think so) and bind to $PORT environment variable. So here I'm passing that accessibe port to payara-micro server for listen. Other mentioned servers should work with similar procedures. You can find documentations at heroku devcenterr
For JPA and database connectivity Heroku provides JDBC_DATABASE_URL and DATABASE_URL environment variables that have connection information (url etc) for you to connect database. I couln't find the way to hook up those variables into persistence.xml. But you can create and configure EntityManagerFactory and EntityManager programmatically.
Hope it helps.

Rails Tutorial Chapter 9 Deploy to Heroku

first time asking on stackoverflow.
I completed chapter 9 of Rails Tutorial.
All the tests go through, the sample_app works fine on the server (I'm using cloud 9 btw). Everything is working...
until I try it after deploying it to Heroku.
So I deployed to Heroku following Hartl's instructions.
I did the $ heroku run rake db:migrate too.
Now, when I try to log in at the Heroku deployed app,
I get the error message :
"invalid email/password combination".
I'm 100% sure I have the right email/password, and the same email/password combination works fine on the rails server.
Can anyone please tell me what's wrong? I'm not sure where to even start look for bugs.. (if there are bugs)
You need to run $ heroku run rake db:seed so that you populate the database on your Heroku app with user account information.