Ruby on Rails Thursday, March 26, 2020

It's the end of an era! Really enjoyed following these groups over the years but I'm certain it's a move for the better, migrating now! :)

On Thu, 26 Mar 2020 at 03:26, Blake LeBlanc <blake.leblanc1@gmail.com> wrote:

Thank you for the heads-up Sam!

 

-Blake

From: samsaffron
Sent: Wednesday, March 25, 2020 21:56
To: Ruby on Rails: Talk
Subject: [Rails] We are moving to https://discuss.rubyonrails.org/

 

Hi There,

 

The Rails team has decided to migrate all the talk, docs and core Google groups to  https://discuss.rubyonrails.org/.

 

Starting from can you post any talk discussion there. If you are having any trouble finding your bearings I will be watching closely and do my best to help out!

 

The theme used on the forum is open source and accepts contributions https://github.com/rails/discourse-rubyonrails-theme

 

See you on the forum! We will be locking this group shortly and migrating the final missing posts over to the new home.

 

Sam  

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8342f6e5-a0f7-42ed-aa03-c2711d4d5dae%40googlegroups.com.

 

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5e7c20b1.1c69fb81.f381c.2465%40mx.google.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAGN3KYwBMD1xP%2B_od25dPc8iXpmE7UMf3nRnyRK6Y-%3D7Ju_PHg%40mail.gmail.com.

Ruby on Rails Wednesday, March 25, 2020

Thank you for the heads-up Sam!

 

-Blake

From: samsaffron
Sent: Wednesday, March 25, 2020 21:56
To: Ruby on Rails: Talk
Subject: [Rails] We are moving to https://discuss.rubyonrails.org/

 

Hi There,

 

The Rails team has decided to migrate all the talk, docs and core Google groups to  https://discuss.rubyonrails.org/.

 

Starting from can you post any talk discussion there. If you are having any trouble finding your bearings I will be watching closely and do my best to help out!

 

The theme used on the forum is open source and accepts contributions https://github.com/rails/discourse-rubyonrails-theme

 

See you on the forum! We will be locking this group shortly and migrating the final missing posts over to the new home.

 

Sam  

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8342f6e5-a0f7-42ed-aa03-c2711d4d5dae%40googlegroups.com.

 

Ruby on Rails

Hi San,

You can still consume the forum 100% from your mailbox see:

https://discuss.rubyonrails.org/t/what-if-i-dont-want-to-visit-the-forum-and-only-want-to-participate-via-email/73915


On Thu, Mar 26, 2020 at 2:08 PM San Ji <sarun101@gmail.com> wrote:
>
> A little bit sad.
>
> The only reason I am still reading this forum is because I can read it in my email inbox.
>
> IMO, the new forum is easy for people asking something; but for people answering, there is no reason to keep checking the forum regularly.
>
> Goodbye, then
> And thank you for the good works
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/QzmdDH_STlk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/664e915a-dade-4af2-9d5b-811820c732d8%40googlegroups.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAAtdryNti%3D1QbFtZWqnMghL7uKR_mdm88DADnX6iKAkQwkFY4g%40mail.gmail.com.

Ruby on Rails

A little bit sad.

The only reason I am still reading this forum is because I can read it in my email inbox.

IMO, the new forum is easy for people asking something; but for people answering, there is no reason to keep checking the forum regularly.

Goodbye, then
And thank you for the good works

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/664e915a-dade-4af2-9d5b-811820c732d8%40googlegroups.com.

Ruby on Rails

Hi There,

The Rails team has decided to migrate all the talk, docs and core Google groups to  https://discuss.rubyonrails.org/.

Starting from can you post any talk discussion there. If you are having any trouble finding your bearings I will be watching closely and do my best to help out!

The theme used on the forum is open source and accepts contributions https://github.com/rails/discourse-rubyonrails-theme

See you on the forum! We will be locking this group shortly and migrating the final missing posts over to the new home.

Sam  

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8342f6e5-a0f7-42ed-aa03-c2711d4d5dae%40googlegroups.com.

Ruby on Rails Tuesday, March 24, 2020

A while ago I listened to an interview with DHH where he outlined the advantages of using new controllers rather than creating custom actions in existing controllers.

I have been trying this approach, and like the way it improves organisation and simplifies routes and also encourages scoping/namespacing to group resources.

The one thing I have found not too neat is the handling of errors between resources.  In particular, if I need to use partials from the original resouce (eg to resend the show action), the pathname for the partials are wrong since they try to prefix with the alternative controller name.  This can be overcome by using absolute paths for partial names.  But this tends towards cluttered and brittle code.

Mostly I get over this by using ajax which allows me to render nothng inline and just re-display the partial that displays error messages.   However, I have a products template that includes a form for uploading images.  I was doing a rewrite in this area and tried moving the create_image method out of products controller and into an images controller/resource.

But since the multipart form cannot be remoted, I am stuck with an html request.  To display an error message from this action now forces me to either redirect (which will reset the page to its initial show state) or use absolute pathnames for the partials in the products#show so I can call products#show from images#create.  (there are quite a few partials involved)

It occurred to me that this may have been addressed, or that there may be a workaround to override the default partial pathname. 

