[Rails] Re: Concurrency in Ruby on Rails 4

2014-11-20 Thread David Williams
Scott Ribe wrote in post #1162964:
> On Nov 20, 2014, at 12:42 PM, David Williams 
> wrote:
>>
>> Essentially the fasted method for transferring data between
>> client/server.
>
> That's literally a meaningless question. You're really going to have to
> clarify your question before you can expect any answer.
>
> - Latency of individual requests and total number of requests throughput
> are two different issues.
>
> - Getting data out of a database, getting static assets from cache or
> disk, building responses to requests (whether HTML or JSON or whatever,
> sending the responses to the browser, and rendering the result in the
> browser, are all separate issues.
>
> So: lots of clients? busy clients? large requests? large database
> backing the site? large or complex assets? complex processing of
> requests? complex browser rendering?

You're right, it depends on the size of the service and how much data is 
actually being sent during each request.

-- 
Posted via http://www.ruby-forum.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+unsubscr...@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/0ccb87d93f80876a4a16f9809fbf910c%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Could not install Rmagick Gem in rails 4 (Ubuntu 13.04)

2014-11-20 Thread David Williams
RMagick isn't compatible with the latest version of rails. The gem 
hasn't been updated for sometime.

-- 
Posted via http://www.ruby-forum.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+unsubscr...@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/96faa1fd96052bf06919a974ad21becc%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] My new Rails app: Lose Money Fast

2014-11-20 Thread Ganesh Ranganathan
On Fri, Nov 21, 2014 at 2:48 AM, Jason Hsu, Rubyist 
wrote:

> It's at https://losemoneyfast.herokuapp.com/ .  If you ever wondered how
> you'd fare if you could buy thousands of lottery tickets per drawing, my
> new Rails app Lose Money Fast will allow you to simulate this.  It also
> keeps track of your total spending, your total winnings, and your return on
> "investment".
>

​It's aptly named for managing this "investment" :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+unsubscr...@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/CALFmRoGBDh1ZMiX%2Bk8h53g%3DjwKr5esTa6Qhvp%3DhZpEf3K9Y%2BTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] My new Rails app: Lose Money Fast

2014-11-20 Thread Jason Hsu, Rubyist
It's at https://losemoneyfast.herokuapp.com/ .  If you ever wondered how 
you'd fare if you could buy thousands of lottery tickets per drawing, my 
new Rails app Lose Money Fast will allow you to simulate this.  It also 
keeps track of your total spending, your total winnings, and your return on 
"investment".

-- 
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+unsubscr...@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/26e9f107-2cee-46f4-aa56-54b13d2a4528%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Concurrency in Ruby on Rails 4

2014-11-20 Thread Scott Ribe
On Nov 20, 2014, at 12:42 PM, David Williams  wrote:
> 
> Essentially the fasted method for transferring data between 
> client/server.

That's literally a meaningless question. You're really going to have to clarify 
your question before you can expect any answer.

- Latency of individual requests and total number of requests throughput are 
two different issues.

- Getting data out of a database, getting static assets from cache or disk, 
building responses to requests (whether HTML or JSON or whatever, sending the 
responses to the browser, and rendering the result in the browser, are all 
separate issues.

So: lots of clients? busy clients? large requests? large database backing the 
site? large or complex assets? complex processing of requests? complex browser 
rendering?

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




-- 
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+unsubscr...@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/F4A8F69F-5EC4-4A50-80E0-7A7D890DBD08%40elevated-dev.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Any reason to use minitest instead of Rspec

2014-11-20 Thread Roelof Wobben
Hello, 

I try again to learn ruby and Im following now "Agile Web development in 
Rails 4"

I see that the author uses minitest to test models.

Is there any reason to use minitest  instead of Rspec to test models and 
controllers. 

Roelof

-- 
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+unsubscr...@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/3c107ad0-3bd1-4eb3-a685-3ffcd4fc33fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Concurrency in Ruby on Rails 4

2014-11-20 Thread David Williams
Hassan Schroeder wrote in post #1162850:
> On Wed, Nov 19, 2014 at 11:35 AM, David Williams 
> wrote:
>> How would you approach developing an app that requires expedient
>> transactions?
>
> What exactly do you mean by "expedient transactions" in the context
> of a web application?
>
> --
> Hassan Schroeder  hassan.schroe...@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan

Essentially the fasted method for transferring data between 
client/server.

-- 
Posted via http://www.ruby-forum.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+unsubscr...@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/496583c1181efc248fe862122a6bf999%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] incompatible character encodings: ASCII-8BIT and UTF-8

2014-11-20 Thread Jason Fleetwood-Boldt

I assume you have created a "dump" of the data from production and copied it to 
your local MySQL version. 

Also I assume you are comparing the same records on dev & production 
("comparing apples to apples")

Check the character set (also known as "encoding") and collation settings on 
the table (on both your dev and production database) to make sure they are the 
same. 

see http://dev.mysql.com/doc/refman/5.0/en/charset-table.html for an explanation

Note that these are set on a table-by-table basis. Because MySQL was originally 
invented in Sweden, the historical default for the character encoding is 
utf8_sweedish_ci. Typically people change that to utf8_unicode_ci

Once you verify they are identical on both machines, if you want to fix them on 
Production you'll want to use a Rails migration.

see also...
http://stackoverflow.com/questions/5906585/change-database-collation



-Jason


On Nov 20, 2014, at 9:39 AM, Vladimir Gordeev  
wrote:

> but i don"t understand why it worked normally on my local computer and coming 
> from the same databse
> 
>  Dear sir, how do you define "same"? They could contain same data with 
> different encodings.
> 
> -- 
> 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+unsubscr...@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/CAP1h_xeY2c0L4qMpP8t0zSvKrjsP2J4b0HXvYsZ5epJ7UZ7Csw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



Jason Fleetwood-Boldt
t...@datatravels.com
http://www.jasonfleetwoodboldt.com/writing

All material © Jason Fleetwood-Boldt 2014. Public conversations may be turned 
into blog posts (original poster information will be made anonymous). Email 
ja...@datatravels.com with questions/concerns about this.

-- 
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+unsubscr...@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/5FF26CF5-3952-4A9D-880F-45233364DBDE%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: date_select -> params ok but nil

2014-11-20 Thread Matt Jones


On Wednesday, 19 November 2014 17:40:50 UTC-5, der_tom wrote:
>
> hi,
>
> im kinda stuck...
>
> <%= form_for(@event) do |f| %>
>   
> <%= f.label :from_date %>
> <%= date_select :event, :from_date %>
>   
>
>
> .
>
> def create
> p params[:event].nil?
> p params[:event][:name]
> p params[:event][:from_date]
>
> if params[:event][:from_date].empty?
>   params[:event][:from_date] = Date.today
> end
> ...
> -->
> Started POST "/events" for 127.0.0.1 at 2014-11-19 17:37:09 -0500
> Processing by EventsController#create as HTML
>   Parameters: {"utf8"=>"✓", 
> "authenticity_token"=>"JannWb1XCE12AKW4KlR56LAAmIOG1raHJh1ss4v0RBA=", 
> "event"=>{"name"=>"", "from_date(1i)"=>"2014", "from_date(2i)"=>"11", 
> "from_date(3i)"=>"19", "to_date(1i)"=>"2014", "to_date(2i)"=>"11", 
> "to_date(3i)"=>"19"}, "commit"=>"Create"}
>
>
 --> why are my event date attributes nil/blank?

The date is not sent as a single attribute, but rather one per dropdown 
that date_select sends (thus from_date(1i) etc).

When those attributes are assigned to your model, they are combined into a 
single object by ActiveRecord.

You can either check for the subparts explicitly, or move the "default to 
today" behavior to the model instead.

--Matt Jones

-- 
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+unsubscr...@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/199cc138-1098-47ef-821d-5a5a5f297345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Mysql2::Error: This connection is still waiting for a result, try again once you have the result

2014-11-20 Thread Jason Fleetwood-Boldt
Rails-talk, 

Last night I got a slew (around 2000) of these exceptions raised in my 
production app between 4:03 AM and 7:30 AM (eastern time). 

They all had the same pattern:

ActiveRecord::StatementInvalid: Mysql2::Error: This connection is still waiting 
for a result, try again once you have the result: SELECT `spree_buckets`.* FROM 
`spree_buckets` WHERE `spree_buckets`.`slug` = 'gallery' LIMIT 1
(The SQL query was different for many, but the Mysql2::Error: This connection 
is still waiting for a result, try again once you have the result part was the 
same)

I called Amazon RDS support and they said the underlying database looked fine, 
we are well below our IOPS threshold, and our queue depth looks healthy.

I think perhaps just 1 Unicorn worker choked up with a single MySQL call, 
resulting in all subsequent calls from that Unicorn worker to produce this 
error (for 3 hours!)

Does anyone else have any best practice advice for this error? Should I simply 
catch for this exception and close & reconnect any active MySQL connections ? 
Can someone share some examples of how to do that as cleanly as possible?

Thanks,
Jason






Jason Fleetwood-Boldt
t...@datatravels.com
http://www.jasonfleetwoodboldt.com/writing

-- 
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+unsubscr...@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/0C92E483-8F51-4AAF-A210-D5243246CE6C%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Marshal Data too short error with ActiveRecord sess. sto

2014-11-20 Thread Gökhan C.
Wes Gamble wrote in post #157243:
> Wes Gamble wrote:
>> Does anyone know how to figure out the size of a text column in SQL
>> Server?
>
> SELECT datalength(data) FROM sessions;

Hello my friend.
I have the same sitiutaion at now.
Do you find a solution for that?

regards
Coban

-- 
Posted via http://www.ruby-forum.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+unsubscr...@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/b7a86e267492ae41006ac0bb50c1afd4%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: gem 'devise' error

2014-11-20 Thread JP
Thank you so much

On Thursday, 20 November 2014 15:13:41 UTC, Frederick Cheung wrote:
>
>
>
> On Thursday, November 20, 2014 2:55:40 PM UTC, JP wrote:
>>
>> Hi, 
>>
>> I am trying to install Devise but I am getting this error :
>>
>> gem 'devise', '~> 3.0.0.rc'
>>
>> ERROR:  While executing gem ... (Gem::CommandLineError)
>>
>>  Unknown command devise,
>>
>
> Did you type that in the console? That line is supposed to go in your 
> Gemfile (and then you run bundle to install any dependencies from your 
> Gemfile that are not currently installed).
>
> If you really want to install it without using bundler you would instead 
> run
>
> gem install devise --version 3.0.0.rc
>
> Lastly, it's unlikely you actually want that exact version - the final 
> version of devise 3.0.0 came out some time ago (and more recent versions 
> have also been released)
>
> Fred
>

-- 
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+unsubscr...@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/111d245a-cbd7-44c7-8d76-92097d6de741%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: gem 'devise' error

2014-11-20 Thread Frederick Cheung


On Thursday, November 20, 2014 2:55:40 PM UTC, JP wrote:
>
> Hi, 
>
> I am trying to install Devise but I am getting this error :
>
> gem 'devise', '~> 3.0.0.rc'
>
> ERROR:  While executing gem ... (Gem::CommandLineError)
>
>  Unknown command devise,
>

Did you type that in the console? That line is supposed to go in your 
Gemfile (and then you run bundle to install any dependencies from your 
Gemfile that are not currently installed).

If you really want to install it without using bundler you would instead run

gem install devise --version 3.0.0.rc

Lastly, it's unlikely you actually want that exact version - the final 
version of devise 3.0.0 came out some time ago (and more recent versions 
have also been released)

Fred

-- 
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+unsubscr...@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/e905e5c7-3947-4131-8806-9136fd65fefc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] gem 'devise' error

2014-11-20 Thread JP
 

Hi, 

I am trying to install Devise but I am getting this error :

gem 'devise', '~> 3.0.0.rc'

ERROR:  While executing gem ... (Gem::CommandLineError)

 Unknown command devise,

---

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+unsubscr...@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/14ede1e3-3aa6-4d4e-b900-31a02508d938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] incompatible character encodings: ASCII-8BIT and UTF-8

