Ruby on Rails Thursday, May 31, 2018



On Thursday, May 31, 2018 at 8:03:27 PM UTC-4, Walter Lee Davis wrote:
Read more about how the Asset Pipeline works here: http://guides.rubyonrails.org//asset_pipeline.html

TL;DR: If you add an import statement to your application.scss to bring your posts.scss file into that parent (or have an import tree or similar that auto-includes it) then the SCSS that you write in posts.scss becomes part of the one-and-only compiled/minified/magically available EVERYWHERE application.css that it compiles into. There is never any different CSS on any page in your entire application. All pages get the same CSS and JS through the Asset Pipeline unless you did something very non-standard.

If you aren't seeing the effect you are after, after making sure all of the above is accurate, then you may have to also consider that the CSS selector isn't correct, and the browser is ignoring it since it does not apply to the actual page when it renders to HTML.

Walter

> On May 31, 2018, at 7:45 PM, fugee ohu <fuge...@gmail.com> wrote:
>
> if i put my styling in application.scss it works but placing it in posts.scss has no effect on app/views/posts/index.html.erb
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1560ea4b-4a80-4552-9379-f5349c2c08e2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Wow you're right What a revelation Thanks Walter 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/29f391d7-5edb-4ece-a314-60a9cc5ecb11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

even though i'm using bootstrap-sass and sass-rails my app still looks for files ending in css and postpends css to whatever filename i give it

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2b65c4c6-1f6f-45b8-b679-79ec71a6986c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Read more about how the Asset Pipeline works here: http://guides.rubyonrails.org//asset_pipeline.html

TL;DR: If you add an import statement to your application.scss to bring your posts.scss file into that parent (or have an import tree or similar that auto-includes it) then the SCSS that you write in posts.scss becomes part of the one-and-only compiled/minified/magically available EVERYWHERE application.css that it compiles into. There is never any different CSS on any page in your entire application. All pages get the same CSS and JS through the Asset Pipeline unless you did something very non-standard.

If you aren't seeing the effect you are after, after making sure all of the above is accurate, then you may have to also consider that the CSS selector isn't correct, and the browser is ignoring it since it does not apply to the actual page when it renders to HTML.

Walter

> On May 31, 2018, at 7:45 PM, fugee ohu <fugee279@gmail.com> wrote:
>
> if i put my styling in application.scss it works but placing it in posts.scss has no effect on app/views/posts/index.html.erb
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1560ea4b-4a80-4552-9379-f5349c2c08e2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/EFED4BC9-4FD7-4F31-B24E-76B1358F7C87%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

if i put my styling in application.scss it works but placing it in posts.scss has no effect on app/views/posts/index.html.erb

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1560ea4b-4a80-4552-9379-f5349c2c08e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Wednesday, May 30, 2018



On Wednesday, May 30, 2018 at 11:56:34 AM UTC-4, Colin Law wrote:
On 30 May 2018 at 16:03, fugee ohu <fuge...@gmail.com> wrote:
controller by POST from form with inputs for 'subject' and 'message' (message is the body)
  def mail_to_confirmed_users0 @message=params[:message] subject=params[:subject] User.where("confirmed_at is not null").each do |user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: subject, message: @message).deliver_now end end
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end


And the full error message is?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I just needed to pass a sequence of arguments in the call to the mailer from  controller and match them with same sequence in parentheses next to my mailer action's definition If you know what I mean =D

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d2f0aa70-992e-45bd-9151-35839e2d235e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm trying to pass the user (recipient), message (body of message) and subject to my mailer from my controller like this:
  
    AdminGeneralMailer.mail_to_confirmed_users(user: user, message: @message, subject: @subject).deliver_now

And then my mailer action looks like this:

  def mail_to_confirmed_users(user, message, subject)
    @message=message
    mail(to: user.email, subject: subject)
  end