I have tried googling and not come up with very much that helps - I cant really think of a succinct phrase to google.

Does anyone have any ideas or suggestions (or am I missing something).

Tonypm


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1fa26762-956f-4971-af12-ef9ad9d3ee5c%40googlegroups.com.

Ruby on Rails Monday, March 23, 2020

Hello,
I think you misconfigure the database.
There is no database username named root.

Please check the database.yml file. 

Thank you

On Mon, Mar 23, 2020, 9:57 PM Walter Lee Davis <waltd@wdstudio.com> wrote:
It appears that you have configured a database, but that database isn't running correctly, or doesn't have a user named "root". That name is commonly used in a default MySQL install. If you're using a different database engine, then the default user may be named differently. That's where I would start looking. The answer will be very specific to your own server.

Walter

> On Mar 23, 2020, at 11:11 AM, Thouba Nahakpam <samsungmeitei@gmail.com> wrote:
>
> Hello,
> When I try to access localhost:3000, it shows ActiveRecord::NoDatabaseError. Can anybody tell me how to fix it? I have attached a screenshot of it below.
> Thanks.
>
> <RAD.JPG>
>
>
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/980a2a38-5cf3-4b4d-9e39-582e47604538%40googlegroups.com.
> <RAD.JPG>

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/55386CC9-BBEB-407B-97F7-4AC0B0598CE0%40wdstudio.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CANoOQ2SXoeiO7i5uOK%2BfAuhxMemZCC_eNQLh1%2BPUEPYoSGhZQQ%40mail.gmail.com.

Ruby on Rails

Hello all,

I have a comment about rails logger and I wish to change its behaviour.

Rails tries to load the logger from config like this:

Rails.logger ||= config.logger || begin
   
logger = ActiveSupport::Logger.new(config.default_log_file)
   
....
end

https://github.com/rails/rails/blob/fa986ae0cac423bf1ebcb5caeccbecf00c990094/railties/lib/rails/application/bootstrap.rb#L36

Then later after the above block, it sets the logger level:

Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)

https://github.com/rails/rails/blob/fa986ae0cac423bf1ebcb5caeccbecf00c990094/railties/lib/rails/application/bootstrap.rb#L53


The problem is that this overwrites the level that is set in the config.logger. In normal cases, it is no problem. But when different logging classes are embedded
and they depend on the log level, this makes a problem since the final value of the logger will be different from the value set in the config.logger.

Moreover, it is more intuitive to expect the logging level set on the object provided rather than config.log_level.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f21e6963-3ada-40a6-844d-19fb15172f4e%40googlegroups.com.

Ruby on Rails

It appears that you have configured a database, but that database isn't running correctly, or doesn't have a user named "root". That name is commonly used in a default MySQL install. If you're using a different database engine, then the default user may be named differently. That's where I would start looking. The answer will be very specific to your own server.

Walter

> On Mar 23, 2020, at 11:11 AM, Thouba Nahakpam <samsungmeitei@gmail.com> wrote:
>
> Hello,
> When I try to access localhost:3000, it shows ActiveRecord::NoDatabaseError. Can anybody tell me how to fix it? I have attached a screenshot of it below.
> Thanks.
>
> <RAD.JPG>
>
>
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/980a2a38-5cf3-4b4d-9e39-582e47604538%40googlegroups.com.
> <RAD.JPG>

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/55386CC9-BBEB-407B-97F7-4AC0B0598CE0%40wdstudio.com.

Ruby on Rails

Hello,
When I try to access localhost:3000, it shows ActiveRecord::NoDatabaseError. Can anybody tell me how to fix it? I have attached a screenshot of it below.
Thanks.

RAD.JPG


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/980a2a38-5cf3-4b4d-9e39-582e47604538%40googlegroups.com.

Ruby on Rails Sunday, March 22, 2020

i have user has_many press_releases and also user has_many artists and also artists have_many tours and also artists have_many press_releases Now I wanna create a tour and then a press_release for the tour The tour is made up of tour_dates, just in case you're wondering Complicating things is that user has_many press_releases as: :poster so that means all models in the chain of has_many_through need to include poster_type and poster_id I'm not sure where to use associations I'm tempted to bypass them and just use PressRelease.create(... or PressRelease.find_or_create_by(... in a controller regardless of the associations Should I use nested forms all the way to create press_releases or the direct Model.create method

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7ffe6c8f-0346-4424-9ecd-5d52fa298185%40googlegroups.com.

Ruby on Rails Saturday, March 21, 2020

One thing you can do is use a gem like byebug, put a breakpoint above the code you want to find it's location and use this:

method(:name_of_method).source_location

if you put a breakpoint inside your routes.rb and call:

method(:get).source_location

it returns something like:

...../gems/actionpack-6.0.2.2/lib/action_dispatch/routing/mapper.rb, 711

Than you can check the source on github


It doesn't always work, you can have methods generated on the fly using define_method for example I'm not sure source_location gives you the right source there.

El sáb., 21 mar. 2020 a las 17:36, Ilya Makedon (<engineer.plusplus@gmail.com>) escribió:
San Ji, thank for your answer.  But how does Ruby runtime know which function to call?  There must be a way for human to mimic that...  Right?

