Skip to main content

Rails Application Templates Discussion

General • Asked by Chris Oliver
4e765b3689a04006b896e4305584de94
Hello,

Im getting
Could not find "Procfile" in any of your source paths. Your current source paths are:
/Users/my_user/Documents/dev/my_app/https:/raw.githubusercontent.com/excid3/jumpstart/master
Using this command:

rails new myapp -d postgresql -m https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb
Also tried this one (downloading the repo):
rails new myapp -d postgresql -m template.rb

The installation hung up, and when I interrupted it and tried to do "foreman start", got:
+ERROR: Procfile does not exist

Any help making the template work ?

Best regards,
Leonardo
Ce795239ba5dd2384fc2f88ffaff5451
Hey Leonardo,

If the Procfile didn't exist, I would imagine that the full template didn't run successfully. I've made a handful of extra changes since the episode so you might want to try it again. I still haven't fixed the HTTP version of it so you'll need to use the downloaded repo still.
4e765b3689a04006b896e4305584de94
Hello Chris,

Thanks for you reply, I updated my local jumpstart repository and got another error:
Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
But it was because I didnt have Redis server installed, after I installed it, everything worked ok.

Thanks for your help,
Leonardo

44c001dbc5ec46b4fbb00a89074af362
Had the same issue with Redis not installed but also needed to install foreman before everything worked like a charm! Thanks Chris!
~Uzi

4e6e1b319cc561d7294ecdeb7a3c8b94
Hi!

I came across an error when I was trying to generate a scaffold:
(erb):1:in `template': undefined local variable or method `model_resource_name' for #<Erb::Generators::ScaffoldGenerator:0x00007fd4e005ccf8> (NameError)

I had to replace every occurrence of model_resource_name with singular_name in the file lib/templates/erb/scaffold/_form.html.erb in the newly created app folder. 
Example:
<%%= form_with(model: <%= model_resource_name %>, local: true) do |form| %>
becomes
<%%= form_with(model: <%= singular_name %>, local: true) do |form| %>

Best regards,
Mark
Ce795239ba5dd2384fc2f88ffaff5451
Thanks for the heads up! I was working on overriding the scaffolds like I mentioned in the video and this was one of the errors I ran into. I think I already fixed it but forgot to push it up.
Ce795239ba5dd2384fc2f88ffaff5451
Actually, I bet it's just that you're not using the latest version of Rails 5.2 (rc1 and rc2 are what I'm using). I don't think the beta will work because it looks to have changed in this commit: https://github.com/rails/rails/commit/cf56397ccd10174d94f60331e4a55ff765b3485b

"gem install rails --pre" should fix your problem or just update it in your Gemfile to rc2.

Faff411a9ca427b444717ca9044a8e4f
Awesome video, thanks for sharing!

12f5c0752ec2e657c0f2d2bbb332399f
Hello. I'm trying to publish only the basic template in Heroku, but getting error: 

Redis::CommandError: ERR max number of clients reached
https://dashboard.heroku.com/apps/parolin-celula/logs

It's working well in my localhost. 

Ce795239ba5dd2384fc2f88ffaff5451
Hey Gustavo,

Sounds like your Redis instance on Heroku has a maximum number of connections. You might need to reduce the concurrency on Sidekiq or something to create less Redis connections (or increase your Redis node).

6908b1c7fd69d0a688a8f693b33fc679
Hello Chris,

      While scaffolding I am getting undefined method `model_resource_name' .  Did I miss anything?

template': undefined local variable or method `model_resource_name' for #<Erb::Generators::ScaffoldGenerator

Ce795239ba5dd2384fc2f88ffaff5451
Make sure you're using Rails 5.2 when you use the template. We're only going to support that version since it's almost released and we can take advantage of things like ActiveStorage.

Cfb1e7021f0e0cb6723368171a843e5c
Hey @chris, I have a brand new Ubuntu OS install and have installed refresh Ruby 2.5 and Rails 5.2 running 
the new app command as you mention I am getting the following errors. Any idea why this might be? It builds app but seems to fail everything else after...

Sorry... Link here.
https://drive.google.com/file/d/178Krtd3HP499LRzDacuxKKula-P4ea3s/view?usp=sharing

Ce795239ba5dd2384fc2f88ffaff5451
Hey Josh,

Administrate gem just needed updating. Should be fixed now!
Cfb1e7021f0e0cb6723368171a843e5c
That did the job. :) Legend. Thank you.

