Ruby on Rails Friday, February 28, 2014


The only thing I would use a mac is for iOS development, besides Rails development.
In my opinion you shouldnt buy a macbook if you can get the same with any linux distro. I remember when I started in rails dev and everyone used macbook pro/airs, that made me want to get one but it was too expensive then I search more and the hardware that apple offered was a great deal and I couldnt find other with similar specs. Recently I saw this brand new X1 Carbon from lenovo and I though "GREAT!" but... it seems to have problems and it costs more.

Hope it could help a little :)

--
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/CAEDwPMRxmmQ3VNnGN4Z9RrGuZXd5bbTDj3WAhy%3D5-H6Q1435%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails


www.phusionpassenger.com

On Thursday, February 27, 2014 10:52:59 AM UTC-5, Jay Amorin wrote:
Hi,

I just started ruby on rails. Would it be possible to create a start script that I can use on boot?

/etc/init.d/my_rails_init_script.sh {start|stop}

I've search the web and I can't find any.

Thanks,


Jay

--
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/e0f0571a-4b1d-4652-8fe2-8b5a2b8bd76b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Il giorno venerdì 28 febbraio 2014 18:46:39 UTC+1, Hassan Schroeder ha scritto:
On Fri, Feb 28, 2014 at 8:47 AM, Azroth <michelino...@gmail.com> wrote:

> uhuh what a genius, so I have to buy a Mac only to test browser in Mac
> native environment??? ok this is not my thread, you are not a developer, you
> a Mac fan, be happy with your Mac

Sorry to trigger your anger management issues, but I'm pointing out
that a valid use case exists where, yes, having access to MacOS to
do Mac browser testing is a requirement. And yes, the simplest way
to satisfy that requirement is to buy a Mac  :-)

If that use case doesn't apply to you, great. Where's the problem?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

no problem Hassan
in my development factory we got a Mac for graphic, music, media production and so on...and at least we do native tests
but if we talk of a single development machine for raw code developers, case doesn't apply
Have you ever heard of browser simulators apps? Find it yourself, local or online apps (with some limitations). You can test everything without a Mac, so if a wannabe-developer ask you OT about a Mac for rails development, the correct answer is "Dude, if you want to develop for IOS you NEED a Mac, but if you use a Mac only to develop rails webapps the price is too high"

Peace and respect

--
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/6f865089-acf7-43ef-a24a-41684e6c97b5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Yes sir.
Thanks for the tip.
This code makes the magic:

      doc = Nokogiri::HTML("<p>test</p>")
      doc.search("p")

On Friday, February 28, 2014 11:07:53 AM UTC-3, Frederick Cheung wrote:


On Friday, February 28, 2014 1:31:30 PM UTC, Guilherme wrote:
Hi,

I need to create a regex to extract 4 paragraphs of a text:

<p>
<b>Topic </b>–
abc
</p>


<p>abcd</p>
<p>abcde</p>
<p>abcdef</p>
<p>abcdefg</p>


I need to extract 4 paragraphs (text inside <p></p> including some html code) of this text using a regex.

How can I solve this problem ? I've tried a lot but I cant do this.


The standard advice would be to not use regular expressions - use an html parser like nokogiri.

Fred
 
Thanks 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 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/3702a54f-87d9-41b3-9bf1-a5791a431e69%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Fri, Feb 28, 2014 at 8:47 AM, Azroth <michelinominervini@gmail.com> wrote:

> uhuh what a genius, so I have to buy a Mac only to test browser in Mac
> native environment??? ok this is not my thread, you are not a developer, you
> a Mac fan, be happy with your Mac

Sorry to trigger your anger management issues, but I'm pointing out
that a valid use case exists where, yes, having access to MacOS to
do Mac browser testing is a requirement. And yes, the simplest way
to satisfy that requirement is to buy a Mac :-)

If that use case doesn't apply to you, great. Where's the problem?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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/CACmC4yCSxNe7sYS1rxbFDv1aB3NM-T736%3DR%2BDh0HPu3NBqWA0w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Il giorno giovedì 27 febbraio 2014 21:43:45 UTC+1, Colin Law ha scritto:
On 27 February 2014 18:51, Azroth <michelino...@gmail.com> wrote:
> ...
> mysql2 gem version on my local development machine is 0.3.11

You could try with the latest version of mysql, or drop back to 0.2.
Perhaps there were issues with 0.3.11 and ruby 1.8.7.  Possibly a long
shot but worth a try.

Colin

progress, thank you Colin

installed gem mysql2 version 0.2