On Sat, Mar 21, 2020 at 10:35 AM San Ji <sarun101@gmail.com> wrote:
To my knowledge, what you are looking for is not possible for Ruby.

What you got in RubyMine is the closest, basically it index all words and apply some language heuristics to scope down choices. This is good enough in most cases.

Systematic way to do it is impossible because Ruby supports metaprogramming.
Take ActiveRecord as an example, you got attribute-related methods that defines in databases, not even in Ruby code. If you connect to different databases, the method definitions will be different. Nothing can even point that out (represent that) properly, at least not with user interface of an IDE.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63fd8953-f3a8-47a9-a931-17dd2eb3cce4%40googlegroups.com.


--
--------------------------
- Ilya Makedon

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAOJppg6O0txtYvKgXzEVaeNqM_%3D5Czofe-4vQZZCi-uYHFTaBA%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcBXi0BiPo%2BkB7nT8QdNP2orFYcg0oM95pQBDYodyUtQpA%40mail.gmail.com.

Ruby on Rails

San Ji, thank for your answer.  But how does Ruby runtime know which function to call?  There must be a way for human to mimic that...  Right?

On Sat, Mar 21, 2020 at 10:35 AM San Ji <sarun101@gmail.com> wrote:
To my knowledge, what you are looking for is not possible for Ruby.

What you got in RubyMine is the closest, basically it index all words and apply some language heuristics to scope down choices. This is good enough in most cases.

Systematic way to do it is impossible because Ruby supports metaprogramming.
Take ActiveRecord as an example, you got attribute-related methods that defines in databases, not even in Ruby code. If you connect to different databases, the method definitions will be different. Nothing can even point that out (represent that) properly, at least not with user interface of an IDE.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63fd8953-f3a8-47a9-a931-17dd2eb3cce4%40googlegroups.com.


--
--------------------------
- Ilya Makedon

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAOJppg6O0txtYvKgXzEVaeNqM_%3D5Czofe-4vQZZCi-uYHFTaBA%40mail.gmail.com.

Ruby on Rails

To my knowledge, what you are looking for is not possible for Ruby.

What you got in RubyMine is the closest, basically it index all words and apply some language heuristics to scope down choices. This is good enough in most cases.

Systematic way to do it is impossible because Ruby supports metaprogramming.
Take ActiveRecord as an example, you got attribute-related methods that defines in databases, not even in Ruby code. If you connect to different databases, the method definitions will be different. Nothing can even point that out (represent that) properly, at least not with user interface of an IDE.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/63fd8953-f3a8-47a9-a931-17dd2eb3cce4%40googlegroups.com.

Ruby on Rails

How does one figure out where a definition of a function is given its call in Ruby on Rails code?  For example, let's suppose, I didn't know what config/routes.rb is for.  And I was looking at it and wanted to know what the function get does.  It's not defined in routes.rb itself.  There are no includes, requires or inheritance.  How would one know what functions named get are available in that scope and which one of them would be called at runtime?  I'm looking for a systematic way applicable to an arbitrary file in a Rails project calling arbitrary function that could be part of Rails or dependency gem.

When I tried 'Go To Definition' of the get in RubyMines, it popped up a list of about 100 options of what i could be.  Is there an IDE that's better at this than RubyMine?

As for me, I can't even come up with a search terms to get something resembling an answer on google.  That's why I humbly request your help.  thanks.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c6554db8-38f2-4782-8921-f9ecfdf18632%40googlegroups.com.

Ruby on Rails Friday, March 20, 2020

Thank you Ariel, I'll look into it! Because right now I'm running each source_type query individually then concat-ing the results into a single array. Gets the job done, but it'd be nice to tackle it all in one fell swoop.

On Thursday, March 19, 2020 at 5:20:33 PM UTC-5, Ariel Juodziukynas wrote:
I'm not sure if you can have all that with a single AR query, I think you need a custom query (I would use a UNION query an I think AR doesn't support that)

El jue., 19 mar. 2020 a las 13:25, Blake LeBlanc (<blake....@gmail.com>) escribió:
When dealing with polymorphic associations, is it possible to have a has_many through query that pulls in ALL available source_types?

My understanding so far is that each source type needs its own query method, as I show here in the Image model

**image.rb**
```
has_many :image_tags
has_many :tags, through: :image_tags, source: :taggable, source_type: 'Tag'
has_many :people, through: :image_tags, source: :taggable, source_type: 'Person'
has_many :businesses, through: :image_tags, source: :taggable, source_type: 'Business'
...
```

**tag.rb**
```
has_many :image_tags, as: :taggable
has_many :images, through: :image_tags
```

**image_tag.rb**

```
belongs_to :image
belongs_to :taggable, polymorphic: true

def build_taggable(params)
  self.taggable = taggable_type.constantize.new(params)
end
```

What I'd like to be able to do, however, is create one query method that pulls in all associated records regardless of what source_type they might belong to.

Just thinking out loud, would that likely involve creating some sort of raw SQL join that acts directly on the ImageTags table? Or is there a more Railsy/ActiveRecordy way of approaching it? 

Thank you in advance for any help or insights!
-Blake