F7c299ac958ebb98a2f3a71587bbf959
Hi Chris 
Thanks for your work on this. For someone with low experience, this is massively helpful! 
That said I'm still battling to get it running.
 My local environment is Os X 10.13.6. I have new installs of Rub 2.5 and Rails 5.2.
I've installed yarn, redis, foreman;
but still seem to be having issues with getting Jumpstart to work.

It seems to be something about:
You need to allow webpack-dev-server host as allowed origin for connect-src. 
This can be done in Rails 5.2+ for development environment in the CSP initializer 
config/initializers/content_security_policy.rb with a snippet like this: 
policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?

Here are the errors:
https://www.dropbox.com/sh/w05wxfunrj71rwp/AAAF-7nlhaIw5XBapoiqnNura?dl=0

Any help you could lend would be greatly appreciated so I can get onto doing your other Series.


Grant

F7c299ac958ebb98a2f3a71587bbf959
Update: ok it appears to have been an issue with Redis not initiating properly. I reinstalled at it's resolved the issue. 

1783f7e30ef692d53ed848b0ea2cca4c
Thanks for awesome video!
I want to try and follow this tutorial but i have an err when i make a new app.
------------------------------------------------------------

generate  devise:views:bootstrapped 
=> err : Traceback (most recent call last):

-----------------------------------------------------------
i have an traceback err and i have no idea why this is happen?
someone please help me. 
( any hint is okay )


Ce795239ba5dd2384fc2f88ffaff5451
Hey Lee,

You need to include the other lines as well after the error because that's what we use to debug what went wrong. Without it, we can't tell what happened.
1783f7e30ef692d53ed848b0ea2cca4c
Hi Chris

i tried to find out what's the problem,
and i made a code size much smaller to find out the problem.

i just make a code size to a basic size,
and this basic template also didn't work properly,

problem is occurred when start generate something.
i captured the code and terminal lines,

 code & errs :  https://imgur.com/a/no9qOav

( this kind of similar err is occurred when running "jump start :  template.rb" )


Fa34c40ec3397998cacad2f4e96932d4

Hi Chris, great video and I would love to use this template.

I've been stuck with this issue for ages, please help! 

When I run foreman start ...