now I can hit http://0.0.0.0:3000/rails/info/properties

I get an error
ActiveRecord::ConnectionNotEstablished

activerecord gem version is 3.2.8


development.log reports

Started GET "/assets/rails.png" for 127.0.0.1 at Fri Feb 28 18:39:40 +0100 2014
Connecting to database specified by database.yml

ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:170:in `retrieve_connection'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:144:in `connection'
  activerecord (3.2.8) lib/active_record/query_cache.rb:67:in `call'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__72693120__call__4__callbacks'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `send'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `send'
  activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.8) lib/rails/engine.rb:479:in `call'
  railties (3.2.8) lib/rails/application.rb:223:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
  rack (1.4.1) lib/rack/handler/webrick.rb:13:in `run'
  rack (1.4.1) lib/rack/server.rb:265:in `start'
  railties (3.2.8) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.8) lib/rails/commands.rb:55
  railties (3.2.8) lib/rails/commands.rb:50:in `tap'
  railties (3.2.8) lib/rails/commands.rb:50
  script/rails:6:in `require'
  script/rails:6


  Rendered /var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
  Rendered /var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.7ms)
  Rendered /var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (12.5ms)


Started GET "/rails/info/properties" for 127.0.0.1 at Fri Feb 28 18:39:42 +0100 2014

ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:170:in `retrieve_connection'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:144:in `connection'
  activerecord (3.2.8) lib/active_record/query_cache.rb:67:in `call'
  activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__72693120__call__4__callbacks'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `send'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `send'
  activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.8) lib/rails/engine.rb:479:in `call'
  railties (3.2.8) lib/rails/application.rb:223:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
  rack (1.4.1) lib/rack/handler/webrick.rb:13:in `run'
  rack (1.4.1) lib/rack/server.rb:265:in `start'
  railties (3.2.8) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.8) lib/rails/commands.rb:55
  railties (3.2.8) lib/rails/commands.rb:50:in `tap'
  railties (3.2.8) lib/rails/commands.rb:50
  script/rails:6:in `require'
  script/rails:6


  Rendered /var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
  Rendered /var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
  Rendered /var/lib/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (10.7ms)

--
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/15730989-fde6-4db2-adaf-7a12c93fcf32%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

An effort was made here https://rails.lighthouseapp.com/projects/8994/tickets/4392-add-touch-option-to-has_many-associations

But i think that feature should be provided as it is needed. We can educate people about its drawbacks for has many though.

--
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/aee02fe6-a106-4e78-b749-d83f54655d75%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Il giorno venerdì 28 febbraio 2014 02:28:25 UTC+1, Hassan Schroeder ha scritto:
On Thu, Feb 27, 2014 at 5:07 PM, Azroth <michelino...@gmail.com> wrote:

> full-stack development is a breeze on Linux

You run MacOS in a VM on Linux so you can test browser interaction
in a Mac-native environment?

If so, I'd love to see the details of your setup.

If not, you're missing the point altogether.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassa

uhuh what a genius, so I have to buy a Mac only to test browser in Mac native environment??? ok this is not my thread, you are not a developer, you a Mac fan, be happy with your Mac

--
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/ab36ef63-bc21-4808-97b2-c6b1472625e3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,
We have an immediate opening for Ruby on rails developer position in CA for 6-9 months contract

Client is looking for someone who have an hands on experience in Ruby on rails, Jruby, Gems on Rail, Backbone.Js. Javascripting, JMS, Jquery, HTML.

Can anyone help me out to fill this position.

Email: praveen@technoxpertz.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 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/6d4074c3-0a46-40da-9026-b6517921520c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Now I get it. Thanks guys for pointing me to the right direction.

Jay


On Fri, Feb 28, 2014 at 7:31 PM, Frederick Cheung <frederick.cheung@gmail.com> wrote:
On Friday, February 28, 2014 4:33:05 AM UTC, Jay Amorin wrote:
I just want that every time i restart my server, rails would also be up and running. No need for me to login and cd to your rails apps and then type rails server.

I already did those cool stuff, nginx proxy on the frontend, rails on the backend.

The thing is my current rails don't comes with a startup/init script. I hope that someone already did that and would like to share.

 
Typically people don't use `rails server` in production, which is probably why you haven't found any examples of that. You're more likely to use something like unicorn, puma, passenger (either the standalone version or the nginx/apache module version) and you shouldn't have trouble finding startup scripts for those.

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+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/ec88b452-4420-4881-be9b-31b02d1463d7%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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/CA%2Bgj%3DgZuDeqZLqhTyBN9zYSVv2fExb6powVRYHa3oAN1Jo6Xyw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Oh sorry... only now I figured out that I was answering on a rails group... so it could be about a rails app that you need to start with init.d

In that case... you can also use a script.. but it is a more complicated one...
 
As recommended above, it's better use passenger or unicorn... 


On Fri, Feb 28, 2014 at 11:28 AM, Carlos Figueiredo <carlos.figueiredo87@gmail.com> wrote:
I can not figure out why it can not be done... if you put a symbolic link for your ruby binary, you just need to do something like

/etc/init.d/start_fancy_ruby_script.sh

# /bin/ruby
#
puts "Your fancy script works"

  


On Fri, Feb 28, 2014 at 8:31 AM, Frederick Cheung <frederick.cheung@gmail.com> wrote:
On Friday, February 28, 2014 4:33:05 AM UTC, Jay Amorin wrote:
I just want that every time i restart my server, rails would also be up and running. No need for me to login and cd to your rails apps and then type rails server.

I already did those cool stuff, nginx proxy on the frontend, rails on the backend.

The thing is my current rails don't comes with a startup/init script. I hope that someone already did that and would like to share.

 
Typically people don't use `rails server` in production, which is probably why you haven't found any examples of that. You're more likely to use something like unicorn, puma, passenger (either the standalone version or the nginx/apache module version) and you shouldn't have trouble finding startup scripts for those.

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+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/ec88b452-4420-4881-be9b-31b02d1463d7%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
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/CANPOtXsaQon4Cx6oC03frQdNu%2B930E7eNgNM%2B8yXKoiXmLA9jg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I can not figure out why it can not be done... if you put a symbolic link for your ruby binary, you just need to do something like

/etc/init.d/start_fancy_ruby_script.sh

# /bin/ruby
#
puts "Your fancy script works"

  


On Fri, Feb 28, 2014 at 8:31 AM, Frederick Cheung <frederick.cheung@gmail.com> wrote:
On Friday, February 28, 2014 4:33:05 AM UTC, Jay Amorin wrote:
I just want that every time i restart my server, rails would also be up and running. No need for me to login and cd to your rails apps and then type rails server.

I already did those cool stuff, nginx proxy on the frontend, rails on the backend.

The thing is my current rails don't comes with a startup/init script. I hope that someone already did that and would like to share.

 
Typically people don't use `rails server` in production, which is probably why you haven't found any examples of that. You're more likely to use something like unicorn, puma, passenger (either the standalone version or the nginx/apache module version) and you shouldn't have trouble finding startup scripts for those.

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+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/ec88b452-4420-4881-be9b-31b02d1463d7%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
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/CANPOtXtOy4bUPTBpgjjJb8t_fd6A1JW%3D_LP9W56A7cdOg_vtRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



On Friday, February 28, 2014 1:31:30 PM UTC, Guilherme wrote:
Hi,

I need to create a regex to extract 4 paragraphs of a text:

<p>
<b>Topic </b>–
abc
</p>


<p>abcd</p>
<p>abcde</p>
<p>abcdef</p>
<p>abcdefg</p>


I need to extract 4 paragraphs (text inside <p></p> including some html code) of this text using a regex.

How can I solve this problem ? I've tried a lot but I cant do this.


The standard advice would be to not use regular expressions - use an html parser like nokogiri.

Fred
 
Thanks 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 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/87076399-af00-4841-b639-1aae845f076a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I need to create a regex to extract 4 paragraphs of a text:

<p>
<b>Topic </b>–
abc
</p>


<p>abcd</p>
<p>abcde</p>
<p>abcdef</p>
<p>abcdefg</p>


I need to extract 4 paragraphs (text inside <p></p> including some html code) of this text using a regex.

How can I solve this problem ? I've tried a lot but I cant do this.

Thanks 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 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/a3b9446e-e67f-4c9e-aedc-d0c1b14d5f5d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



On Thursday, February 27, 2014 6:30:44 PM UTC, Andrew Huth wrote:
I'm trying to come up with a way to use polymer with Rails, but there isn't much out there on the subject.

My thoughts are to handle web components like Javascript or CSS in rails. There will be an 'app/assets/elements/application.html' which defines what elements you want to be included. Then the asset pipeline needs to pull out dependencies for those elements and import them first. I also imagine in production all the web components will be concatenated into one html import.

The only problem is, I have no idea where to start on developing this. Is this something people want to see, and does anybody have any pointers on how to get started?

So far, I've asked a question on StackOverflow that is really basic, but it received any answers.

Anyway, your thoughts are appreciated.

Perhaps look at the jquery-ui-rails gem - It's similar in that you say which components you want and it includes the dependencies for you (you do have to repeat this for both css and js though).
You'll probably want to look into sprockets too, since that is what is behind the asset pipeline.

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+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/8c3c821b-b66f-424f-ae3d-dff0b2f657f2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Friday, February 28, 2014 4:33:05 AM UTC, Jay Amorin wrote:
I just want that every time i restart my server, rails would also be up and running. No need for me to login and cd to your rails apps and then type rails server.

I already did those cool stuff, nginx proxy on the frontend, rails on the backend.

The thing is my current rails don't comes with a startup/init script. I hope that someone already did that and would like to share.

 
Typically people don't use `rails server` in production, which is probably why you haven't found any examples of that. You're more likely to use something like unicorn, puma, passenger (either the standalone version or the nginx/apache module version) and you shouldn't have trouble finding startup scripts for those.

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+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/ec88b452-4420-4881-be9b-31b02d1463d7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 28 February 2014 01:07, Samuel Sosina <samsosina@gmail.com> wrote:
> Hi,
>
> I am currently trying to upload images on to Amazon S3 using paperclip for
> my rails app. The upload seems to work locally, however I receive the
> following error in production -
>
> ArgumentError (missing required :bucket option):
> app/controllers/meals_controller.rb:34:in `create'
>
>
> Heres the production.rb file -
>
> config.paperclip_defaults = {
> :storage => :s3,
> :s3_credentials => {
> :bucket => ENV['S3_BUCKET_NAME'],
> :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
> :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
> }
> }