--
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 rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c537e34b-2d49-4e30-a197-2668fb773f99%40googlegroups.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bfc6e653-b594-411f-91c6-676b7dc4f9e9%40googlegroups.com.

Ruby on Rails

uh, i didnt know they had open sourced parts of it. was looking at  https://www.twilio.com/video/pricing
and thats usually just a bummer...

thx though!


On Fri, Mar 20, 2020 at 8:38 AM Walter Lee Davis <waltd@wdstudio.com> wrote:
I meant, specifically, their new open-source video offering. They have a bunch of quick-start code that you can use to build a whole custom videoconferencing rig. I haven't dug into it in depth, but Twilio usually do a very thorough job of documenting (and writing) their applications.

Walter

> On Mar 19, 2020, at 9:59 PM, tom <tomabroad@gmail.com> wrote:
>
> yes thank you, used them for sms...
>
>
>
> On Thu, Mar 19, 2020, 5:18 PM Walter Lee Davis <waltd@wdstudio.com> wrote:
> Have you looked at this yet? https://www.twilio.com/docs/video
>
> Walter
>
> > On Mar 19, 2020, at 5:00 PM, tom <tomabroad@gmail.com> wrote:
> >
> > hi,
> >
> > i have just finished a webrtc chat via action cable, but before spending even more time on it trying to get video on as well, i was wondering if anyone can share any 'tips' or guides.
> >
> > thank you all in advance
> >
> >
> > --
> > 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMdTHiBGBC86ztTr79JnV_qEdLAn%2BPMJ%3Dyx1H%2Bm%3Drs2HMA%40mail.gmail.com.
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73986EB7-E20F-4162-B087-580EB3DA2481%40wdstudio.com.
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMfLhswbc_HWDGGXBFZQAeiYZeGgj7wN-CgeKF0dxcR-%3DA%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/E47AF41E-F381-4050-824D-427AC7E9ADFB%40wdstudio.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMcNxBR03WR9E4PaeiymL4M2_D-%3D3FzSVgHKbsCewQxohw%40mail.gmail.com.

Ruby on Rails

I meant, specifically, their new open-source video offering. They have a bunch of quick-start code that you can use to build a whole custom videoconferencing rig. I haven't dug into it in depth, but Twilio usually do a very thorough job of documenting (and writing) their applications.

Walter

> On Mar 19, 2020, at 9:59 PM, tom <tomabroad@gmail.com> wrote:
>
> yes thank you, used them for sms...
>
>
>
> On Thu, Mar 19, 2020, 5:18 PM Walter Lee Davis <waltd@wdstudio.com> wrote:
> Have you looked at this yet? https://www.twilio.com/docs/video
>
> Walter
>
> > On Mar 19, 2020, at 5:00 PM, tom <tomabroad@gmail.com> wrote:
> >
> > hi,
> >
> > i have just finished a webrtc chat via action cable, but before spending even more time on it trying to get video on as well, i was wondering if anyone can share any 'tips' or guides.
> >
> > thank you all in advance
> >
> >
> > --
> > 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMdTHiBGBC86ztTr79JnV_qEdLAn%2BPMJ%3Dyx1H%2Bm%3Drs2HMA%40mail.gmail.com.
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73986EB7-E20F-4162-B087-580EB3DA2481%40wdstudio.com.
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMfLhswbc_HWDGGXBFZQAeiYZeGgj7wN-CgeKF0dxcR-%3DA%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/E47AF41E-F381-4050-824D-427AC7E9ADFB%40wdstudio.com.

Ruby on Rails Thursday, March 19, 2020

yes thank you, used them for sms...



On Thu, Mar 19, 2020, 5:18 PM Walter Lee Davis <waltd@wdstudio.com> wrote:
Have you looked at this yet? https://www.twilio.com/docs/video

Walter

> On Mar 19, 2020, at 5:00 PM, tom <tomabroad@gmail.com> wrote:
>
> hi,
>
> i have just finished a webrtc chat via action cable, but before spending even more time on it trying to get video on as well, i was wondering if anyone can share any 'tips' or guides.
>
> thank you all in advance
>
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMdTHiBGBC86ztTr79JnV_qEdLAn%2BPMJ%3Dyx1H%2Bm%3Drs2HMA%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73986EB7-E20F-4162-B087-580EB3DA2481%40wdstudio.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMfLhswbc_HWDGGXBFZQAeiYZeGgj7wN-CgeKF0dxcR-%3DA%40mail.gmail.com.

Ruby on Rails

I'm not sure if you can have all that with a single AR query, I think you need a custom query (I would use a UNION query an I think AR doesn't support that)

El jue., 19 mar. 2020 a las 13:25, Blake LeBlanc (<blake.leblanc1@gmail.com>) escribió:
When dealing with polymorphic associations, is it possible to have a has_many through query that pulls in ALL available source_types?

My understanding so far is that each source type needs its own query method, as I show here in the Image model

**image.rb**
```
has_many :image_tags
has_many :tags, through: :image_tags, source: :taggable, source_type: 'Tag'
has_many :people, through: :image_tags, source: :taggable, source_type: 'Person'
has_many :businesses, through: :image_tags, source: :taggable, source_type: 'Business'
...
```