|     + 11 hidden modules
07:55:40 webpack.1 | webpack: Compiled successfully.
07:55:48 web.1 | => Booting Puma
07:55:48 web.1 | => Rails 5.2.0 application starting in development
07:55:48 web.1 | => Run rails server -h for more startup options
07:55:57 sidekiq.1 | 2018-06-30T06:55:57.652Z 30469 TID-ov3hhgys5 INFO: Running in ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
07:55:57 sidekiq.1 | 2018-06-30T06:55:57.652Z 30469 TID-ov3hhgys5 INFO: See LICENSE and the LGPL-3.0 for licensing details.
07:55:57 sidekiq.1 | 2018-06-30T06:55:57.652Z 30469 TID-ov3hhgys5 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
07:55:57 sidekiq.1 | 2018-06-30T06:55:57.652Z 30469 TID-ov3hhgys5 INFO: Booting Sidekiq 5.1.3 with redis options {:id=>"Sidekiq-server-PID-30469", :url=>nil}
07:55:57 sidekiq.1 | Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:344:in rescue in establish_connection'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:328:in
establish_connection'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:99:in block in connect'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:291:in
with_reconnect'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:98:in connect'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:363:in
ensure_connected'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:219:in block in process'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:304:in
logging'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:218:in process'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis/client.rb:118:in
call'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:274:in block in info'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:45:in
block in synchronize'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/2.5.0/monitor.rb:226:in mon_synchronize'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:45:in
synchronize'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/redis-4.0.1/lib/redis.rb:273:in info'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq.rb:113:in
block in redis_info'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq.rb:95:in block in redis'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in
block (2 levels) in with'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in handle_interrupt'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in
block in with'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in handle_interrupt'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in
with'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq.rb:92:in redis'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq.rb:106:in
redis_info'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/cli.rb:80:in run'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/bin/sidekiq:12:in
<top (required)>'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/bin/sidekiq:23:in load'
07:55:57 sidekiq.1 | /Users/jamesweetland/.rbenv/versions/2.5.1/bin/sidekiq:23:in
<main>'
07:55:58 sidekiq.1 | exited with code 1
07:55:58 system | sending SIGTERM to all processes
07:55:58 web.1 | Exiting
07:55:58 webpack.1 | exited with code 0
07:55:58 web.1 | terminated by SIGTERM
Ce795239ba5dd2384fc2f88ffaff5451
Like the error mentions:
07:55:57 sidekiq.1 | Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)

Make sure you have Redis installed and running. Anytime you have a connection refused for any service like Postgres, MySQL, Redis, etc, it means it's not running. 

Fa34c40ec3397998cacad2f4e96932d4
haha so obvious! my bad thanks Chris!
Ce795239ba5dd2384fc2f88ffaff5451
You're all good, easy to overlook those things sometimes! :D

2cbbc6e0816b83200194247cf37fb30d

Jumpstart Giving me This error
gsub app/dashboards/announcement_dashboard.rb
/Users/noman/.rvm/gems/ruby-2.4.1/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:263:in `binread': No such file or directory @ rb_sysopen - /Users/noman/Projects/UOB/uob/uob/app/dashboards/announcement_dashboard.rb (Errno::ENOENT)

Ce795239ba5dd2384fc2f88ffaff5451

Hmmm, it sounds like Administrate didn't generate a dashboard file for the Announcement model. That's weird.


Fecef236fdd08050b739cef24565c947

Hi, I'm trying to run jumpstart on my Cloud9 IDE.
Installed yarn successfully and generated the app but when trying to run the app it shuts down. It ends like this:

(...)
18:30:37 webpack.1 | [25] ./app/javascript/packs/application.js 515 bytes {0} [built]
18:30:37 webpack.1 | + 11 hidden modules
18:30:37 webpack.1 | webpack: Compiled successfully.
18:30:37 sidekiq.1 | exited with code 1
18:30:37 system | sending SIGTERM to all processes
18:30:37 web.1 | - Gracefully stopping, waiting for requests to finish
18:30:37 web.1 | === puma shutdown: 2018-10-03 18:30:37 +0000 ===
18:30:37 web.1 | - Goodbye!
18:30:37 web.1 | Exiting
18:30:37 web.1 | terminated by SIGTERM
18:30:37 webpack.1 | exited with code 0

Any idea on how run the server and see the app running?
Thanx


3cf392a3ef4fb5015327585e2a07ec67

Hi Chris,

when deploying to heroku I get the following error:

2018-11-05T20:24:11.935122+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gwfcm.herokuapp.com request_id=faaeeb99-5f62-4354-b05e-b5540d91f459 fwd="1.132.107.24" dyno= connect= service= status=503 bytes= protocol=http

Is this a sommon issue with jumpstart and heroku?

Ce795239ba5dd2384fc2f88ffaff5451

You'll have to view the Rails logs on Heroku, not the HTTP logs, to find the actual error.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 18,000+ developers who get early access to new screencasts, articles, guides, updates, and more.

By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

More of a social being? We're also on Twitter and YouTube.