Google found this which might help.
http://stackoverflow.com/questions/20424724/ruby-on-rails-paperclip-amazon-aws-s3-heroku

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/CAL%3D0gLsNWX6baJh02wG24EPFgfH_Xmd_M95PZK%2B-HA%3DpUdpG8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails Thursday, February 27, 2014

I am having 3 models

Word, WordPartOfSpeech, WordSentence

Word has many WordPartOfSpeech
WordPartOfSpeech has many WordSentence

Now with the below mentioned code i am getting the nested json as i want

@words = Word.where("words.id != ?", params[:word_id])

respond_to do |format|

format.json { render :json => @words.as_json(:include => {:word_part_of_speeches => {:include => :word_sentences}}) }

end

But the problem is i want only those word part of speeches to be included in this json which have atleast 1 approved sentence and only those sentence that are approved

Now if i use joins the json returned is not nested and if i use include then condition does not work

--
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/5b64a6e0-76d1-41d8-ac9a-c1a9ff732b04%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I just want that every time i restart my server, rails would also be up and running. No need for me to login and cd to your rails apps and then type rails server.

I already did those cool stuff, nginx proxy on the frontend, rails on the backend.

The thing is my current rails don't comes with a startup/init script. I hope that someone already did that and would like to share.

Jay


On Fri, Feb 28, 2014 at 1:26 AM, Colin Law <clanlaw@gmail.com> wrote:
On 27 February 2014 15:52, Jay Amorin <jeeyessos@gmail.com> wrote:
> Hi,
>
> I just started ruby on rails. Would it be possible to create a start script
> that I can use on boot?
>
> /etc/init.d/my_rails_init_script.sh {start|stop}