**tag.rb**
```
has_many :image_tags, as: :taggable
has_many :images, through: :image_tags
```

**image_tag.rb**

```
belongs_to :image
belongs_to :taggable, polymorphic: true

def build_taggable(params)
  self.taggable = taggable_type.constantize.new(params)
end
```

What I'd like to be able to do, however, is create one query method that pulls in all associated records regardless of what source_type they might belong to.

Just thinking out loud, would that likely involve creating some sort of raw SQL join that acts directly on the ImageTags table? Or is there a more Railsy/ActiveRecordy way of approaching it? 

Thank you in advance for any help or insights!
-Blake

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c537e34b-2d49-4e30-a197-2668fb773f99%40googlegroups.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcBnGfBU4xB_yc%3DBdKG8zEpZ-UKKwi2td68qYgkLPP-xhw%40mail.gmail.com.

Ruby on Rails

Have you looked at this yet? https://www.twilio.com/docs/video

Walter

> On Mar 19, 2020, at 5:00 PM, tom <tomabroad@gmail.com> wrote:
>
> hi,
>
> i have just finished a webrtc chat via action cable, but before spending even more time on it trying to get video on as well, i was wondering if anyone can share any 'tips' or guides.
>
> thank you all in advance
>
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMdTHiBGBC86ztTr79JnV_qEdLAn%2BPMJ%3Dyx1H%2Bm%3Drs2HMA%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73986EB7-E20F-4162-B087-580EB3DA2481%40wdstudio.com.

Ruby on Rails

hi,

i have just finished a webrtc chat via action cable, but before spending even more time on it trying to get video on as well, i was wondering if anyone can share any 'tips' or guides.

thank you all in advance

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMdTHiBGBC86ztTr79JnV_qEdLAn%2BPMJ%3Dyx1H%2Bm%3Drs2HMA%40mail.gmail.com.

Ruby on Rails

When dealing with polymorphic associations, is it possible to have a has_many through query that pulls in ALL available source_types?

My understanding so far is that each source type needs its own query method, as I show here in the Image model

**image.rb**
```
has_many :image_tags
has_many :tags, through: :image_tags, source: :taggable, source_type: 'Tag'
has_many :people, through: :image_tags, source: :taggable, source_type: 'Person'
has_many :businesses, through: :image_tags, source: :taggable, source_type: 'Business'
...
```

**tag.rb**
```
has_many :image_tags, as: :taggable
has_many :images, through: :image_tags
```

**image_tag.rb**

```
belongs_to :image
belongs_to :taggable, polymorphic: true

def build_taggable(params)
  self.taggable = taggable_type.constantize.new(params)
end
```

What I'd like to be able to do, however, is create one query method that pulls in all associated records regardless of what source_type they might belong to.

Just thinking out loud, would that likely involve creating some sort of raw SQL join that acts directly on the ImageTags table? Or is there a more Railsy/ActiveRecordy way of approaching it? 

Thank you in advance for any help or insights!
-Blake

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c537e34b-2d49-4e30-a197-2668fb773f99%40googlegroups.com.

Ruby on Rails Tuesday, March 17, 2020

How do I make a post request to an unassociated model from the view of another model

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ef64b815-1b98-47cc-a6e9-47dfb9862c13%40googlegroups.com.

Ruby on Rails Monday, March 16, 2020

The app in question is at https://github.com/jhsu802701/railn-20200316-215223-398 .  Note that config/environments/development.rb is configured for MailCatcher.

I've been able to use MailCatcher without docker-compose, but I can't quite figure out how to get it to work in a Rails app that revolves around docker-compose.

One solution I tried is to add the 1080:1080 port assignments to the web section of docker-compose.yml, but the MailCatcher interface doesn't appear at http://localhost:1080/.

Another solution I've tried is to add a mailcatcher section under services to make use of a Docker image dedicated to MailCatcher.  While the MailCatcher interface does appear, the email messages I expect when I try to sign up in my local setup do not materialize.

Exactly what am I missing?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d32f3288-b923-4aa5-8360-db8288b69d1e%40googlegroups.com.

Ruby on Rails Sunday, March 15, 2020

PlantVillage https://plantvillage.psu.edu/ is an emergency relief tool for poor farmers across the world facing the threat of climate change and pests. It is run out of Penn State University and is an official tool of the United Nations Food and Agricultural Organisation.  Our back end ruby platform connects to apps we developed and deployed across 66 countries in 29 languages. As a non-profit we have had little money todate  so outsourced development to a team in India. But this has created significant technical debt. 

We now need an experienced, very capable ruby engineer to work as a consultant. Ideally +/- 3 hrs EST. You would work would an Android developer and two engineers at Penn State and the Indian Team which we still engage. 

You would be entering a project that is rapidly building a tool immediately required to combat locusts plagues from Kenya to Pakistan and multiple other issues. These pests threaten the supply of 19 million people immediately. So,  we have a dual need: build tools needed immediately as well as repair the technical debt 

This would be a consultancy gig initially but could be transitioned to a paid position at Penn State (after a job is created). As a University, we have excellent benefits


Please email dhughes@psu.edu with your cv please and cover letter  and consultancy rate.