And @message will be used it the template but Action Controller reports for the mailer that it expected 3 arguments and was only given 1

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e57de7cd-3343-4ec1-acd1-c5c2016494c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Wednesday, May 30, 2018 at 11:56:34 AM UTC-4, Colin Law wrote:
On 30 May 2018 at 16:03, fugee ohu <fuge...@gmail.com> wrote:
controller by POST from form with inputs for 'subject' and 'message' (message is the body)
  def mail_to_confirmed_users0 @message=params[:message] subject=params[:subject] User.where("confirmed_at is not null").each do |user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: subject, message: @message).deliver_now end end
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end


And the full error message is?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ArgumentError in AdminController#mail_to_confirmed_users0
wrong number of arguments (given 1, expected 0)

Extracted source (around line #11):
9
10
11
12
13
14
              
  end

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]


Application Trace | Framework Trace | Full Trace
app/mailers/admin_general_mailer.rb:11:in `mail_to_confirmed_users'
app/controllers/admin_controller.rb:58:in `block in mail_to_confirmed_users0'
app/controllers/admin_controller.rb:57:in `mail_to_confirmed_users0'
Request

Parameters:

{"utf8"=>"✓", "authenticity_token"=>"cLixKnAczVvcETk/R+16X4VyiNM2oFOTlbst/k4gOzQLoX01g330NMUC3jAgMWHVAtCjog==", "subject"=>"123", "message"=>"456", "commit"=>"Submit"}
Toggle session dump
Toggle env dump
Response

Headers:

None

 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b7a1454f-828b-432f-955d-0a2351216d12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



On Wednesday, May 30, 2018 at 11:56:34 AM UTC-4, Colin Law wrote:
On 30 May 2018 at 16:03, fugee ohu <fuge...@gmail.com> wrote:
controller by POST from form with inputs for 'subject' and 'message' (message is the body)
  def mail_to_confirmed_users0 @message=params[:message] subject=params[:subject] User.where("confirmed_at is not null").each do |user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: subject, message: @message).deliver_now end end
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end


And the full error message is?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ArgumentError in AdminController#mail_to_confirmed_users0
wrong number of arguments (given 1, expected 0)

Extracted source (around line #11):
9
10
11
12
13
14
              
  end

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]

Rails.root: /home/fugee/data/websites/asianspaguide

Application Trace | Framework Trace | Full Trace
app/mailers/admin_general_mailer.rb:11:in `mail_to_confirmed_users'
app/controllers/admin_controller.rb:58:in `block in mail_to_confirmed_users0'
app/controllers/admin_controller.rb:57:in `mail_to_confirmed_users0'
Request

Parameters:

{"utf8"=>"✓", "authenticity_token"=>"cLixKnAczVvcETk/R+16X4VyiNM2oFOT+j2DjHKEog7pU1xklbst/k4gOzQLoX01g330NMUC3jAgMWHVAtCjog==", "subject"=>"123", "message"=>"456", "commit"=>"Submit"}
Toggle session dump
Toggle env dump
Response

Headers:

None

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/268ee9b7-6c02-435a-8cc9-0028fa131c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 30 May 2018 at 16:03, fugee ohu <fugee279@gmail.com> wrote:
controller by POST from form with inputs for 'subject' and 'message' (message is the body)
  def mail_to_confirmed_users0 @message=params[:message] subject=params[:subject] User.where("confirmed_at is not null").each do |user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: subject, message: @message).deliver_now end end
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end


And the full error message is?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtWVFLDdHYUHmWiJyF6L0A8Q3uK_gY67bcDxeJnSpwP6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

controller by POST from form with inputs for 'subject' and 'message' (message is the body)
  def mail_to_confirmed_users0 @message=params[:message] subject=params[:subject] User.where("confirmed_at is not null").each do |user| AdminGeneralMailer.mail_to_confirmed_users(user: user, subject: subject, message: @message).deliver_now end end