Can you explain why you want to do this?  It is a bit unusual for
someone just starting rails to want a server running from boot,
assuming that is what you mean to achieve.

What would be in the startup script to start the server?

Colin


>
> I've search the web and I can't find any.
>
> Thanks,
>
>
> Jay
>
> --
> 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/2ef2cd6a-cc07-475b-a938-25026f1d4208%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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%3D0gLuVrnKS-8jeucL%2BphUm86iMz7JeQG68EOJjhYDNm-hPiQ%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 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/CA%2Bgj%3Dga4e0uMJqBVmEhqGpUoNAA_kX5N9hW0WQXAmDrFHHFmdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Thu, Feb 27, 2014 at 5:07 PM, Azroth <michelinominervini@gmail.com> wrote:

> full-stack development is a breeze on Linux

You run MacOS in a VM on Linux so you can test browser interaction
in a Mac-native environment?

If so, I'd love to see the details of your setup.

If not, you're missing the point altogether.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassa

--
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/CACmC4yAzsjshTzV%2B39D3qe0TZrqFrJGV%3DL2VsmV3_31mcfH-Pw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Il giorno giovedì 27 febbraio 2014 22:01:24 UTC+1, Hassan Schroeder ha scritto:
On Thu, Feb 27, 2014 at 11:14 AM, Azroth <michelino...@gmail.com> wrote:

> for a posix-like developer a Mac is just a waste of money

Welp. If you do full-stack development and need to test webapps on
the primary consumer platforms, a Mac + VMWare/VirtualBox with
Windows is pretty handy. I'm not sure you can get that functionality
in any other way, at least so simply.

And if you travel much, it's *really* hard to beat a MacbookAir  :-)

YMMV,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

??? Virtualbox runs lightning fast on Linux, and you can test with native kernel funcionalities VMs with KVM, for 1500eur/dollars wasted to buy a MAC I buy a lightning PC to virtualize the entire universe,  so I miss your point, for developers PC/Linux is hard to beat, full-stack development is a breeze on Linux, and primary platform and native testing and production server is Linux, Mac is very cool if you do professional graphic or music or multimedia production, but for a raw code developer is a waste of money

--
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/21c72596-9073-484e-bd92-86e208463ea0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi, 

I am currently trying to upload images on to Amazon S3 using paperclip for my rails app. The upload seems to work locally, however I receive the following error in production

     ArgumentError (missing required :bucket option):
     app/controllers/meals_controller.rb:34:in `create'


Heres the production.rb file -

config.paperclip_defaults = {
    :storage => :s3,
    :s3_credentials => {
      :bucket => ENV['S3_BUCKET_NAME'],
      :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
      :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
    }
  }

Here are the Gems that are currently running -

ruby ~> 2.0.0
rails ~> 4.0.1
paperclip ~> 4.10
aws-sdk ~> 1.34.1

Thanks 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 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/35c57752-00b0-46d7-a56d-05b15ac7f286%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,
I've moved a project on new server with ruby 1.9.1 but now I've an
error:


Error message:
cannot load such file -- test/unit/error


Exception class:
LoadError


Backtrace:
# File Line Location
0 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
1 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
2
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/dependencies.rb
510 in `block in require'
3
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/dependencies.rb
355 in `new_constants_in'
4
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/dependencies.rb
510 in `require'
5
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/deprecation.rb
204 in `'
6 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
7 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
8
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/dependencies.rb
510 in `block in require'
9
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/dependencies.rb
355 in `new_constants_in'
10
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support/dependencies.rb
510 in `require'
11
/var/lib/gems/1.9.1/gems/activesupport-2.1.2/lib/active_support.rb 40
in `'
12 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
13 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
14 /home/officinesalin/salin/vendor/plugins/engines/lib/engines.rb
1 in `'
15 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
16 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
17 /home/officinesalin/salin/vendor/plugins/engines/boot.rb 8
in `'
18 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
19 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
20 /home/officinesalin/salin/config/environment.rb 13 in `'
21 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
22 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb 36 in
`require'
23
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb
222 in `preload_application'
24
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb
181 in `block in initialize_server'
25 /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb 572 in
`report_app_init_status'
26
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb
174 in `initialize_server'
27 /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb
204 in `start_synchronously'
28 /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb
180 in `start'
29
/usr/lib/ruby/vendor_ruby/phusion_passenger/classic_rails/application_spawner.rb
149 in `start'
30 /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb
219 in `block (2 levels) in spawn_rails_application'
31
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb
132 in `lookup_or_add'
32 /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb
214 in `block in spawn_rails_application'
33
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb
82 in `block in synchronize'
34 prelude> 10:in `synchronize'
35
/usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb
79 in `synchronize'
36 /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb
213 in `spawn_rails_application'
37 /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb
132 in `spawn_application'
38 /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb
275 in `handle_spawn_application'
39 /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb
357 in `server_main_loop'
40 /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb
206 in `start_synchronously'
41
/usr/share/phusion-passenger/helper-scripts/passenger-spawn-server 99
in `'

--
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+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/cc71eabe3638b9160c25124acf6037f3%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Thu, Feb 27, 2014 at 11:14 AM, Azroth <michelinominervini@gmail.com> wrote:

> for a posix-like developer a Mac is just a waste of money

Welp. If you do full-stack development and need to test webapps on
the primary consumer platforms, a Mac + VMWare/VirtualBox with
Windows is pretty handy. I'm not sure you can get that functionality
in any other way, at least so simply.

And if you travel much, it's *really* hard to beat a MacbookAir :-)