This is a chance to work on a globally important issue affecting hundreds of millions of extremely poor farmers around the world 

thanks

david 


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/64c7d07a-2e0e-457b-8593-b00be8d4ba2f%40googlegroups.com.

Ruby on Rails

I also recommend running at least the DB in Docker. That should prevent most fiddling if your Mac OS changes. I use Docker for as much as I can. It ends up making things easier once you get up to speed with Docker. 

Furthermore, I just use an ubuntu virtual machine running in VirtualBox. That way did doesn't matter if you are using a Mac or Windows. The docker setup is constant in the ubuntu VM. I use Cyberduck/Filezilla/WinSCP to visualize the files and edit them locally with one click on the Mac or Windows machine.


On Saturday, March 14, 2020 at 3:45:10 PM UTC-4, San Ji wrote:
No, it isn't.
If you notice only those 2 downside, you'd better stick with you current choice.
MySQL 8 has better encoding support, I am assuming you're mentioning about emoji encodings.
And you can also learn Docker for ease of development to address the other issue you have.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bf2ae0db-db5c-4c08-b10f-b7f49638f444%40googlegroups.com.

Ruby on Rails Saturday, March 14, 2020

You may want to check the Rails+Ruby version of your host then. It's possible that you're using a newer version of Ruby and your codebase requires an older version. (Due to the deprecated warning)


Best regards
+94.765464998



On Sun, Mar 15, 2020 at 8:47 AM Philip Rhoades <phil@pricom.com.au> wrote:
Hassan,


On 2020-03-15 11:31, Hassan Schroeder wrote:
> On Sat, Mar 14, 2020 at 3:52 PM Philip Rhoades <phil@pricom.com.au>
> wrote:
>
>> Docker crashed and I lost the Rails container so I have to go back to
>> the original source.
>
> I don't know what "lost the Rails container" means. Can't you just
> rerun the Dockerfile?


No.


>> Could someone suggest how I could fix the problem seen below? - I
>> deleted the Gemfile.lock file first.
>
> Why?


Because leaving the original lock file there caused "bundle install
--path vendor/bundle" to fail with:

Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

     current directory:
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3/ext/json/ext/generator
/usr/bin/ruby -I /usr/share/rubygems -r
./siteconf20200315-119213-1sg3qup.rb extconf.rb
creating Makefile

current directory:
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
rm -f
rm -f generator.so  *.o  *.bak mkmf.log .*.time