mailer:

  def mail_to_confirmed_users
    @user=params[:user]
    @subject=params[:subject]
    @message=params[:message]
    mail(to: @user.email, subject: @subject)
  end



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/46ab16a4-553f-4337-82a0-9dcd5a0ad307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Monday, May 28, 2018

Hello, I'm facing quite a strange issue with GCP (Google Cloud Platform) deployments.
I've recently updating my Ruby on Rails application to 5.2 (was 5.1.4 previously) and I started using the the encrypted credentials feature (which I believe is amazing, to be honest), but it looks like GCP is not that happy with it.

Here is the traceback that I receive.
Started cloud_sql_proxy.
D
, [2018-05-28T16:19:42.241746 #17] DEBUG -- : Cannot load `Rails.application.database_configuration`:
ActiveSupport::MessageEncryptor::InvalidMessage excluded from capture: DSN not set

rake aborted
!
ActiveSupport::MessageEncryptor::InvalidMessage: Cannot load `Rails.application.database_configuration`:
ActiveSupport::MessageEncryptor::InvalidMessage
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:183:in `
_decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `
decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `
config'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
(erb):25:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/configuration.rb:172:in `database_configuration'

/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:133:in `block (2 levels) in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `
instance_eval'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `
execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:43:in `block in on_load'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `
on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:132:in `block in <class:Railtie>'

/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `
run'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'

/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `
initialize!'
/app/config/environment.rb:5:in `<main>'

/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `
block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'

/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `
require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `
require'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `require_environment!'

/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/app/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `
block (2 levels) in define'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'

/rbenv/versions/2.3.7/bin/bundle:22:in `load'
/rbenv/versions/2.3.7/bin/bundle:22:in `<main>'

Caused by:
OpenSSL::Cipher::CipherError: key length too short
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:193:in `key='

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:193:in `_decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `
decrypt_and_verify'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `
read'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `
options'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'

(erb):25:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application/configuration.rb:172:in `
database_configuration'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:133:in `block (2 levels) in <class:Railtie>'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `
block in execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:43:in `
block in on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `each'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:42:in `on_load'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.0/lib/active_record/railtie.rb:132:in `
block in <class:Railtie>'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'

/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `
block in run_initializers'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'

/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
/app/config/environment.rb:5:in `<main>'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'

/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `
register'
/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'

/app/vendor/bundle/ruby/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `
block in require'
/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'

/app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:337:in `
require_environment!'
/app/vendor/bundle/ruby/2.3.0/gems/railties-5.2.0/lib/rails/application.rb:520:in `block in run_tasks_blocks'

/app/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/app/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `
<top (required)>'
/rbenv/versions/2.3.7/bin/bundle:22:in `load'

/rbenv/versions/2.3.7/bin/bundle:22:in `<main>'
Tasks: TOP => environment



The first error (DSN not set) is most likely coming from Sentry, although the DSN was added to the encrypted credentials file and Sentry if configured correctly.


 config
.dsn = Rails.application.credentials.dig(:sentry, :staging, :raven_dsn)



Second error (Cannot load `Rails.application.database_configuration`) makes me think that it's something related to database.yml, which works just fine in development and test environments.
default: &default
  adapter
: postgresql
  encoding
: unicode
  pool
: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout
: 5000

development
:
 
<<: *default
  database
: gcpfive_development

test
:
 
<<: *default
  database
: gcpfive_test

staging
:
 
<<: *default
  username
: <%= Rails.application.credentials.dig(:gcsql, :staging, :username) %>
  password
: <%= Rails.application.credentials.dig(:gcsql, :staging, :password) %>
  database
: <%= Rails.application.credentials.dig(:gcsql, :staging, :database) %>
  host
: <%= Rails.application.credentials.dig(:gcsql, :staging, :host) %>

The third error (OpenSSL::Cipher::CipherError: key length too short) makes me think that maybe the master key is not found during the deploy and  maybe that's why it also can't find the Sentry DSN?
Has anyone else encountered a similar issue?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/204e93bf-1ff8-4b4b-9123-50d6df4f53aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.