2014-11-20 Thread Vladimir Gordeev
>
> but i don"t understand why it worked normally on my local computer and
> coming from the same databse
>

 Dear sir, how do you define "same"? They could contain same data with
different encodings.

-- 
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+unsubscr...@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/CAP1h_xeY2c0L4qMpP8t0zSvKrjsP2J4b0HXvYsZ5epJ7UZ7Csw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] incompatible character encodings: ASCII-8BIT and UTF-8

2014-11-20 Thread Melb01
I add it to every file used for this template but  it didn't work

I was able to solve it using the method encode("utf-8", uttf-8") for the 
Mystring directly after the query from database and it worked

but i don"t understand why it worked normally on my local computer and 
coming from the same databse

rgds,

-- 
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+unsubscr...@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/148d82a4-73c7-46bf-b708-1a01ac5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Could not install Rmagick Gem in rails 4 (Ubuntu 13.04)

2014-11-20 Thread Benoit G.
https://github.com/rmagick/rmagick/wiki/Installing-on-Ubuntu

-- 
Posted via http://www.ruby-forum.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+unsubscr...@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/cef919260b898273cf1b7ac8080d5694%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: date_select -> params ok but nil

2014-11-20 Thread Mike
You're using the f.label and date_select helpers.  Try using f.date_select ?

On Wednesday, November 19, 2014 2:40:50 PM UTC-8, der_tom wrote:
>
> hi,
>
> im kinda stuck...
>
> <%= form_for(@event) do |f| %>
>   
> <%= f.label :from_date %>
> <%= date_select :event, :from_date %>
>   
>
>
> .
>
> def create
> p params[:event].nil?
> p params[:event][:name]
> p params[:event][:from_date]
>
> if params[:event][:from_date].empty?
>   params[:event][:from_date] = Date.today
> end
> ...
> -->
> Started POST "/events" for 127.0.0.1 at 2014-11-19 17:37:09 -0500
> Processing by EventsController#create as HTML
>   Parameters: {"utf8"=>"✓", 
> "authenticity_token"=>"JannWb1XCE12AKW4KlR56LAAmIOG1raHJh1ss4v0RBA=", 
> "event"=>{"name"=>"", "from_date(1i)"=>"2014", "from_date(2i)"=>"11", 
> "from_date(3i)"=>"19", "to_date(1i)"=>"2014", "to_date(2i)"=>"11", 
> "to_date(3i)"=>"19"}, "commit"=>"Create"}
> ..
> ..def instantiate_controller_and_action_names"
> "URL: http://localhost:3000/events";
> "Fullpath: /events"
> "events"
> "Action: create"
> "Controller: events"
> false
> ""
> nil
>
>
> --> why are my event date attributes nil/blank?
>
> tia
> tom
>
>

-- 
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+unsubscr...@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/44886969-b7fd-417c-bffa-1aab854b9343%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.