current directory:
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.
-DJSON_GENERATOR    -fPIC -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fPIC -m64 -o generator.o -c
generator.c
generator.c: In function 'generate_json':
generator.c:861:25: error: 'rb_cFixnum' undeclared (first use in this
function); did you mean 'mFixnum'?
   861 |     } else if (klass == rb_cFixnum) {
       |                         ^~~~~~~~~~
       |                         mFixnum
generator.c:861:25: note: each undeclared identifier is reported only
once for each function it appears in
generator.c:863:25: error: 'rb_cBignum' undeclared (first use in this
function); did you mean 'mBignum'?
   863 |     } else if (klass == rb_cBignum) {
       |                         ^~~~~~~~~~
       |                         mBignum
make: *** [Makefile:245: generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3
for inspection.
Results logged to
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-1.8.3/gem_make.out

An error occurred while installing json (1.8.3), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.3' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
   rails was resolved to 4.1.5, which depends on
     actionmailer was resolved to 4.1.5, which depends on
       actionpack was resolved to 4.1.5, which depends on
         actionview was resolved to 4.1.5, which depends on
           activesupport was resolved to 4.1.5, which depends on
             json


>> $ ./bin/rails s
>> /home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/object/duplicable.rb:82:
>> warning: BigDecimal.new is deprecated; use BigDecimal() method
>> instead.
>> => Booting Puma
>> => Rails 4.1.5 application starting in development on
>
> Did you originally develop this Rails 4.1.5 app using Ruby 2.6.0? Or
> I guess more exactly have you been running it on that Ruby version
> successfully?


I can't remember what version of Ruby it was - it was from earlier than
2015 . . it was running on whatever version of Ruby that was in the
container - which is gone because the whole docker setup was corrupted .
. I may have backups on old hard disks but it would take too long to try
and re-create old OS environment, Docker version etc so I thought the
best thing to do was just the Rails app running directly on my current
machine (Linux Fedora 31).

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  phil@pricom.com.au

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/86d95cffebf21738357c0028368ec698%40lev.com.au.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CANgbjyf-J-z2q46pRMbU-od6fqG23YrFkn66hN1q3FFLa3eyuA%40mail.gmail.com.

Ruby on Rails

Hassan,


On 2020-03-15 11:31, Hassan Schroeder wrote:
> On Sat, Mar 14, 2020 at 3:52 PM Philip Rhoades <phil@pricom.com.au>
> wrote:
>
>> Docker crashed and I lost the Rails container so I have to go back to
>> the original source.
>
> I don't know what "lost the Rails container" means. Can't you just
> rerun the Dockerfile?


No.


>> Could someone suggest how I could fix the problem seen below? - I
>> deleted the Gemfile.lock file first.
>
> Why?


Because leaving the original lock file there caused "bundle install
--path vendor/bundle" to fail with:

Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3/ext/json/ext/generator
/usr/bin/ruby -I /usr/share/rubygems -r
./siteconf20200315-119213-1sg3qup.rb extconf.rb
creating Makefile

current directory:
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
rm -f
rm -f generator.so *.o *.bak mkmf.log .*.time

current directory:
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.
-DJSON_GENERATOR -fPIC -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fPIC -m64 -o generator.o -c
generator.c
generator.c: In function 'generate_json':
generator.c:861:25: error: 'rb_cFixnum' undeclared (first use in this
function); did you mean 'mFixnum'?
861 | } else if (klass == rb_cFixnum) {
| ^~~~~~~~~~
| mFixnum
generator.c:861:25: note: each undeclared identifier is reported only
once for each function it appears in
generator.c:863:25: error: 'rb_cBignum' undeclared (first use in this
function); did you mean 'mBignum'?
863 | } else if (klass == rb_cBignum) {
| ^~~~~~~~~~
| mBignum
make: *** [Makefile:245: generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/json-1.8.3
for inspection.
Results logged to
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-1.8.3/gem_make.out

An error occurred while installing json (1.8.3), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.3' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
rails was resolved to 4.1.5, which depends on
actionmailer was resolved to 4.1.5, which depends on
actionpack was resolved to 4.1.5, which depends on
actionview was resolved to 4.1.5, which depends on
activesupport was resolved to 4.1.5, which depends on
json


>> $ ./bin/rails s
>> /home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/object/duplicable.rb:82:
>> warning: BigDecimal.new is deprecated; use BigDecimal() method
>> instead.
>> => Booting Puma
>> => Rails 4.1.5 application starting in development on
>
> Did you originally develop this Rails 4.1.5 app using Ruby 2.6.0? Or
> I guess more exactly have you been running it on that Ruby version
> successfully?


I can't remember what version of Ruby it was - it was from earlier than
2015 . . it was running on whatever version of Ruby that was in the
container - which is gone because the whole docker setup was corrupted .
. I may have backups on old hard disks but it would take too long to try
and re-create old OS environment, Docker version etc so I thought the
best thing to do was just the Rails app running directly on my current
machine (Linux Fedora 31).

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/86d95cffebf21738357c0028368ec698%40lev.com.au.

Ruby on Rails

On Sat, Mar 14, 2020 at 3:52 PM Philip Rhoades <phil@pricom.com.au> wrote:

> Docker crashed and I lost the Rails container so I have to go back to
> the original source.

I don't know what "lost the Rails container" means. Can't you just
rerun the Dockerfile?

> Could someone suggest how I could fix the problem seen below? - I
> deleted the Gemfile.lock file first.

Why?

> $ ./bin/rails s
> /home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/object/duplicable.rb:82:
> warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
> => Booting Puma
> => Rails 4.1.5 application starting in development on

Did you originally develop this Rails 4.1.5 app using Ruby 2.6.0? Or
I guess more exactly have you been running it on that Ruby version
successfully?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCiYMuRZY4xf2SuWLkQCt87eMetgHjsNXKGdX%2BWAGkfkg%40mail.gmail.com.

Ruby on Rails

People,

Docker crashed and I lost the Rails container so I have to go back to
the original source.

Could someone suggest how I could fix the problem seen below? - I
deleted the Gemfile.lock file first.

Thanks,

Phil.

$ bundle install --path vendor/bundle
.
.
Bundle complete! 15 Gemfile dependencies, 54 gems now installed.
Bundled gems are installed into `./vendor/bundle`

$ ./bin/rails s
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/object/duplicable.rb:82:
warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
=> Booting Puma
=> Rails 4.1.5 application starting in development on
http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider
using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:121:
warning: constant ::Fixnum is deprecated
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:121:
warning: constant ::Bignum is deprecated
Exiting
Traceback (most recent call last):
6734: from ./bin/rails:5:in `<main>'
6733: from ./bin/rails:5:in `require'
6732: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/railties-4.1.5/lib/rails/commands.rb:17:in
`<top (required)>'
6731: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in
`run_command!'
6730: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in
`server'
6729: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in
`tap'
6728: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:81:in
`block in server'
6727: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/railties-4.1.5/lib/rails/commands/server.rb:67:in
`start'
... 6722 levels...
4: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:131:in
`block (2 levels) in <class:Numeric>'
3: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:131:in
`block (2 levels) in <class:Numeric>'
2: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:131:in
`block (2 levels) in <class:Numeric>'
1: from
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:131:in
`block (2 levels) in <class:Numeric>'
/home/phr/src/ruby/rails/domain-sf/vendor/bundle/ruby/2.6.0/gems/activesupport-4.1.5/lib/active_support/core_ext/numeric/conversions.rb:131:in
`block (2 levels) in <class:Numeric>': stack level too deep
(SystemStackError)

--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f989a2fb7edae3a2c7fa6cd86675ec91%40pricom.com.au.

Ruby on Rails

No, it isn't.
If you notice only those 2 downside, you'd better stick with you current choice.
MySQL 8 has better encoding support, I am assuming you're mentioning about emoji encodings.
And you can also learn Docker for ease of development to address the other issue you have.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c2e76d0c-7fe5-43b3-98c0-57886a498c7c%40googlegroups.com.

Ruby on Rails

Sorry, using different db on different environment is not something I'm recommending, it was just to point out that the transition should be really easy. I do think it's faster to prototype using sqlite as long as it fits the needs, but in a more mature projects I would use the same db everywhere so I can use all the features I need.

I didn't have that many projects with postgres to talk about upgrading versions and those things, but personally I never had issues with MySQL either.

About encodings and collations, I guess it depends on the error but if you have encoding or collation errors I guess the problem is the configuration of your tables and the input and not the actual db, you may encounter problems with any db if you try to handle incompatible encodings at the same time.

I've used PgAdmin, but didn't try others to compare or recommend anything.

One more thing you can do if you don't want to struggle with updates, version, etc, is to use docker maybe, you just run the image on any system and you can replicate the actual production environment anywhere.

El sáb., 14 mar. 2020 a las 14:07, Walter Lee Davis (<waltd@wdstudio.com>) escribió:


> On Mar 14, 2020, at 12:17 PM, Rob Jonson <rob@hobbyistsoftware.com> wrote:
>
> thanks folks,
>
> I guess I'm asking more about the practical pain points. - As you say, I trust rails to deal with most of the day-to-day.
>
> do you end up battling to get your postgres install working after upgrading mac (or postgres?)

You can install Postgres as a user-space application (with an icon and everything), so this can be a non-issue.

> do you have problems with string encoding incompatibilities in obscure email addresses?

If it doesn't fit into UTF-8, then you may have a problem. Do you have a problem now, in MySQL? What encoding and charset are you using now?

> do you have a convenient gui for browsing (like SequelPro)

TablePlus is pretty nice.

> are there other similar annoyances, or does it 'just work'

Like another commenter posted, I have used it on Heroku with SQLite on the dev side, and no issues.

>
> whatever I use, I like to stick with the same db in dev & production, ( using mysql or sqlite for my tests and postgres on the server seems like it is asking for trouble)

It could be a problem, or it could be a sign that you are depending on a database feature to hide a bug. At work, we use SQLite for testing (including the CI stuff on GitLab) and Oracle on the production server. We try for 100% test coverage.

Walter

>
> cheers,
>
> Rob
>
>
>
>
> On Sat, 14 Mar 2020 at 15:17, Phil Edelbrock <edelbrp@gmail.com> wrote:
>
> I think Ariel's reply is spot-on.  Rails is basically DB agnostic, however I think the trend is that PostgreSQL is the more favored backend (except for stuff like Wordpress).  We're doing a lot more SQL procedural stuff these days with our rails apps (e.g. kicking out JSON from a single query can be literally 1,000x times faster in cases vs. asking Rails to query a model and format the same thing).  I find PostgreSQL a lot easier to admin as well, but to each their own.
>
> Good luck!
>
>
> Phil
>
>
>> On Mar 14, 2020, at 7:37 AM, Ariel Juodziukynas <arieljuod@gmail.com> wrote:
>>
>> Usually ActiveRecord takes care of most of the differences, and postresql has a lot of similarities with mysql. I guess it would be a different call if you ask about learning a completely different db engine like mongo or graphql, but learning postgresql shouldn't take too much time knowing MySQL, at least to be proficient. I even have a project that I used sqlite to prototype and postresql when deploying it to heroku for tests and I had to do nothing to make it work on both databases thanks to AR.
>>
>> Also, heroku prefers postrgres for example and heroku is really popular for rails hosting.
>>
>> El sáb., 14 mar. 2020 a las 10:58, Rob Jonson (<rob.jonson@gmail.com>) escribió:
>> Hi Folks,
>>
>> I have been using Mysql for forever, and broadly it works fine for me, with two complaints
>> 1) occasional issues with mismatches in encoding/collation on strings
>> 2) hours lost on every mac upgrade trying to get mysql working properly again
>>
>> I know that people are generally favouring postgresql these days, I'm wondering if anyone can comment on whether it's worth putting in the effort to learn a new db?
>>
>> all the best
>>
>> Rob
>>
>> --
>> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/495925de-561d-4561-bb70-dfe9549219a8%40googlegroups.com.
>>
>> --
>> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcBqX0Y3R_63yfarpdV%2B0qesh3VGzeTzP2bV0inbGMxoOQ%40mail.gmail.com.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/HjmTuU1QoNM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/BE54840B-0F95-4AB6-831B-90A3205AD2A6%40gmail.com.
>
>
> --
>
>
>
>
>
> Hobbyist Software is a trading name of Hobbyist Software Limited. Registered office 12 Fraley Rd, Bristol, BS93BS. Registered in England. Company no:7876492
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACTOy%2BrggoJWMrmsUZiFFst5wNpKvEM7eRtzjfBxKwXtJEqvOA%40mail.gmail.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/61EC1866-A39A-4331-A215-B98AF43716BF%40wdstudio.com.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcCtgM8hOF-sgLuYPBqWAp9MgZ1o923w70ShFrpkvJiG-w%40mail.gmail.com.