YMMV,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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/CACmC4yCcpMRVvWKh%3DMEgLxZJZ5bKwy4bBgovx0Z8fY%2Bq-q2pgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 27 February 2014 18:51, Azroth <michelinominervini@gmail.com> wrote:
> ...
> mysql2 gem version on my local development machine is 0.3.11

You could try with the latest version of mysql, or drop back to 0.2.
Perhaps there were issues with 0.3.11 and ruby 1.8.7. Possibly a long
shot but worth a try.

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/CAL%3D0gLuGFHqkBHiLgF%3Df-hmu-o%3DWFaLb%3DebSHy%3D7wnp8s8M-Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Ganesh Ranganathan wrote in post #1138274:
> Try Minisection.find(minisection_id).questions.pluck(:id)

That did it! Thanks!!

Dave

--
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+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/072b31a9ddfdc6530b815a9b26390ef8%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Try Minisection.find(minisection_id).questions.pluck(:id)


On Fri, Feb 28, 2014 at 12:33 AM, Dave Castellano <lists@ruby-forum.com> wrote:
Hi,

I  am trying to do the following database query (ie find all question
id's with the selected minisection id):

minisection_questions = Question.where(minisection_id:
minisection_id).pluck(:id)

I have a question table, a minisection table, and a
minisections_questions join table.

Question model - has_and_belongs_to_many :minisections
Minisection model - has_and_belongs_to_many :questions

I get the following error:
PGError: ERROR:  column questions.minisection_id does not exist
LINE 1: SELECT id FROM "questions"  WHERE "questions"."minisection_i...
                                          ^
: SELECT id FROM "questions"  WHERE "questions"."minisection_id" = 2

--
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+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/3202d2b108b746f5280797b3d3c43a2e%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/CALFmRoGB0q9YBsfm1ffz4cYBpSCzxe5SMSFhDhJLs3RMG%3DH9Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Il giorno martedì 25 febbraio 2014 23:00:14 UTC+1, Jason Hsu, Rubyist ha scritto:
I realize this is off-topic, but I understand that an overwhelming majority of Rubyists use Mac computers and not PCs.  I currently use Linux-powered PCs. Yes, I ditched Windows years ago just like many of you. Using Linux on a used PC is the cheapest way to compute. (I've been able to buy a 4 or 5-year-old PC that works for as little as $40-$50.)

I'm interested in purchasing a Mac to put myself on the same page as other software developers. (I'm used to Linux distros that provide the look and feel of Windows XP.) I will use the Mac for software development projects, but I intend to stick with my Linux-powered PCs for general computing. (I don't want to get locked into the Mac world, because it's so much more expensive.  Also, there is a case to be made for being versatile.)

I'm thinking of buying a new mini (starts at $600), a new MacBook (starts at $1000), or a refurbished MacBook (starts at $850).

Some questions:
1. How much has OS X changed over the past several versions? Is something from 5 years ago obsolete? Linux, on the other hand, is free. Any current Linux distro will work very well on a 5-year-old PC, and there are even some Linux distros (like Puppy Linux and antiX Linux) that work well on PCs that are 10 or more years old.
2. Is it just me, or are used Macs so exorbitantly expensive as to defeat the point of buying a used computer in the first place? I looked at Craigslist and found a number of used Mac laptops selling for as much as a new one. Most of the Macs selling for a few hundred dollars or less were very old, such as G4s. (I understand that those are 10-15 years old. Good luck getting even $100 or even $50 from a 10-year-old PC.)

the natural garden of Rails and Ruby is Linux on a PC (RHEL, CentOS, Fedora, Ubuntu or Debian are my choices), OSX is a beautiful exotic and very expensive os, but if you don't mind IOS development, for a posix-like developer a Mac is just a waste of money

--
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/4b7876cc-805f-48cc-8370-5291176e6263%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I am trying to do the following database query (ie find all question
id's with the selected minisection id):

minisection_questions = Question.where(minisection_id:
minisection_id).pluck(:id)

I have a question table, a minisection table, and a
minisections_questions join table.

Question model - has_and_belongs_to_many :minisections
Minisection model - has_and_belongs_to_many :questions

I get the following error:
PGError: ERROR: column questions.minisection_id does not exist
LINE 1: SELECT id FROM "questions" WHERE "questions"."minisection_i...
^
: SELECT id FROM "questions" WHERE "questions"."minisection_id" = 2

--
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+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/3202d2b108b746f5280797b3d3c43a2e%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



Il giorno giovedì 27 febbraio 2014 09:44:02 UTC+1, Colin Law ha scritto:
On 27 February 2014 03:02, Azroth <michelino...@gmail.com> wrote:
> Hi Colin
>
> rails server
>
> => Booting WEBrick
> => Rails 3.2.8 application starting in development on http://0.0.0.0:3000
> => Call with -d to detach
> => Ctrl-C to shutdown server
> [2014-02-27 03:37:20] INFO  WEBrick 1.3.1
> [2014-02-27 03:37:20] INFO  ruby 1.8.7 (2011-06-30) [i686-linux]
> [2014-02-27 03:37:25] INFO  WEBrick::HTTPServer#start: pid=12143 port=3000
>
> development.log is
>
> Started GET "/assets/rails.png" for 127.0.0.1 at Thu Feb 27 03:44:29 +0100
> 2014
> Connecting to database specified by database.yml

Please don't top post it makes it difficult to follow the thread, post
your reply inline at appropriate points, thanks.

If there is nothing else after that then I suggest it is hanging
trying to access the mysql server.  Have you tried leaving it for some
minutes to see if something eventually times out and gives you some
more clues?
Are there any mysql logs on the server that might be useful?

You said, I think, that it works ok with a later version of ruby.
Perhaps the mysql2 adaptor you are using is ruby version specific.

Colin

>
> database.yml fragment is
>
> development:
>   adapter: mysql2
>   host: <my server ip>
>   port: 3306
>   encoding: utf8
>   reconnect: false
>   database: rails32801blog_development
>   pool: 5
>   username: <my username>
>   password: <my password>
>   socket: /var/lib/mysql/mysql.sock

waited for some minutes, no way, browser is hanging indefinetely,

mysql error log report

140224 01:19:52 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140224 01:19:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140224  1:19:53  InnoDB: Initializing buffer pool, size = 8.0M
140224  1:19:53  InnoDB: Completed initialization of buffer pool
140224  1:19:53  InnoDB: Started; log sequence number 0 255851
140224  1:19:53 [Note] Event Scheduler: Loaded 0 events
140224  1:19:53 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
140224  1:59:26 [Note] /usr/libexec/mysqld: Normal shutdown

so no errors, nothing strange

mysql2 gem version on my local development machine is 0.3.11

--
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/ad2f9839-3c35-4966-b01c-a1b0bb5fe02d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Il giorno giovedì 27 febbraio 2014 12:55:50 UTC+1, Frederick Cheung ha scritto:

On Thursday, February 27, 2014 3:02:43 AM UTC, Azroth wrote:

development:
  adapter: mysql2
  host: <my server ip>
  port: 3306
  encoding: utf8
  reconnect: false
  database: rails32801blog_development
  pool: 5
  username: <my username>
  password: <my password>
  socket: /var/lib/mysql/mysql.sock


It would be unusual to provide both a socket and a host. Perhaps the connection is blocked (firewall etc) and ruby is waiting in vain for the connection to open?

Fred

Don't know, Fred, it's a rebus, I can connect correctly with a different setup (ruby 1.9.2 + rails 3.2.8), can't connect with ruby 1.8.7 + rails 3.2.8, so I think it's not a mysql/firewall misconfiguration, it's an issue related to ruby version

--
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/80edf290-8b65-4c81-84cf-6f212d0126ef%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I'm trying to come up with a way to use polymer with Rails, but there isn't much out there on the subject.

My thoughts are to handle web components like Javascript or CSS in rails. There will be an 'app/assets/elements/application.html' which defines what elements you want to be included. Then the asset pipeline needs to pull out dependencies for those elements and import them first. I also imagine in production all the web components will be concatenated into one html import.

The only problem is, I have no idea where to start on developing this. Is this something people want to see, and does anybody have any pointers on how to get started?

So far, I've asked a question on StackOverflow that is really basic, but it received any answers.

Anyway, your thoughts are appreciated.

--
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/e3145885-a9f3-4aa2-b237-921fa0f555cf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 27 February 2014 15:52, Jay Amorin <jeeyessos@gmail.com> wrote:
> Hi,
>
> I just started ruby on rails. Would it be possible to create a start script
> that I can use on boot?
>
> /etc/init.d/my_rails_init_script.sh {start|stop}

Can you explain why you want to do this? It is a bit unusual for
someone just starting rails to want a server running from boot,
assuming that is what you mean to achieve.

What would be in the startup script to start the server?

Colin


>
> I've search the web and I can't find any.
>
> Thanks,
>
>
> Jay
>
> --
> 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/2ef2cd6a-cc07-475b-a938-25026f1d4208%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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%3D0gLuVrnKS-8jeucL%2BphUm86iMz7JeQG68EOJjhYDNm-hPiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

My point is that "starting rails" at system start smells of someone trying to host production in Webrick.

Walter

On Feb 27, 2014, at 12:07 PM, Hassan Schroeder wrote:

> Yes, and that "another application server" needs to be started, so --
> not sure what your point is.

--
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/7AF8A06C-6727-41C8-91A4-2406FC85AEC1%40wdstudio.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Thu, Feb 27, 2014 at 7:59 AM, Walter Lee Davis <waltd@wdstudio.com> wrote:
> For all other forms of deployment (public) you would have a Web server to front-end requests and pass them along to your Rails app, which would be running in Passenger or Thin or another application server.

Yes, and that "another application server" needs to be started, so --
not sure what your point is.

To the OP - one app server, Puma, comes with an init.d script; you
might get some ideas from that even if you choose another server.

( See <https://github.com/puma/puma> under 'tools' )

Good luck,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassa

--
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/CACmC4yAztAUtga9gZcGS3FbX85kLu1KouWtLW0M%2BGXK63HdMsw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

It's been a while since I used a Linux laptop (I was a Linux on laptop
& desktop full-time user for 5+ years) but certainly one of the big
draws for me in Mac/OS X has simply been the *feel*. The fonts look
great (useful when you're reading them 10+hours/day): they're typeset
well, antialiased well, crisp, attractive. The Retina display is
amazing. It's obvious folks with serious design chops are behind it
all. For me, Linux & Windows have always felt clunky in comparison.

If you want to get a deep sense of this, watch
http://www.helveticafilm.com - there is a hilarious & epic
anti-Microsoft rant by Erik Spiekermann about how Arial was a rip-off
of Helvetica for MS to avoid having to pay Linotype,
http://www.youtube.com/watch?feature=player_detailpage&v=F691weEVpwc#t=291

Macs... A lot of stuff Just Works(tm): multi monitor, devices, swipe,
etc. If I could monetize the time I spent fiddling with xf86config
over the years I'd likely have paid for every Mac I've owned. (I'm
sure it's better now?).

For me, having a machine that wakes from sleep nearly instantly, has
reliable trackpad + gestures, consistent copy/paste behavior, and so
on, is worth the money.

Finally, there's the development environment - this is the massively
personal choice that is likely the big decision maker for most.
There's no point justifying what each person likes any more than their
taste in broccoli but ultimately if you really like OS X or Linux,
well... :)

Paul

On Tue, Feb 25, 2014 at 2:00 PM, Jason Hsu, Rubyist
<jhsu802701@gmail.com> wrote:
> I realize this is off-topic, but I understand that an overwhelming majority
> of Rubyists use Mac computers and not PCs. I currently use Linux-powered
> PCs. Yes, I ditched Windows years ago just like many of you. Using Linux on
> a used PC is the cheapest way to compute. (I've been able to buy a 4 or
> 5-year-old PC that works for as little as $40-$50.)
>
> I'm interested in purchasing a Mac to put myself on the same page as other
> software developers. (I'm used to Linux distros that provide the look and
> feel of Windows XP.) I will use the Mac for software development projects,
> but I intend to stick with my Linux-powered PCs for general computing. (I
> don't want to get locked into the Mac world, because it's so much more
> expensive. Also, there is a case to be made for being versatile.)
>
> I'm thinking of buying a new mini (starts at $600), a new MacBook (starts at
> $1000), or a refurbished MacBook (starts at $850).
>
> Some questions:
> 1. How much has OS X changed over the past several versions? Is something
> from 5 years ago obsolete? Linux, on the other hand, is free. Any current
> Linux distro will work very well on a 5-year-old PC, and there are even some
> Linux distros (like Puppy Linux and antiX Linux) that work well on PCs that
> are 10 or more years old.
> 2. Is it just me, or are used Macs so exorbitantly expensive as to defeat
> the point of buying a used computer in the first place? I looked at
> Craigslist and found a number of used Mac laptops selling for as much as a
> new one. Most of the Macs selling for a few hundred dollars or less were
> very old, such as G4s. (I understand that those are 10-15 years old. Good
> luck getting even $100 or even $50 from a 10-year-old PC.)
>
> --
> 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/68ab588b-edb7-442a-9eae-7af0f19a1beb%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

--
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/CAMEJyiuH%2B71TuA9J5SbiJfAGuvkB6U7AD_r_GsvCFoasbw%2BHqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.