Re: [Rails] Trigger before save and after save from external process?

2014-03-28 Thread Rick
The easiest way to have an external process run within your application 
context is to write your external app in ruby and run it inside a call to 
*rails 
runner ... *. You pay a penalty at startup but gain access to your 
application's environment (think *rails console*).

There is nothing inherently wrong with having multiple clients working out 
of the same database tables. The complications come when more than one 
client tries to modify the same field in the same record at the same time. 
Two strategies come to mind.

First, you can use roles (db_mgr and db_user) to restrict access to 
'troubling' actions. You would require all change activity 
(create/update/delete) to be done only by db_mgr. Database tables could 
then be managed by your offline application.

Second, you can bring your application to a reduced state - don't forget to 
notify users - and manage your tables while the database is quiet.



On Friday, March 28, 2014 8:47:24 AM UTC-4, Hassan Schroeder wrote:
>
> On Fri, Mar 28, 2014 at 5:00 AM, Walter Lee Davis 
> > 
> wrote: 
>
> >> I have an external process changing the database of my app. Is there a 
> good way to trigger the before save and after save filters for models that 
> get updated, when it is an external process changing it? 
>
> > Try to think more about your overall application architecture. Maybe 
> your "external process" can call an API in your Rails app instead of 
> changing the database directly, behind its back. 
>
> +1 - this scenario has "data integrity fail" stamped all over it. 
>
> If you can't avoid having the external process write to the db, at least 
> have it write to *non-model* tables and incorporate the updates from 
> there (via periodic rake task, or whatever). 
>
> Good luck. 
> -- 
> Hassan Schroeder  hassan.s...@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+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/da038294-85a2-4eb0-a15e-d6516810a635%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Connect to MariaDB over SSH tunnel

2014-03-25 Thread Rick

http://www.postgresql.org/docs/9.3/static/ssh-tunnels.html
https://dev.mysql.com/doc/workbench/en/wb-manage-db-connections-ssh.html


On Tuesday, March 25, 2014 7:05:24 AM UTC-4, Ruby-Forum.com User wrote:
>
> Hi everyone, does anybody know how to connect to production DB over ssh 
> tunnel using rails? 
>
> I'm using MariaDB. 
>
> -- 
> 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/0b1c7f2f-f40d-4c5a-9d5a-b0ee1d4ccbd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Text to Hash

2014-03-23 Thread Rick
Assuming your data is in a file named 'list.txt', here's a crude but 
effective way to do it.














*  # initialize your result to an empty hash  result_hash = Hash.new  # 
read in your data one line at a time  File.open('list.txt').each do 
|line|# break the line on commas, less the last (\n) character into 
fields split_line = 
line[0..line.length-2].split(',')# use the first field, less the 
quotes, as the keykey = split_line[0].gsub(/\"/,'')# use the 
remaining fields, joined with commas, less the quotes as the valuevalue 
= split_line[1..split_line.length-1].join(',').gsub(/\"/,'')# merge 
into your result_hashresult_hash.merge!({key => value})  end*

On Sunday, March 23, 2014 3:52:06 PM UTC-4, Shaun Gish wrote:
>
> I'm trying to parse some text to break into a Hash with Key Value pairs.
>
> The text looks like this:
>
> "Business Services","$2,480.31"
> "Shopping","$1,914.75"
> "Home","$1,807.53"
>
> Each string is the key, each dollar amount is the associated value.
>
> How would I break this apart?
>
> (I've tried using split to break the text up on \r\n and , but I can't 
> seem to get the key value association part).
>
> 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/25753eee-5277-4d41-a7c0-10c01909cdfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: Re: How to see .gitignore file in directory?

2014-03-23 Thread Rick
If you open a terminal window you can use the unix command *ls -als* to get 
a long listing of all files in the current directory. In the same terminal 
window the command *man ls *will give you the manual page for the ls 
command.

On Sunday, March 23, 2014 6:11:52 AM UTC-4, Colin Law wrote:
>
> On 23 March 2014 10:08, Jaimin Pandya > 
> wrote: 
> >> Still you have not told us the most important information, which 
> >> operating system are you using (Windows, Ubuntu etc)?  You really 
> >> should be asking this on a Windows or other forum however.  How to see 
> >> hidden files is nothing to do with Ruby on Rails.  The fact that the 
> >> file was created by Rails is irrelevant. 
> >> 
> >> You could try googling for 
> >> how to see hidden files in  
> >> 
> > 
> > Sorry for asking this question in rails. I am using ubuntu operating 
> > system. 
> > 
> > Thank you very much for your help. 
>
> In Nautilus (the file explorer) Ctrl+h will show/hide hidden files, or 
> you can show them via the menus in Nautilus. 
>
> 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+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/91a55a8d-13e6-4f78-bb59-dd61a128d017%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Activity streams/News feeds with Aggregation, MySQL and Redis support

2014-03-21 Thread Rick
require 'simple-rss'
require 'open-uri'

@health_and_science = SimpleRSS.parse 
open("http://www.npr.org/rss/rss.php?id=1007";)
@health_and_science.entries.each do |f|
   printf("NPR Feed: %s %s\n", f.pubDate.to_date, f.title)
end



On Friday, March 21, 2014 1:39:17 PM UTC-4, Kenny Meyer wrote:
>
> Can anyone recommend a gem/library?
>
> On Friday, March 21, 2014 2:38:45 PM UTC-3, Kenny Meyer wrote:
>>
>> I need to implement an activity feed for a Rails application with the 
>> following features:
>>
>>  - Needs to work with MySQL database
>>  - Needs to support aggregations for similar feed stories (like Facebook)
>>  
>> There is a library out there for Python, Feedly 
>> https://github.com/tschellenbach/Feedly, which seems to be an EXACT 
>> match for what I am trying to build, but well.. I need it in Ruby.
>>
>

-- 
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/589cb599-3af7-44a9-b2d5-d9f80fc4f427%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Rails 4 Image fail in production

2014-03-21 Thread Rick
i would put the image in assets/images and refer to it as: 
:url("Jumbotron2.png")

On Tuesday, March 18, 2014 8:45:33 AM UTC-4, mike2r wrote:
>
>
>
> On Tuesday, March 18, 2014 8:01:48 AM UTC-4, Ruby-Forum.com User wrote:
>>
>> mike2r wrote in post #1140207: 
>>
>> > I would probably put the image in public/images/Jumbotron2.png and 
>> > change 
>> > your code the the following: 
>> > 
>> >  $('#jumbotron').css('background-image' 
>> :'url("images/Jumbotron2.png")') 
>>
>> Unfortunately, that does not work in development or production 
>> environments. 
>>
>> Thanks, 
>>
>> Dave 
>>
>> -- 
>> Posted via http://www.ruby-forum.com/. 
>>
>
> sorry, it should have started with the root relative.  i tested this and 
> it works, but the rest of your syntax threw an error, probably because I 
> don't use coffee.  This is the line that worked for me:
>
> $('#jumbotron').css('background-image' , 'url("/images/Jumbotron2.png")') 
>
> note that the colon between 'background-image' and 'url ...' is now a 
> comma.  The path to the image now starts with a slash.  This is the jquery 
> form.  The other format you have with a colon may work in coffee.  At any 
> rate, the path /images/... should work.  sorry, i should have tested this 
> first.
>
> mike
>

-- 
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/a11b8483-220f-4aab-a1f0-26598fd1cc70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] If you were to code a marketplace app like AirBnB today, what technology & stack would you use?

2014-03-21 Thread Rick
I would suggest Solr or MongoDB or (you pick) some other NoSQL db tool as a 
focus for item 4.

Git hard to beat for a source control choice.

You should add automation tools for working your production release 
(installation, backup, error recovery, ...).

On Thursday, March 20, 2014 5:32:00 AM UTC-4, Brandon wrote:
>
> Would you replace any one on my list with something else? Which DB, 
> hosting solution and source control would you use?
>
>
> On Wednesday, March 19, 2014 1:21:41 AM UTC+8, matt wrote:
>>
>> I would add Angular (or another front end framework) and some type of CI.
>> On Mar 18, 2014, at 1:18 PM, Brandon  wrote:
>>
>> So having spent almost a year coding in RoR, I'm thinking of applying 
>> "new stuff" that I didn't get to use in my past projects.
>>
>> Keeping in mind that I want to keep improving my skills and experience so 
>> that someday I can find that elusive remote RoR job, what would you suggest 
>> I use?
>>
>> I have on my list:
>> 1. CoffeeScript
>> 2. Haml
>> 3. Rspec and Capybara
>> 4. Database other than PostgreSQL
>> 5. Hosting other than Heroku
>> 6. BitBucket
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonrails-ta...@googlegroups.com.
>> To post to this group, send email to rubyonra...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/7c7bbd5d-0c2e-4766-aae7-d80900166c43%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+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/773a5c7b-19db-4ff0-bcef-87a867545230%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Substring first name from "User.select(:name, :address)". How?

2014-03-09 Thread Rick
You need some idea of the form of :name. Lets assume it's a whitespace 
separated string like "Brandon Q. Public".  You could simply use ruby's 
String.split. Of course if some users are royalty you could end up with 
lots of users named "Sir" or "Princess".

On Sunday, March 9, 2014 6:54:35 PM UTC-4, Brandon wrote:
>
> I would like to get the first name from :name field below, how do I do 
> that with numerous fields returned?
>
> User.select(:name, :address).where({ id: params[:seller_id]})
>
>
>

-- 
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/4e890e3e-9fa2-4c28-82fd-2e20c749a0e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: Mysql2::Error: Lost connection to MySQL server during query: SELECT

2014-03-05 Thread Rick
Line 265 of mysql2_adapter.rb falls right in the middle of this method 
definition:

  # Executes the SQL statement in the context of this connection.
  def execute(sql, name = nil)
# make sure we carry over any changes to 
ActiveRecord::Base.default_timezone that have been
# made since we established the connection
@connection.query_options[:database_timezone] = 
ActiveRecord::Base.default_timezone
if name == :skip_logging
  @connection.query(sql)
else
  log(sql, name) { @connection.query(sql) }
end
  rescue ActiveRecord::StatementInvalid => exception
if exception.message.split(":").first =~ /Packets out of order/
  raise ActiveRecord::StatementInvalid, "*'Packets out of order' 
error was received from the database. Please update your mysql bindings 
(gem install mysql) and read 
http://dev.mysql.com/doc/mysql/en/password-hashing.html for more 
information.  If you're on Windows, use the Instant Rails installer to get 
the updated mysql bindings."*
else
  raise
end
  end

I added the bold - have you followed the instructions?

On Wednesday, March 5, 2014 10:52:16 AM UTC-5, Rick wrote:
>
> Can you replicate the error on a development system that is connected to a 
> local version of the database? I'm thinking you might want to really hammer 
> on the system and not impact the production db.
>
> On Wednesday, March 5, 2014 10:25:36 AM UTC-5, David Webster wrote:
>>
>> I am using an actual ID, just redacted it for the public post. The MySQL 
>> server is remote. We process hundreds of requests a hour without the error, 
>> but around 1-2 times a hour we get this sort of error. the MySQL DB logs do 
>> not show anything, so I have eliminated it as a cause for this error. There 
>> isn't even a corresponding query in the log on the DB server for this 
>> request, all others are in there. It seems like rails is panicking and 
>> dropping the connection. But i have no way to debug this. The TCP 
>> transactions don't show anything either. I see the requests and responses, 
>> but this error doesn't show up in tcptrace output, so thats why im thinking 
>> rails is not even using a connection from the pool. 
>>  
>>
>>
>>
>>
>>
>>  
>> *David M. Webster*MDLIVE, Inc 
>> *Security Architect , System** Admin*
>> 13630 NW 8th Street *I* Suite 205 *I* Sunrise, Florida 33325
>> Office: 954-251-4471 *I* Mobile: 954-579-7799
>> dweb...@mdlive.com I www.mdlive.com 
>> "Changing the face of medicine"
>>
>>
>> On Wed, Mar 5, 2014 at 10:19 AM, Rick  wrote:
>>
>>> Are you really trying to match a users.id of x or is that just a 
>>> log artifact? Is your MySQL server local or remote? What happens if you 
>>> issue a "Customer.find(x)" in rails console? Obviously you need to 
>>> provide a valid id, not x.
>>>
>>> On Tuesday, March 4, 2014 12:43:35 PM UTC-5, David Webster wrote:
>>>>
>>>>  I keep getting this type of error, and have researched this for weeks 
>>>> on the internet. tried every suggestion and it still persists..
>>>>
>>>>
>>>> An ActiveRecord::StatementInvalid occurred in 
>>>> customer#go_to_consultation:
>>>>
>>>>   Mysql2::Error: Lost connection to MySQL server during query: SELECT 
>>>>  `users`.* FROM `users` WHERE `users`.`id` = x LIMIT 1
>>>>   mysql2 (0.2.18) lib/active_record/connection_a
>>>> dapters/mysql2_adapter.rb:265:in `query'
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> nginx version: nginx/1.2.4
>>>> ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
>>>> Phusion Passenger version 3.0.18
>>>> rails (3.0.20)
>>>> mysql2 (0.2.18)
>>>> activerecord (3.0.20)
>>>> activerecord-import (0.2.11)
>>>> activerecord-mysql2-adapter (0.0.3)
>>>>
>>>> Ubuntu 12.04 (precise)
>>>>
>>>>
>>>>
>>>> other info:
>>>>   * PASSENGER_APP_SPAWNER_IDLE_TIME   : -1
>>>>   * PASSENGER_APP_TYPE: rack
>>>>   * PASSENGER_CONNECT_PASSWORD: [FILTERED]
>>>>   * PASSENGER_DEBUGGER: false
>>>>   * PASSENGER_ENVIRONMENT : production
>>>>   * PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME : -1
>>>>   * PASSENGER_FRIENDLY_ERROR_PAGES: true
>&g

Re: [Rails] Re: Mysql2::Error: Lost connection to MySQL server during query: SELECT

2014-03-05 Thread Rick
Can you replicate the error on a development system that is connected to a 
local version of the database? I'm thinking you might want to really hammer 
on the system and not impact the production db.

On Wednesday, March 5, 2014 10:25:36 AM UTC-5, David Webster wrote:
>
> I am using an actual ID, just redacted it for the public post. The MySQL 
> server is remote. We process hundreds of requests a hour without the error, 
> but around 1-2 times a hour we get this sort of error. the MySQL DB logs do 
> not show anything, so I have eliminated it as a cause for this error. There 
> isn't even a corresponding query in the log on the DB server for this 
> request, all others are in there. It seems like rails is panicking and 
> dropping the connection. But i have no way to debug this. The TCP 
> transactions don't show anything either. I see the requests and responses, 
> but this error doesn't show up in tcptrace output, so thats why im thinking 
> rails is not even using a connection from the pool. 
>  
>
>
>
>
>
>  
> *David M. Webster*MDLIVE, Inc 
> *Security Architect , System** Admin*
> 13630 NW 8th Street *I* Suite 205 *I* Sunrise, Florida 33325
> Office: 954-251-4471 *I* Mobile: 954-579-7799
> dweb...@mdlive.com  I www.mdlive.com 
> "Changing the face of medicine"
>
>
> On Wed, Mar 5, 2014 at 10:19 AM, Rick  >wrote:
>
>> Are you really trying to match a users.id of x or is that just a log 
>> artifact? Is your MySQL server local or remote? What happens if you issue a 
>> "Customer.find(x)" in rails console? Obviously you need to provide a 
>> valid id, not x.
>>
>> On Tuesday, March 4, 2014 12:43:35 PM UTC-5, David Webster wrote:
>>>
>>>  I keep getting this type of error, and have researched this for weeks 
>>> on the internet. tried every suggestion and it still persists..
>>>
>>>
>>> An ActiveRecord::StatementInvalid occurred in 
>>> customer#go_to_consultation:
>>>
>>>   Mysql2::Error: Lost connection to MySQL server during query: SELECT 
>>>  `users`.* FROM `users` WHERE `users`.`id` = x LIMIT 1
>>>   mysql2 (0.2.18) lib/active_record/connection_a
>>> dapters/mysql2_adapter.rb:265:in `query'
>>>
>>>
>>>
>>>
>>>
>>> nginx version: nginx/1.2.4
>>> ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
>>> Phusion Passenger version 3.0.18
>>> rails (3.0.20)
>>> mysql2 (0.2.18)
>>> activerecord (3.0.20)
>>> activerecord-import (0.2.11)
>>> activerecord-mysql2-adapter (0.0.3)
>>>
>>> Ubuntu 12.04 (precise)
>>>
>>>
>>>
>>> other info:
>>>   * PASSENGER_APP_SPAWNER_IDLE_TIME   : -1
>>>   * PASSENGER_APP_TYPE: rack
>>>   * PASSENGER_CONNECT_PASSWORD: [FILTERED]
>>>   * PASSENGER_DEBUGGER: false
>>>   * PASSENGER_ENVIRONMENT : production
>>>   * PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME : -1
>>>   * PASSENGER_FRIENDLY_ERROR_PAGES: true
>>>   * PASSENGER_GROUP   :
>>>   * PASSENGER_MAX_REQUESTS: 0
>>>   * PASSENGER_MIN_INSTANCES   : 2
>>>   * PASSENGER_SHOW_VERSION_IN_HEADER  : true
>>>   * PASSENGER_SPAWN_METHOD: smart-lv2
>>>   * PASSENGER_USER:
>>>   * PASSENGER_USE_GLOBAL_QUEUE: true
>>>
>>>
>>>
>>>   mysql2 (0.2.18) lib/active_record/connection_
>>> adapters/mysql2_adapter.rb:265:in `query'
>>>   mysql2 (0.2.18) lib/active_record/connection_
>>> adapters/mysql2_adapter.rb:265:in `execute'
>>>   activerecord (3.0.20) lib/active_record/connection_
>>> adapters/abstract_adapter.rb:202:in `log_without_newrelic_
>>> instrumentation'
>>>   activesupport (3.0.20) lib/active_support/
>>> notifications/instrumenter.rb:21:in `instrument'
>>>   activerecord (3.0.20) lib/active_record/connection_
>>> adapters/abstract_adapter.rb:200:in `log_without_newrelic_
>>> instrumentation'
>>>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/
>>> instrumentation/active_record.rb:46:in `log'
>>>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/method_tracer.rb:281:in 
>>> `trace_execution_scoped'
>>>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/
>>> instrumentation/active_record.rb:43:

[Rails] Re: Mysql2::Error: Lost connection to MySQL server during query: SELECT

2014-03-05 Thread Rick
Are you really trying to match a users.id of x or is that just a log 
artifact? Is your MySQL server local or remote? What happens if you issue a 
"Customer.find(x)" in rails console? Obviously you need to provide a 
valid id, not x.

On Tuesday, March 4, 2014 12:43:35 PM UTC-5, David Webster wrote:
>
>  I keep getting this type of error, and have researched this for weeks on 
> the internet. tried every suggestion and it still persists..
>
>
> An ActiveRecord::StatementInvalid occurred in customer#go_to_consultation:
>
>   Mysql2::Error: Lost connection to MySQL server during query: SELECT 
>  `users`.* FROM `users` WHERE `users`.`id` = x LIMIT 1
>   mysql2 (0.2.18) 
> lib/active_record/connection_adapters/mysql2_adapter.rb:265:in 
> `query'
>
>
>
>
>
> nginx version: nginx/1.2.4
> ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
> Phusion Passenger version 3.0.18
> rails (3.0.20)
> mysql2 (0.2.18)
> activerecord (3.0.20)
> activerecord-import (0.2.11)
> activerecord-mysql2-adapter (0.0.3)
>
> Ubuntu 12.04 (precise)
>
>
>
> other info:
>   * PASSENGER_APP_SPAWNER_IDLE_TIME   : -1
>   * PASSENGER_APP_TYPE: rack
>   * PASSENGER_CONNECT_PASSWORD: [FILTERED]
>   * PASSENGER_DEBUGGER: false
>   * PASSENGER_ENVIRONMENT : production
>   * PASSENGER_FRAMEWORK_SPAWNER_IDLE_TIME : -1
>   * PASSENGER_FRIENDLY_ERROR_PAGES: true
>   * PASSENGER_GROUP   :
>   * PASSENGER_MAX_REQUESTS: 0
>   * PASSENGER_MIN_INSTANCES   : 2
>   * PASSENGER_SHOW_VERSION_IN_HEADER  : true
>   * PASSENGER_SPAWN_METHOD: smart-lv2
>   * PASSENGER_USER:
>   * PASSENGER_USE_GLOBAL_QUEUE: true
>
>
>
>   mysql2 (0.2.18) 
> lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `query'
>   mysql2 (0.2.18) 
> lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `execute'
>   activerecord (3.0.20) 
> lib/active_record/connection_adapters/abstract_adapter.rb:202:in 
> `log_without_newrelic_instrumentation'
>   activesupport (3.0.20) 
> lib/active_support/notifications/instrumenter.rb:21:in `instrument'
>   activerecord (3.0.20) 
> lib/active_record/connection_adapters/abstract_adapter.rb:200:in 
> `log_without_newrelic_instrumentation'
>   newrelic_rpm (3.7.2.192) 
> lib/new_relic/agent/instrumentation/active_record.rb:46:in `log'
>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/method_tracer.rb:281:in 
> `trace_execution_scoped'
>   newrelic_rpm (3.7.2.192) 
> lib/new_relic/agent/instrumentation/active_record.rb:43:in `log'
>   mysql2 (0.2.18) 
> lib/active_record/connection_adapters/mysql2_adapter.rb:265:in `execute'
>   mysql2 (0.2.18) 
> lib/active_record/connection_adapters/mysql2_adapter.rb:586:in `select'
>   activerecord (3.0.20) 
> lib/active_record/connection_adapters/abstract/database_statements.rb:7:in 
> `select_all'
>   activerecord (3.0.20) 
> lib/active_record/connection_adapters/abstract/query_cache.rb:54:in 
> `select_all'
>   activerecord (3.0.20) 
> lib/active_record/connection_adapters/abstract/query_cache.rb:68:in 
> `cache_sql'
>   activerecord (3.0.20) 
> lib/active_record/connection_adapters/abstract/query_cache.rb:54:in 
> `select_all'
>   activerecord (3.0.20) lib/active_record/base.rb:473:in 
> `find_by_sql_without_trace_ActiveRecord_self_name_find_by_sql'
>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/method_tracer.rb:549:in 
> `find_by_sql'
>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/method_tracer.rb:281:in 
> `trace_execution_scoped'
>   newrelic_rpm (3.7.2.192) lib/new_relic/agent/method_tracer.rb:544:in 
> `find_by_sql'
>   activerecord (3.0.20) lib/active_record/relation.rb:64:in `to_a'
>   activerecord (3.0.20) 
> lib/active_record/relation/finder_methods.rb:343:in `find_first'
>   activerecord (3.0.20) 
> lib/active_record/relation/finder_methods.rb:122:in `first'
>   activerecord (3.0.20) 
> lib/active_record/relation/finder_methods.rb:244:in `send'
>   activerecord (3.0.20) 
> lib/active_record/relation/finder_methods.rb:244:in `find_by_attributes'
>   activerecord (3.0.20) lib/active_record/base.rb:997:in `send'
>   activerecord (3.0.20) lib/active_record/base.rb:997:in `method_missing'
>   lib/authenticated_system.rb:11:in `current_user'
>   app/controllers/application_controller.rb:16:in `load_org_hash'
>   activesupport (3.0.20) lib/active_support/callbacks.rb:447:in 
> `_run__1783524324__process_action__741958110__callbacks'
>   activesupport (3.0.20) lib/active_support/callbacks.rb:410:in `send'
>   activesupport (3.0.20) lib/active_support/callbacks.rb:410:in 
> `_run_process_action_callbacks'
>   activesupport (3.0.20) lib/active_support/callbacks.rb:94:in `send'
>   activesupport (3.0.20) lib/active_support/callbacks.rb:94:in 
> `run_callbacks'
>   actionpack (3.0.20) lib/abstract_controller/callbacks.rb:17:in 
> `process_a

[Rails] Re: navigation list order by

2014-03-04 Thread Rick


On Tuesday, March 4, 2014 12:04:46 PM UTC-5, Steven Cahill wrote:
>
> Thanks Rick
>
> on the actual categories page the categories are listed in category_id 
> order correctly, I have the following code in my controller 
>
>   # GET /categories
>   # GET /categories.json
>   def index
> @categories = Category.order('id asc')
>   end
>
> The only problem is the navigation list that I have put into the 
> application layout page seems to have a mind of its own, here is the code 
> for 
>
>  
If, by "application layout page" you mean 
app/views/catagories/index.html.erb, use @categories.each 
*not*Category.all.each.



>

-- 
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/97d02951-07b2-4e8c-b538-3fbfe86c7ffa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] What are the best strategies/practices for Rails upgradation from 2.3.11 to 4.0.0?

2014-03-04 Thread Rick
Step zero point one is to review your 6/7 plugins and 5/6 gems and ensure 
they've been moved forward to your final target.

On Tuesday, March 4, 2014 4:05:51 AM UTC-5, Colin Law wrote:
>
> On 4 March 2014 05:09, Raju Ay > 
> wrote: 
> > I would like to upgrade one of my application from rails -2.3.11 to 
> 4.0.0. 
> > Before going to do anything, I just need plan for it and my application 
> not 
> > that much of big size but got some 6/7 plugins and 5/6 gems. 
> > 
> > Existed: Ruby 1.8.7 + Rails 2.3.11 
> >   Expected : Ruby 2.0.0 + Rails 4.0.0 
> > 
> >For this, I have plan as in two ways like below, 
> >1).Multi-step process : First need to upgrade app from rails 2.* to 
> 3.* 
> > and then 
> >   do upgrade from rails 3.* to 4.0.0 
> >2).Create new application from rails - 4.0.0 and rebuild old 
> application 
> > all 
> >   features as we have already css, layouts... 
> > 
> > 
> >I hope both strategies will take same time. 
> > 
> >  Any how, I need some inputs from you all. So please share your 
> > thoughts/comments. 
>
> Step zero is to make sure that you have full test coverage so that you 
> can be confident the app continues to work correctly. 
>
> 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+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/a894903b-06bf-493d-8e94-fac2a8f5e388%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: navigation list order by

2014-03-04 Thread Rick
Not sure from your question, you seem to be asking "How do I sort the 
Categories index?" but you've provided a link_to that deals with a single 
Category. Typically, you'ld order your Categories in the controller index 
method and the ordered list would be available in the index.html.erb view 
as @categories. You could then step through this list in your view with 
@catagories.each do |category|.

If that's what you've done then "category" (in your link_to) should be the 
id of a single category.

At any rate, you would really help yourself by getting familiar with the 
Rails Guides at http:guides.rubyonrails.org.


On Tuesday, March 4, 2014 5:25:54 AM UTC-5, Steven Cahill wrote:
>
> Hello Everybody
>
> I have a navigation that draws data from a category table, I would like to 
> display the navigation by category ID order, this is the code I have so far
>
> <%= link_to category.title, category_path(category) %> in the view
>
> not sure where to go next to get order by category id
>
> Steven
>
>

-- 
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/f8397571-a06a-4a16-92c1-570b200cadd5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: Is it possible to backup Solr

2014-03-03 Thread Rick
you might look here: http://wiki.apache.org/solr/SolrReplication

On Monday, March 3, 2014 12:22:43 AM UTC-5, Ruby-Forum.com User wrote:
>
> Hello People, 
>
> In one of my rails projects I use solr via sunspot gem. I was wondering 
> if its possible to back up solr indexing so that when I move from one 
> server to another things remain the same and reindexing could be 
> avoided. 
>
> Currently we use Ubuntu 12.04 LTS for our deployments. 
>
>
>  
>
> Regards 
>
> Karthikeyan A K 
>
> -- 
> 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/28e07b89-fdb8-4794-895c-7917f9deacc4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Re: Coffee Script Sucks

2014-03-02 Thread Rick
not unlike swimming out of a black hole. good exercise but you're unlikely 
to cross the boundary to normal.


On Saturday, March 1, 2014 1:05:40 PM UTC-5, Rodrigo Mendonça wrote:
>
> I think oposite
>
> in js true == "true" // this return true
> in coffee true == "true" # return false
>
> in js we need true ==*=* "true" // only this return false
>
> I think if coffee is bad, javascript is worst.
>
>
> 2014-03-01 14:28 GMT-03:00 deepak >:
>
>> agree, no explanation needed.
>>
>>
>> On Saturday, March 1, 2014 9:35:29 PM UTC+5:30, Jerry Arns wrote:
>>>
>>> Yea, that's all I wanted to say.
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonrails-ta...@googlegroups.com .
>> To post to this group, send email to 
>> rubyonra...@googlegroups.com
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/rubyonrails-talk/f3a90a79-cbfb-4f58-8869-d837344c2f6e%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+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/180788b5-805d-4400-873a-35ccc6daca2a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: strange mysql/webrick issue with rails 3.2.8 and ruby 1.8.7

2014-03-01 Thread Rick
It's been a while since I last struggled with the 1.8.7 / 1.9 ruby 
transition with rails 3 and mysql but I'm wondering. Is it possible you 
have a version issue in the 'gem install...' sequence that's causing your 
rails app not to connect to mysql?


On Wednesday, February 26, 2014 11:34:52 AM UTC-5, Azroth wrote:
>
> got a strange issue on my development local machine, webrick idle 
> http://0.0.0.0:3000 at .../statuses url link of rails welcome aboard 
> page, and I can't see rails logo, seems a mysql2 connection fault, from my 
> local machine I hit a remote mysql database, but I verified mysql remote 
> access to my remote server, it's ok, verified socket, ok, no firewall 
> blocks, etc.
>
> and when I try to close webrick can't shutdown with ctrl-C, I have to hit 
> ctrl-C and ctrl-Z to shutdown correctly.
>
> OS independent, same issue, same setup - Aptana Studio 3, rails 3.2.8, 
> ruby 1.8.7 - on CentOS 6.5 and Ubuntu 12.04
>
> BUT
> NO ISSUE with a different setup - rails 3.2.8 and ruby 1.9.2 (or 2.x) -
>
> what's up?
>
> I need my project working with ruby 1.8.7 because of phusion passenger 
> dependencies on my RHEL server
>

-- 
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/e485d287-49d3-4f61-9f78-e463b7a19477%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: harmony gem issue

2014-02-27 Thread Rick
looks like the harmony gem depends on the  johnson gem which depends on 
nodejs which, of course, isn't a gem. try installing nodejs - see: 
nodejs.org.

rick

On Monday, February 24, 2014 5:50:07 AM UTC-5, saravanan p wrote:
>
> Hello everyone,
>
> saravanan@ubuntu:~$ ruby -v
> ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
> saravanan@ubuntu:~$ rails -v
> Rails 4.0.3
> saravanan@ubuntu:~$ rvm -v
>
> rvm 1.24.4 (stable) by Wayne E. Seguin >, 
> Michal Papis > [https://rvm.io/]
>
> *I am trying to install "harmony" gem for data scraping.*
>
> saravanan@ubuntu:~$ gem install harmony
> Building native extensions.  This could take a while...
> ERROR:  Error installing harmony:
> ERROR: Failed to build gem native extension.
>
> /home/saravanan/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
> creating cache ./config.cache
> checking host system type... x86_64-unknown-linux-gnu
> checking target system type... x86_64-unknown-linux-gnu
> checking build system type... x86_64-unknown-linux-gnu
> checking for mawk... mawk
> checking for gcc... gcc
> checking whether the C compiler (gcc  ) works... yes
> checking whether the C compiler (gcc  ) is a cross-compiler... no
> checking whether we are using GNU C... yes
> checking whether gcc accepts -g... yes
> checking for c++... c++
> checking whether the C++ compiler (c++  ) works... yes
> checking whether the C++ compiler (c++  ) is a cross-compiler... no
> checking whether we are using GNU C++... yes
> checking whether c++ accepts -g... yes
> checking for ranlib... ranlib
> checking for as... /usr/bin/as
> checking for ar... ar
> checking for ld... ld
> checking for strip... strip
> checking for windres... no
> checking whether gcc and cc understand -c and -o together... yes
> checking how to run the C preprocessor... gcc -E
> checking how to run the C++ preprocessor... c++ -E
> checking for a BSD compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
> checking for perl5... no
> checking for perl... /usr/bin/perl
> checking for minimum required perl version >= 5.006... 5.014002
> checking for full perl installation... yes
> checking for python... /usr/bin/python
> checking for doxygen... :
> checking for whoami... /usr/bin/whoami
> checking for autoconf... /usr/bin/autoconf
> checking for unzip... /usr/bin/unzip
> checking for zip... /usr/bin/zip
> checking for makedepend... no
> checking for xargs... /usr/bin/xargs
> checking for gmake... no
> checking for make... /usr/bin/make
> checking for X... libraries , headers 
> checking for dnet_ntoa in -ldnet... no
> checking for dnet_ntoa in -ldnet_stub... no
> checking for gethostbyname... yes
> checking for connect... yes
> checking for remove... yes
> checking for shmat... yes
> checking for IceConnectionNumber in -lICE... yes
> checking whether the compiler supports -Wno-invalid-offsetof... yes
> checking whether the compiler supports -Wno-variadic-macros... yes
> checking whether ld has archive extraction flags... yes
> checking that static assertion macros used in autoconf tests work... yes
> checking for 64-bit OS... yes
> checking for ANSI C header files... yes
> checking for working const... yes
> checking for mode_t... yes
> checking for off_t... yes
> checking for pid_t... yes
> checking for size_t... yes
> checking for st_blksize in struct stat... yes
> checking for siginfo_t... yes
> checking for stdint.h... yes
> checking for the size of void*... 8
> checking for the alignment of void*... 8
> checking for the size of double... 8
> checking for int16_t... yes
> checking for int32_t... yes
> checking for int64_t... yes
> checking for int64... no
> checking for uint... yes
> checking for uint_t... no
> checking for uint16_t... no
> checking for uname.domainname... yes
> checking for uname.__domainname... no
> checking for visibility(hidden) attribute... yes
> checking for visibility(default) attribute... yes
> checking for visibility pragma support... yes
> checking For gcc visibility bug with class-level attributes (GCC bug 
> 26905)... no
> checking For x86_64 gcc visibility bug with builtins (GCC bug 20297)... no
> checking for dirent.h that defines DIR... yes
> checking for opendir in -ldir... no
> checking for sys/byteorder.h... no
> checking for compat.h... no
> checking for getopt.h... yes
> checking for sys/bitypes.h... yes
> checking for memory.h... yes
> checking for unistd.h... yes
> checking for gnu/libc-version.h... yes
> checking for nl_types.h... yes
> checking for malloc.h... yes
> checking for X11/XKBlib.h... yes
> checking for sys/statvfs.h... yes
> checking for sys/statfs.h... yes
> che

Re: [Rails] OT: buying a Mac computer

2014-02-26 Thread Rick
Some thoughts.

Macs do cost more than the alternative but I've found them to be well worth 
the cost difference. I have never been comfortable with what passes for 
(hardware or software) support on the PC side of the computiverse. That 
said, Linux and the rest of the open software world make a very solid 
development base if you can puzzle out a stable hardware base.

I've packed my MBP across the country on the back of a motorcycle more than 
once and it just works. It was new in 2010 and has always had the most 
current (developer) release of software installed.

I would buy new - I'm still using an iMac from 2004. It's PowerPC based and 
doesn't run the latest version of anything but Firefox. Still works great 
for music and movies though. If you buy an old machine it will be eclipsed 
by the software long before you'ld like.

I would also invest in a Mac developer's license - it's worth the cost to 
be close to the Apple development community.

Rick

On Wednesday, February 26, 2014 5:46:22 AM UTC-5, Peter Hickman wrote:
>
> Speaking as a long time Mac user I have to say that if you are comfortable 
> with Linux on a cheap laptop then there is very little *more* you would get 
> as a Rails developer in moving to a Mac.
>
> If you are deploying to a Linux server (as opposed to a Windows server) 
> then a Linux laptop will get you to a comfortable place to do your work. 
> The extra you get from using a Mac is probably all in the mind :)
>
> Having said that all the Macs I have ever owned have been ultra reliable 
> and lasted years before they needs to be replaced (which has more to do 
> with technolust and a credit card burning a hole in my pocket than any real 
> need). However I tend to view PC hardware as disposable and if they last 
> two years I will consider myself blessed. PC build quality tends to be 
> abysmal unless you are prepared to fork out a great deal of money.
>
> TL;DR
>
> A Linux laptop is 99% of what you need. The 1% more you would get from a 
> Mac could be a very expensive 1%
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+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/4fea4e7f-26c1-461c-b1ec-034809d2bfd3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: New to Ruby? Learn about Code blocks, Symbols and Syntactic Sugar

2014-02-19 Thread Rick
This announcement surfaced back in the late seventies:

"*CAUTION*: *The Programmer General has advised that excessive use of 
Syntactic Sugar has been shown to lead to Hardening of the Semi-Colon*."

It has never been retracted, as far as I know.

On Wednesday, February 19, 2014 10:09:27 AM UTC-5, Wale Olaleye wrote:
>
> A few months ago I wrote a post about Ruby Code blocks, Symbols and 
> Syntactic Sugar. They serve as a gentle introduction to 3 interesting Ruby 
> features. If you are coming from a different language, or a new to 
> programming, I think you will find the post interesting. Feel free to leave 
> a comment on my blog if you like this.
>
>
> http://www.railsfever.com/blogs/code-blocks-symbols-and-ruby-syntactic-sugar
>
> -Wale
>

-- 
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/fdfc343b-f78a-420f-a9cc-416d230133ec%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: Need help -FATAL: database "catarse_development" does not exist

2014-02-18 Thread Rick
you want to do: rake db:create

On Tuesday, February 18, 2014 5:08:05 AM UTC-5, Ruby-Forum.com User wrote:
>
> Hi i try to do that createdb mytestdb 
> [root@localhost catarse]# createdb mytestdb 
> createdb: could not connect to database postgres: FATAL:  role "root" 
> does not exist 
> give this Errer 
> thanks 
>
> -- 
> 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/c3d8108d-790b-4e1e-bd3c-88b2dea0b5d5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: Best way to securely connect to remote Postgres server from Rails.

2014-02-16 Thread Rick


On Saturday, February 15, 2014 4:46:54 PM UTC-5, Eric Hayes wrote:
>
>
> I'm wonder how most people securely connect to a Postgres database on a 
> server separate from the app server.
>
> The ActiveRecord docs for a MySQL connection have explicit SSL options, 
> whereas with Postgres it seems one would pass SSL options as documented for 
> libpq.
>
> However a quick Googling returns SO threads with suggestions to use SSH 
> tunnels. Which I guess could be managed with something like AutoSSH.
>
> I'd love to hear from anyone with experience with this. Is one method 
> faster than the other, or easier to maintain? —Thanks!
>

If your remote PostgreSQL server has ssl capability compiled in (look for 
Secure TCP/IP Connections with SSL in the PostgreSQL docs), this would be 
the preferred way to go. The connection status is visible to your app 
because the secure channel is established between libpg and the remote 
host. Running through an SSH tunnel has the added baggage of startup and 
health monitoring, along with a restart policy as required. There may also 
be a run time penalty (not sure on this one) on communication cost. In 
either case, you want to use an MD5 password to establish the connection to 
the server.

You should probably get familiar with the normal PostgreSQL options and 
start a conversation with your server provider.

Rick

-- 
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/50f329f3-90ba-4aaf-b030-cb6dad1a2ff2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: How to put everything from directory into assets as subdirectory

2014-01-27 Thread Rick


On Monday, January 27, 2014 5:00:27 AM UTC-5, Ruby-Forum.com User wrote:
>
> By everything I mean everything. Untouched by assets pipeline. 
>
> External javascript libraries, like CK Editor for example, dynamicly 
> load javascript and css in runtime, depending on settings. So compiling 
> them with assets pipeline into one file makes no sense, even worse it 
> doesn't work at all. 
>
> Is there a mechanizm in rails to copy all files from ex. 
> ../gems/../lib/assets/ck_editor to ../assets/ck_editor directory. 
>
> It is hard to automate copying since it is a moving target, due to gems 
> versions, so it has to be done by hand. 
>
> Funny thing is that everything works in development, but of course not 
> in production, since assets pipeline has no mechanizm to move whole 
> directory into assets directory. 
>
> Or have I missed something obvious? 
>
>
> The third paragraph in the Rails Guided titled "The Asset Pipeline" has 
this to say:

*The asset pipeline is enabled by default. It can be disabled in 
config/application.rb by putting this line inside the application class 
definition:*
 *config.assets.enabled = false*
 

*You can also disable the asset pipeline while creating a new application 
by passing the --skip-sprockets option.*
 *rails new appname --skip-sprockets*
 

*You should use the defaults for all new applications unless you have a 
specific reason to avoid the asset pipeline.*
Have you tried either of these? 

> by 
> TheR 
>
> -- 
> 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/82c4bee5-aa1f-4b99-bd2c-3c04d11f9d3f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: has_and_belongs_to_many and updated_at

2014-01-24 Thread Rick


On Thursday, January 23, 2014 11:46:03 AM UTC-5, Martin wrote:
>
> Hi there,
>
> When I have a model with 
>
> has_and_belongs_to_many :keywords
>
> and a keyword is added or removed, how can I make it to update its 
> updated_at timestamp?
>

Hard to say without knowing what "it" you expect to see updated.
 

>
> Thanks,
> Martin
>

-- 
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/1268a55f-5a0f-4fde-9232-c066fd29ddd0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: no _dump_data is defined for class Mysql2::Result

2014-01-24 Thread Rick
you might do better with the Ruby on Rails: Core group...

On Friday, January 24, 2014 12:44:22 AM UTC-5, Anand Vignesh wrote:
>
> Hi there,
>
> I'm Vignesh developer @ Rails application. I was now getting an issue 
> while I'm migrating my existing application with rails '3.2.13' into rails 
> '4.1.beta1' .
>
> This was my issue while i m signing in into my application 
>
> no _dump_data is defined for class Mysql2::Result
>
>
> So if anyone could have some idea about the issue. Please share your ideas 
> and it may be helpful for fixing it. :)
>
>
> Thanks,
>
> Vignesh. 
>

-- 
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/0475730d-b0a5-4719-92b8-9bd9c5775384%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: [Need advice] Dynamic URL pointing at controllers action

2014-01-24 Thread Rick
You might consider having a link_to testimonials within a project view that 
would provide a list of prior responses related to that project and a 
link_to request_testimonial if none exists.  You should keep all project 
customer information private to the customer / developer team and only 
allow the customer to release their email.

Map out roles for admin, developer, customer, registered_user, and 
visiting_user and identify what each will be allowed to see and do.  Go 
through an authentication step to separate the visiting_user from the 
others and then use authorization to bind the other roles to appropriate 
actions.

On Thursday, January 23, 2014 6:18:22 PM UTC-5, Ruby-Forum.com User wrote:
>
> First of all sorry for the confusing title. I don't really know how to 
> explain what I want to do in one line. 
>
> I am creating a Rails website in which Developers will be able to be 
> listed and create profiles. In the profile page, users will be able to 
> upload their projects into their portfolio. Then the customer(s) (whom 
> the developer created this project for) will be able to submit a 
> testimonial on that particular project. 
>
> My goal is that only that customer will be able to submit an endorsement 
> on the project added to the portfolio. 
>
> As I said, I only need the specific customer to be able to submit a 
> testimonial so what I thought is that the user will input the customer's 
> email on a form and then the customer will receive an email with a 
> dynamic link to the website for making the testimonial. This link should 
> point to testimonial's new action so that the customer will be able to 
> submit the endorsement. 
>
> My issue right now is how do I do something like that in Rails? How will 
> I create a dynamic link to point to the page that will render 
> testimonial form? 
>
> Also another idea is to just send (via email) a PIN code to the customer 
> so he will just need to input the correct PIN in order that the 
> endorsement will be created. 
>
> I am also open to ideas. I like simple implementations so if you have 
> one in mind, please feel free to share :) 
>
> Thanks 
>
> -- 
> 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/760eec48-5021-450a-bc30-0113a4ecc79a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: Expose complex dynamic queries over REST

2014-01-13 Thread Rick
One approach would be to define a domain specific language and implement a 
compiler.  This would give you an opportunity to check both the form 
(lexical scanner) and content (syntax checker) of the user input and map 
all legal requests on your data.

For obvious reasons, this language should not include the ability to pass 
SQL statements intact from the user to your database.  But you could allow 
the user to implement a nice custom report generator to support analysis.

Racc is the gem capturing the syntax, it continues the tradition of 
recasting Stephen Johnson's YACC, which itself built on Donald Knuth's 
work.  There isn't a lex/flex gem but ruby provides good support for 
lexical analysis. 

On Friday, January 10, 2014 3:14:52 PM UTC-5, Colin Taylor wrote:
>
> I'm trying to build a web application for data analysis. The client can 
> send ad-hoc queries to my back-end data service. For example:
>
> (foo >= 10 OR bar == 'baz') AND bat < 10
>
> Is there a rails/activerecord standard for sending this type of query 
> through REST? A DAO / method_missing won't work because there are an 
> infinite number of permutations per model (e.g. an arbitrary number of 
> attributes, clauses, etc). Is there something that could take a 
> "Lucene-like" query string and construct an activerecord request? Or do I 
> just have to manually parse it myself?
>

-- 
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/61f7a5b6-188c-4cb0-b35f-c071634deecc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] File rename - permision denied

2014-01-13 Thread Rick
didn't realize you were on a windows box - life can be somewhat less 
rational there.  unix has used the same permissions model and change 
commands since it's inception in 1970.  calcs showed up sometime around 
windows2000/xp and has now been depricated for use on windows7.  

here's a thread that you might find helpful; 
http://stackoverflow.com/questions/9113206/cacls-windows-7-full-permissions-local-names

you could save yourself much heartache (measured in decades) and build 
yourself a linux box. microsoft does not make a software development 
environment, they only make money.


On Monday, January 13, 2014 5:28:33 PM UTC-5, vuk...@gmail.com wrote:
>
> Hi
>
> I changed the permissions of the directory from my command prompt (using 
> Windows). Used this command:
>
> cacls path\folder   /t /e /g Everyone:f 
>
> And I got the same message "Permission Denied".
>
> On Monday, January 13, 2014 1:36:02 PM UTC+1, James Turley wrote:
>>
>> File.chmod will presumably only work if your Ruby process is being 
>> executed by a user with the required permissions to run chmod in the first 
>> place; I suspect not in this case. Change the permissions on the directory 
>> with your files in so that user can access it, using the shell.
>>
>>
>> On Mon, Jan 13, 2014 at 12:08 PM,  wrote:
>>
>>> Hi
>>>
>>> I want to change the filename with File.rename but I get "Permission 
>>> denied" eve if I change the file with File.chmod(-777, "path/filename")
>>>
>>> I want to do this, to change the name of the image uploaded by 
>>> Paperclip. 
>>>
>>> If you have any sugestion or solution, write me.
>>>
>>> Thanks.
>>>
>>> Darko
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to rubyonrails-ta...@googlegroups.com.
>>> To post to this group, send email to rubyonra...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/rubyonrails-talk/d0d5aa70-eb57-4a87-8730-61328c44d9fa%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+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/d363b79b-a551-4fda-9dad-572c50cdd422%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: File rename - permision denied

2014-01-13 Thread Rick
When changing a file's name you need to have write permission on the 
containing directory.

On Monday, January 13, 2014 7:08:35 AM UTC-5, vuk...@gmail.com wrote:
>
> Hi
>
> I want to change the filename with File.rename but I get "Permission 
> denied" eve if I change the file with File.chmod(-777, "path/filename")
>
> I want to do this, to change the name of the image uploaded by Paperclip. 
>
> If you have any sugestion or solution, write me.
>
> Thanks.
>
> Darko
>

-- 
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/67f589e8-d19f-4989-a912-9f8c9fa29f01%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: How can I get migrate to grant privs to another db user? (was: how can I separate DBA and app users)

2014-01-10 Thread Rick


On Thursday, January 9, 2014 3:04:59 PM UTC-5, Marc Munro wrote:
>
> Following up on my original post, with another question.  Thanks to Walter 
> and Rick for replying earlier.
>
> To clarify: my database is PostgreSQL.  By database objects I mean tables, 
> views, schemas, triggers, functions, roles, etc.
>
> The application should have no rights to perform DDL: it should not be 
> able to create or modify any database objects.  It can only perform queries 
> and run DML (ie CRUD operations).  I want to enforce this within the 
> database as part of our security policy.  In every system I have worked on, 
> this is considered a minimal best practice for security.  And I've been 
> doing database administration and security for a good number of years.
>
> So, the database user for the app must not have the rights to perform 
> migrations.   Yet I still want to perform migrations.
>
> This is what I have so far.  In config/database.yml I have 2 stanzas:
>
>   development:
> adapter: postgresql
> database: blog
> username: blog
>
>   development_dba:
> adapter: postgresql
> database: blog
> username: blog_owner
>
> My default database is development, so my rails app connects using the 
> blog user (role).  This user has minimal privileges.
>
> In order to run migrations I do this:
>
>   $ rake db:migrate RAILS_ENV=development_dba
>
> This uses the more privileged blog_owner account which will own all of the 
> database objects it creates and has the rights necessary to create them.
>
> This works fine, except that the migration does not give any privileges to 
> the blog user, so it cannot see the tables.  I can manually grant the 
> necessary privileges after the migration is run but that's dumb.
>
> My question now is: how can I tell the migration process to grant 
> privileges, on the objects it creates, to the blog user?
>
> __
> Marc
>
> You might want to take a look at postgres' GRANT SELECT ON TABLE in the 
PostgreSQL manual.

-- 
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/8d5d29e8-0d17-4ff1-8e49-979c39b0a7ed%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: How can I separate the db DBA user and the db app user

2013-12-31 Thread Rick


On Monday, December 30, 2013 5:26:45 PM UTC-5, Marc Munro wrote:
>
> How can I separate the database DBA user and app access user in rails?  
> The app user will be able to run the app but perform no DDL.  The DBA user 
> will be used for migrations.
>
> I do not want the user that runs the rails app to be able to create, drop 
> or modify database objects.  This type of user access-rights separation is 
> a pretty minimal best practice and I am concerned that this does not seem 
> to be the norm in the rails world.  What am I missing?
>
> My current thinking is that I should create 2 stanzas per database in the 
> database.yml file.  One for the dba user and one for the normal app user.  
> Does anyone have any better suggestions?
>
> __
> Marc
>
> You need to be a little more specific re what you mean by 'database 
objects'.  

When talking about db/migrate type activities, you are concerned with 
creating, modifying, and dropping tables.  These actions are usually 
(except for sqlite) controlled by permissions associated with a database 
role.  If the db role (username in the database.yml file) has create or 
alter privileges associated with it that user will be able to run 
migrations.  That said, migrations are not typically (or should they be) 
run from within a rails app.

When talking about db record level activities, which correspond to 
ActiveRecord model CRUD actions, you are again faced with the need to 
modify an existing table.  These changes, made in the context of a running 
rails app, are typically limited to table content (rather than form).  The 
db role (username in the database.yml) must be able to modify the database 
tables.

You get finer grained control within the rails app by using an 
authorization scheme (declarative_authorization and cancan gems) together 
with model associations (user has profile, profile belongs to user) to 
control access to data.

-- 
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/cf2be7c1-d673-42a5-b3b6-34877b5eaf03%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] state_machine prevents ActiveRecord from being persisted

2013-12-03 Thread Rick
It sounds like you're in a tangle between FSM states and ActiveRecord 
states.  You might need to add a payment_queued state that forces an AR 
save before transitioning to do_pay.  You could then add some logic that 
fires a loop back to through do_pay (retry n times after increasing 
timeout) before failing.

On Thursday, January 28, 2010 3:06:47 PM UTC-5, FFighter wrote:
>
> Hi Joel, thanks for the reply.
>
> The system is working well. My problem is with the state_machine gem. If 
> the payment fails, I can't really get it saved without doing the hack I 
> mentioned, becase the state_machine implementation rollback any db 
> transaction when you return false from an event, however, I have to return 
> false to tell the subscription object that the payment has failed, hence, 
> the subscription upgrade fails, and state_machine rollback.
>
> It has been solved (with that hack) but I  just wanted to know if there 
> was a more elegant non-hackish way to do that with state_machine.
>
> Regards,
>
> Marcelo.
>
> On Wed, Jan 27, 2010 at 9:09 AM, Joel Dezenzio 
> > wrote:
>
>> What type of payment system are you using?  IPN?
>>
>> If so, then once the payment reaches the payment gateway and the customer
>> finishes paying, you check the status of the payment received and if
>> successful, you change the subscription based off the amount(s) received.
>> You are supplying information but you aren't supplying any actual methods 
>> so
>> that we can review what you are doing.  I use an IPN system for one of my
>> sites and do the above.  I'd love to help you out but without seeing code
>> and how things are actually working with your controllers/models, I can't.
>>
>> Sincerely,
>>
>> Joel Dezenzio
>> Website Bio:  http://jdezenzio.com/
>> Rails Production Sites:  http://ncaastatpages.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to 
>> rubyonra...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> rubyonrails-ta...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>

-- 
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/9aa88aa9-4b2a-4c11-b45c-45b9bcdd9478%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Re: not able to find Gem file netbeans

2013-09-01 Thread Rick


On Friday, August 30, 2013 12:31:18 PM UTC-4, Ruby-Forum.com User wrote:
>
> Hi, 
>
> I am a newbie to Ruby. I have installed and set up Netbeans in windows 
> 7. I have created a new project but i am not able to see Gemfile in the 
> project tree view. can some one help me. 
>
> thanks 
> vijay 
>
> -- 
> Posted via http://www.ruby-forum.com/. 
>

You'll have best results if you post this question to the Netbeans group.  
It's really a netbeans configuration issue not ruby (or rails). 

-- 
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/8cab67f9-cb85-49e7-80c9-b784880ae98b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Rails tutorial; CRD working, U failing

2013-08-22 Thread rick . toews
Using http://guides.rubyonrails.org/getting_started.html as a guide. 
 Create, Read, Delete all work.  Update fails:

NoMethodError in WordsController#update

private method `update' called for #

(I chose to make a list of words rather than of posts.)


The Request parameters:

{"utf8"=>"✓",
 "_method"=>"put",
 "authenticity_token"=>"HizJaASbs53QXfgRZk8SbZ+6OcDigR7LtDtpEGHXwMY=",
 "word"=>{"word"=>"feline",
 "definition"=>"Like a cat; stealthy"},
 "commit"=>"Update Word",
 "id"=>"3"}

The "update" method from the controller:

class WordsController < ApplicationController
...
  def update
@word = Word.find(params[:id])

if @word.update(params[:definition])
  redirect_to @word
else
  render 'edit'
end
  end


rake routes:
...
  PUT/words/:id(.:format)words#update
...

Context information:
rails -v
Rails 3.2.2

ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]

In case relevant:  CentOS release 5.5 (Final)


I'm sure this is a simple thing and may have to do with a different version 
of Rails.  However, I've not had success pursuing that line.

Does anyone have a good idea why I'd be getting the error on the update 
method?

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/95377e22-3471-4e3a-9d19-a331eb4dd3df%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Multiple scope routes

2013-08-21 Thread Rick Cockerham
Here's an interesting question that I'm not sure has an answer.  I would
like a controller to be accessed by multiple URL's within Rails.

example.com/crm/users/1
example.com/admin/users/1

They should both show the same page.

This works, but is an anti-DRY solution:
  scope "/crm" do
 resources :users
  end
  scope "/admin" do
 resources :users
  end

The solution I'm thinking of is to rewrite using Apache.  But, first I'd
like to know if I can do this within the routes because I have many
apache configs, but just one route file.

Thanks,
Rick

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


[Rails] Re: Thoughts on a domain based white label app?

2013-08-15 Thread Rick Schmitty
Dave Aronson wrote in post #1118796:

> I've done a similar thing before, and no you don't have to sprinkle
> client-choosing logic throughout your views.  What we did, to enable
> mobile-friendly views IF the client was on the mobile domain, was to
> check the domain and, if it was the mobile one, simply prepend a
> mobile-friendly dir onto the view path.  That included the layout,
> which specified the mobile version of the css.  What you could do is
> check the domain and prepend a client-specific dir.  Very simple and
> efficient, especially if you ONLY put in those dirs the things that
> absolutely MUST change, while everything else remains the same and is
> drawn from the common dir.
>
> -Dave
>

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


[Rails] Thoughts on a domain based white label app?

2013-08-15 Thread Rick Schmitty
Greets!

I was wondering if there might be any pitfalls I should be aware of in
order to create a domain based white label app.

By that I mean, a single app that will change the layout/css/routes of
an app depending on the domain name that accesses it

example.com gets example.css, layouts/example-application.html.erb, and
whatever /slug-names the user defines for URL friendly CMS pages

foobar.com would get foobar.css, layouts/foobar-application.html.erb,
and it's /slug-names


My reasoning for wanting to do this:

1) The app functionality is the same for all clients, say they are all
book stores.  Everyone has a book search of local inventory, a CMS to
edit content and create /seo-friendly-slugs, and a shopping cart

1b) I have 8 people now on individual apps, but if this grows I don't
want to fix bugs across x00 apps

2) None of the clients get a ton of traffic, however I have to run at
least 1 instance of each app all the time so no one has to deal with a
first load rails boot.  It would be nice if I could have x instances of
1 app running serving requests for all the domains.  This would let me
fill up my VPS and handle spikes from any source while not having to
worry about keeping the seat warm for low traffic domains

I realize this means I will have to have a bunch of if/case/lookup
statements sprinkled about the app to handle all of the switching of
layouts/views/css/(potentially js).  I'll also need some lookup for the
"dynamic routes" to check if /about/foobar exists for example.com, if so
show the content otherwise display a 404.

Would Redis make sense for this kind of stuff, or should I create some
yml configs to hold all of this?

I am not a seasoned veteran, only have 2 years of experience with Rails,
am I nuts, biting off more than I can chew, or sounds reasonable enough
to proceed?

Thanks for any advice
-Rick

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


[Rails] Re: Installing RVM Problems

2013-07-19 Thread Rick


On Friday, July 19, 2013 6:42:44 AM UTC-4, Rick wrote:
>
>
>
> On Friday, July 19, 2013 3:47:49 AM UTC-4, Ruby-Forum.com User wrote:
>>
>> apt-get are only for linux machines, and I am currently operating on a 
>> Mac OSX. And for oh_my_zsh one needs a zsh of 4.3.9, but mine is 
>> currently at 4.3.11. All I need is 4.3.12-5.0.0+ zsh in order to run RVM 
>> without errors, or at least thats what the prompt intimates. 
>>
>> -- 
>> Posted via http://www.ruby-forum.com/. 
>>
> You can also install a binary from either MacPorts, Fink, or Homebrew.
 

>
> zsh is available in source form from http://www.zsh.org.  You need to 
> follow the instructions there to download from a site appropriate for your 
> location.  It comes as a (b or g)zipped archive so you pull in the file, 
> unpack it, and follow the instructions in the *INSTALL* file.  The 
> current version is 5.0.2.
>

-- 
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/288d0f3f-03f6-4c66-9573-ef8b8d0ba5ed%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Installing RVM Problems

2013-07-19 Thread Rick


On Friday, July 19, 2013 3:47:49 AM UTC-4, Ruby-Forum.com User wrote:
>
> apt-get are only for linux machines, and I am currently operating on a 
> Mac OSX. And for oh_my_zsh one needs a zsh of 4.3.9, but mine is 
> currently at 4.3.11. All I need is 4.3.12-5.0.0+ zsh in order to run RVM 
> without errors, or at least thats what the prompt intimates. 
>
> -- 
> Posted via http://www.ruby-forum.com/. 
>

zsh is available in source form from http://www.zsh.org.  You need to 
follow the instructions there to download from a site appropriate for your 
location.  It comes as a (b or g)zipped archive so you pull in the file, 
unpack it, and follow the instructions in the *INSTALL* file.  The current 
version is 5.0.2.

-- 
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/7267b688-323c-41d8-b97a-1b9c53abc164%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Need guidance for a simple search Rails application

2013-07-15 Thread Rick


On Monday, July 15, 2013 12:30:45 AM UTC-4, Arslan Farooq wrote:
>
> Hi,
>
> I am learning Ruby. In the meantime, I have to make a simple app for a 
> small company that I know how to make in PHP and MySQL.
>
> I have not started learning Rails yet (first I want to finish the Ruby 
> book I have started). But I was thinking if with a little guidance may be I 
> can make this app in Rails. If I can do it, that will be great.
>
> The requirement is like this: 
>
>
>- I am given an Excel file that has 11 columns. Each row has 
>information about one item. Each row is unique. Right now the company uses 
>this excel file to search for required information, and they want me to 
>make a web app for this. 
>
>
>- This Excel data and future data will be inserted into the database 
>in bulk, using CSV imports. I think there is no need to break the table, 
>and our app can just have a single table to search from. 
>
>
>- The search will be done using 2 columns from the table.
>
>
>- One person will have the privilege to edit searched records.
>
>
>- Only 4 people will be using the app for now. There will be no option 
>to sign-up for a new account.
>
>- The home page will have the search form (two fields, user can fill 
>both or one).
>
>
> I will appreciate (a lot) any pointers, guidance and help with this.
>
> I can make this in PHP, but I'd love to make it in Rails.
>
> -- arslan
>

Assuming you have little Ruby experience and no Rails experience I think 
your best plan would be to familiarize yourself with RubyOnRails tutorials 
at: http://guides.rubyonrails.org/getting_started.html (a full tree 
provided by the RoR development group covering major Rails components), 
and: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book (a very good 
book by Michael Hartl with the apt sub-title "Learn Web Development with 
Rails").  Both are free online.

Your application looks like a good one for a first effort with two models: 
User and Item.  Members of the User class can have roles associated with 
them, i.e.: Manager, Employee, and Administrator.  The Item class will be a 
direct map of the spreadsheet, members will have fields that mirror the 
spreadsheet columns.  The Item search can be nicely built into the item 
controller's index method and the item edit restriction can be enforced by 
keying off the user's role in the controller methods and views.

I would suggest that, at least initially, you use a snapshot of the 
company's spreadsheet to populate a database that you will use for all 
development, test, and functional acceptance.  You can then segregate out a 
separate task to either provide functions to import and export the excel 
based data.  I would suggest that the final design might want to have the 
data held in a database with a publish capability with an excel format 
(and/or pdf, and/or ...) that has the published date/time as part of the 
page header.

Be sure to learn how to test your app, validate your data, and have fun.

-- 
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/3498d654-df09-4e55-bc18-6db3d8ecfaaa%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: How to create thumbnail

2013-07-15 Thread Rick
It's really hard to help you without seeing the code that is causing the 
error and the log that gives the details of the error message.  For 
example, your problem could be as simple as using *:style => *(singular) 
instead of *:styles =>* (plural) in your model.

Also, it's could be that you are using a version of ruby and/or rails that 
is not supported with the version of paperclip you have installed.  But, as 
above, it's impossible to tell without more information.

That said, I often find the best way to build confidence in a new gem is to 
follow the examples given in the documentation that comes with the gem.  
Build yourself a new app that will only be used to upload and display 
images.  Then follow through the examples given in the README.md at 
https://github.com/thoughtbot/paperclip.

The paperclip gem and ImageMagick are tools that get a lot of use in RoR 
code.  They will work for you if you follow the directions for use.

On Friday, July 9, 2010 8:23:01 AM UTC-4, debadatta wrote:
>
>
>
> On Jul 8, 6:20 pm, debadatta  wrote: 
> > On Jul 8, 5:46 pm, Ar Chron  wrote: 
> > 
> > 
> > 
> > > catz wrote: 
> > > > Just try paperclip, very simple solution for it. 
> > 
> > > +1 for the paperclip recommendation, but you also need some image 
> > > processing package installed and available... ImageMagick, or 
> something 
> > > similar. 
> > 
> > > Then it's almost as simple as: 
> > 
> > > class Image < ActiveRecord::Base 
> > >   has_attachment :content_type => ['image/jpeg', 'image/png'], 
> > >  :storage => :file_system, 
> > >  :max_size => 500.kilobytes, 
> > >  :resize_to => '800x600>', 
> > >  :thumbnails => { :thumb => '100x100>'} 
> > > end 
> > 
> > > in your model.  There are plenty of tutorials out there available via 
> > > Googling. 
> > > -- 
> > > Posted viahttp://www.ruby-forum.com/. 
> > 
> > Hi Catz and Ar chron thanks for giving idea for using paperclip ..But 
> > it's not installing from their repository sites .Can I download the 
> > repository and copy it into my vendor/plugins dir ? and should it 
> > work??? 
> > 
> > thanks 
>
>
> :style =>  is not working for paperclip gem in my app 
> please 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+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/ec4c2387-5ec5-4556-8b49-726e4226a359%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Why the need for multiple $GEM_PATHS

2013-07-14 Thread Rick
You only need multiple copies of any gems that require a specific version 
to run with your current ruby.  GEM_PATH can include multiple directories 
just as the shell PATH does.  So if you're running two different ruby 
environments, RUBY_A and RUBY_B, you could use a GEM_PATH that looks like:

RUBY_A_GEM_PATH=a_gems_dir:common_dir
RUBY_B_GEM_PATH=b_gems_dir:common_dir


On Sunday, July 14, 2013 4:00:41 AM UTC-4, Michał Papis wrote:
>
> also appeared in Ruby Parley - moved to 
> https://github.com/rubygems/rubygems/pull/596
>
> $GEM_HOME is a way of controlling rubygems gems install location:
>
> * benefits: thanks to GEM_HOME you can install ruby as "root" and gems as 
> users, or reinstall ruby without removing gems, it allows you to separate 
> the ruby directory from gems direcotry, you can also maintain multiple sets 
> of gems by manipulating GEM_HOME to different directories - this is how rvm 
> gemsets work
>
> * problems: the need to use different gem paths per ruby/version exist 
> because some gems might require specific ruby version, compiled 
> c-extensions or might include implementation specific code/libraries, they 
> can not be mixed all together, but that's just few percent of gems - rest 
> of them can be mixed in one directory and it is what I have implemented in 
> the pull request mentioned above
>
> Cheers,
> Michal
>
> On Saturday, July 13, 2013 8:35:11 PM UTC+2, Bayu Aldi Yansyah wrote:
>>
>> tool like rbenv can set what ruby version should on your 
>> project/directory . i mean you can use diferent ruby version for different 
>> project/directory. for that, gems need match ruby version for execute on 
>> command line. i think is reason why gem location in each ruby version.
>>
>> Pada Sabtu, 13 Juli 2013 13:20:47 UTC+7, Luke Hamilton menulis:
>>>
>>> Hi all,
>>>
>>> Can some tell me why we need a $GEM_PATH location per ruby versions when 
>>> using tools like RVM & rbenv? 
>>>
>>> I would like to switch between rubies without always need to download 
>>> the gem's a second time as I am currently working off a very poor internet 
>>> connection.
>>>
>>> Thanks!
>>> Luke Hamilton
>>>
>>> “When I let go of what I am, I become what I might be.” – *Lao Tzu*
>>>
>>

-- 
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/36844e66-425e-4b21-b5a9-e555483e9d7f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: myModel.all returns only 138 records

2013-07-08 Thread Rick


On Monday, July 8, 2013 5:26:15 AM UTC-4, Ruby-Forum.com User wrote:
>
> Colin Law wrote in post #1114588: 
> > It is likely that he is getting all records back (as shown by #count) 
> > and that 138 is the lowest id. 
>
>
> Nope:) 
>
> The reason I noticed is that when I did a find all I wasn't getting new 
> records that had been added. 
>
> However, if I get the new records by their id they definitely exist. 
>
> It's got odder this morning, there are now 155 records, and a find all 
> returns the latest records, however records id 139 to 145 are missing! 
> Again, I can get them by id. 
>
> But using Webmin to list the records, I get exactly the same result - so 
> it is looking like a database issue. 
>
> -- 
>

I've been trying but am unable to duplicate your problem.  I'm running on 
rails4 with postgresql9.1 and pg (0.15.1).  Here's my simple test:

1) rails new CheckItOut -d postgresql
2) cd CheckItOut
3) rails generate scaffold Number name:string value:integer
4) rake db:create
5) rake db:migrate
6) rails console
> n = 0 
> while (n < 200) {
>> name = sprintf("%04d", n) 
>> Number.create(:name => name, :value => n) 
>> n += 1 }
7) rails server
8) browsing to localhost:3000/numbers shows an index with 200 entries of 
the expected names and values

Try these steps to see if you really have the database problem as you've 
reported it or if what you're seeing is a result of something lurking in 
your app.

> 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/f1d7fbc8-aacf-4c3e-badd-74bcdbed9052%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Create lowercase index

2013-07-03 Thread Rick
Straight from rails4.0 documentation: 
http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html

Creating an index with a specific method 

add_index(:developers, :name, using: 'btree')

generates:

CREATE INDEX index_developers_on_name ON developers USING btree (name) -- 
PostgreSQLCREATE INDEX index_developers_on_name USING btree ON developers 
(name) -- MySQL

Note: only supported by PostgreSQL and MySQL

On Tuesday, July 2, 2013 1:13:15 PM UTC-4, Linus Pettersson wrote:
>
> Hi
>
> I'm sorting some columns like this: MyModel.order("LOWER(column) ASC")... 
> But these queries are quite slow. I'm on Postgres by the way.
>
> Does Rails support creating a lowercase index for these situations? I know 
> Postgres has support for it and I guess I can create one like this (found 
> on SO):
>
> execute "CREATE UNIQUE INDEX index_products_on_lower_name ON products USING 
> btree (lower(name));"
>
> But does Rails have support for creating it? Don't like to use execute() 
> if there is a better way :)
>
> Cheers,
> Linus
>

-- 
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/322a103d-6306-42a1-91b9-8345a151af91%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Create lowercase index

2013-07-03 Thread Rick
Direct from Rails4.0 ActiveRecord documentation:

Creating an index with a specific method 

add_index(:developers, :name, using: 'btree')

generates:

CREATE INDEX index_developers_on_name ON developers USING btree (name) -- 
PostgreSQLCREATE INDEX index_developers_on_name USING btree ON developers 
(name) -- MySQL

Note: only supported by PostgreSQL and MySQL


On Tuesday, July 2, 2013 1:13:15 PM UTC-4, Linus Pettersson wrote:
>
> Hi
>
> I'm sorting some columns like this: MyModel.order("LOWER(column) ASC")... 
> But these queries are quite slow. I'm on Postgres by the way.
>
> Does Rails support creating a lowercase index for these situations? I know 
> Postgres has support for it and I guess I can create one like this (found 
> on SO):
>
> execute "CREATE UNIQUE INDEX index_products_on_lower_name ON products USING 
> btree (lower(name));"
>
> But does Rails have support for creating it? Don't like to use execute() 
> if there is a better way :)
>
> Cheers,
> Linus
>

-- 
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/c2f87267-c2ef-42ac-a66e-951ce8a566e5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Multiple nested attributes of the same type

2013-07-01 Thread Rick
the answer is to be found here: 
http://guides.rubyonrails.org/association_basics.html

On Sunday, June 30, 2013 2:56:59 PM UTC-4, Ruby-Forum.com User wrote:
>
> Hi all, 
>
>  0 down vote favorite 
>
>
> I have two models - "symbols" and "users". Among other attributes, 
> symbols has "created_by_id" and "updated_by_id" attributes which are 
> id's of users that created/updated a certain symbol entry. 
>
> Let's say I want to display the symbols table with their "symbol" 
> attribute and the nested "created by" and "updated by" (user.username) 
> attributes for each symbol entry. Resulting table should look something 
> like this: 
>
> symbol created_byupdated_by 
>  
> symbol1username1 username2 
> symbol2username1 username2 
>
> How can I achieve this? I guess I need accepts_nested_attributes_for 
> :user and probably has_one :user (?) in my Symbol model. Do I also need 
> belongs_to :user in my User model? 
>
> After the models are set up properly, how can I access the username of 
> users associated with "created_by_id" and "updated_by_id" in my view? 
>
> I have an edit form where I used nested form like this (which works 
> fine): 
>
> <%= form_for @symbol do |f| %> 
>   Symbol: 
>   <%= f.text_field :symbol %> 
>   <%= f.fields_for :kanji do |kf| %> 
> Meaning: 
> <%= kf.text_field :meaning %> 
>
> Onyomi: 
> <%= kf.text_field :onyomi %> 
>
> Kunyomi: 
> <%= kf.text_field :kunyomi %> 
>   <% end %> 
>   <%= f.submit "Save" %> 
> <% end %> 
>
> but I couldn't figure out how to do something similar in this case where 
> I have two nested attributes associated with the same symbol. 
>
> I'm new to rails so perhaps I got the whole idea of how to do this 
> wrong. If there is a better than what I just explained how I want to do 
> it, please correct me. 
>
> Thank you 
>
> -- 
> 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/266afa94-daf1-479b-abda-a83e637d5a93%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: No more info about dynamic_form in rails guides?

2013-06-28 Thread Rick
dynamic_form was included in Rails2 but stripped out of Rails3 (and 4).  
It's now available as a gem.


On Friday, June 28, 2013 11:19:16 AM UTC-4, Ruby-Forum.com User wrote:
>
> Wins Lin wrote in post #1113811: 
> > I remember for sure there was a explanation with screenshots about 
> > dynamic_form in Rails Guides. Now I cannot find it, neither in Edge nor 
> > in standard guide. Have they removed it? Why? Where may I find the info 
> > again? 
>
> https://github.com/joelmoss/dynamic_form 
>
> -- 
> 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/4ffbdd27-cc5e-4ca8-9041-e81a43f77b1b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Using parentheses in routes

2013-06-26 Thread Rick Martinez
Does anyone know how to use escape parentheses in routes so I can use them 
in URLs? They currently denote optional params, but I can't find 
documentation on how to escape that.

What I want is:

Given I have a route: match "foo(:id)" => "foos#show"
When I go to "/foo(3)"
Then params[:id] should be "3"

But currently params[:id] returns "(3)"

I don't want to make :id optional.

Thanks!
Rick

-- 
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/0e323be4-367e-4d79-a964-34905757f526%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Autload thread safety in Ruby 2.0?

2013-06-16 Thread Rick
Here's a link that's a little more current that sheds some light on the 
issue: https://github.com/rkh/rack-protection/issues/45

On Saturday, June 15, 2013 9:10:10 PM UTC-4, Josh Jordan wrote:
>
> Jose Valim implies that autoloading is threadsafe in Ruby 2.0:
>
> The issue with this approach is that it is not thread-safe, except for 
>> latest JRuby versions (since 1.7) and Ruby master (2.0)
>
>  
>
> http://blog.plataformatec.com.br/2012/08/eager-loading-for-greater-good
>>
>
> However, the autoload bug ticket filed against Ruby (
> http://bugs.ruby-lang.org/issues/921) was closed and refers to a forum 
> post wherein Matz recommends *not* to use autload (
> http://www.ruby-forum.com/topic/3036681).
>
> Does anyone have any light to shed on this discrepancy? 
>

-- 
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/10b01939-6267-4347-b32b-7b52c31e4f85%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Re: Ruby 2.0 is running, but Rails 4 doesn't see it.

2013-06-03 Thread Rick
"Also, when I type in `which ruby` it freezes the console. "

I think whatever ruby you think you're running is damaged.  Based on the 
rails output about needing 2.0 but having 1.8.7 I guessing you'ld be well 
served by uninstalling 2.0 and redoing the install.  How about if you type 
"ruby --version" in your console, does that also hang?

On Monday, June 3, 2013 6:07:09 PM UTC-4, Ruby-Forum.com User wrote:
>
> sean@ubuntu:~/ruby/things_i_bought$ echo $PATH 
> /home/sean/.rvm/gems/ruby-2.0.0-p0/bin:/home/sean/.rvm/gems/ruby-2.0.0-p0@global/bin:/home/sean/.rvm/rubies/ruby-2.0.0-p0/bin:/home/sean/.rvm/bin:/home/sean/sbt/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/bin/:/home/sean/AWS-ElasticBeanstalk-CLI-2.3.1/eb/linux/python2.7/:/home/sean/anaconda/bin/
>  
>
>
> and here's the relevent section of my .bashrc file: 
>
> PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting 
>
> [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This 
> loads RVM 
>
> Also, when I type in `which ruby` it freezes the console. 
>
> Norbert Melzer wrote in post #200: 
> > Hmmm 
> > 
> > I don't see any output of `which ruby`, probably missordered 
> > PATH-variable? 
> > Please check. 
> > 
> > HTH 
> > Norbert 
> > 
> > 
> > 2013/6/3 Alphonse 23 > 
>
> -- 
> 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/89743c59-1659-4c7f-bcb6-245685bb6feb%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: inverse_of and #save called multiple times

2013-06-03 Thread Rick
might be worth spending some time to see if you can figure out where the 
extra "Here" comes from.  i didn't check the log to see if there was 
actually a redundant save of the record.  could be an opportunity for you 
to plumb the mysteries of testing.  think of what it did for heisenberg.

On Monday, June 3, 2013 11:57:20 AM UTC-4, Michel Pigassou wrote:
>
> Hmm thanks. Is it worth it to report this to the Rails team?
>
> On Monday, June 3, 2013 5:17:37 PM UTC+2, Rick wrote:
>>
>> I just noticed that your error does, in fact, appear in my output.  
>> However, if I run inside of the rails console I don't see the redundant 
>> "Here".  i.e.:
>>
>> /Dagnan/rails_inverse_of 659 > rails c
>> Loading development environment (Rails 3.2.13)
>> irb(main):001:0> c = Campaign.new
>> => #> nil>
>> irb(main):002:0> c.recurrence = Recurrence.new
>> => #
>> irb(main):003:0> c.save!
>>(0.1ms)  begin transaction
>>   SQL (5.1ms)  INSERT INTO "recurrences" ("created_at", "updated_at") 
>> VALUES (?, ?)  [["created_at", Mon, 03 Jun 2013 15:15:11 UTC +00:00], 
>> ["updated_at", Mon, 03 Jun 2013 15:15:11 UTC +00:00]]
>> Here
>>   SQL (0.5ms)  INSERT INTO "campaigns" ("created_at", "recurrence_id", 
>> "updated_at") VALUES (?, ?, ?)  [["created_at", Mon, 03 Jun 2013 15:15:11 
>> UTC +00:00], ["recurrence_id", 1], ["updated_at", Mon, 03 Jun 2013 15:15:11 
>> UTC +00:00]]
>> Here
>>(49.1ms)  commit transaction
>> => true
>> irb(main):004:0> c
>> => #> "2013-06-03 15:15:11", recurrence_id: 1>
>> irb(main):005:0>
>>
>> My guess is it's a "test mode" artifact of some kind.
>>
>>
>> On Monday, June 3, 2013 11:13:26 AM UTC-4, Rick wrote:
>>>
>>> I cannot duplicate your error running your github example.  Here's what 
>>> I see:
>>>
>>> /Dagnan/rails_inverse_of 656 > rails --version
>>> Rails 3.2.13
>>> /Dagnan/rails_inverse_of 657 > ruby --version
>>> ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
>>> /Dagnan/rails_inverse_of 658 >  ruby -Itest test/unit/campaign_test.rb
>>> Run options:
>>>
>>> # Running tests:
>>>
>>> [1/1] CampaignTest#test_create_a_campaign_with_recurrenceHere
>>> Here
>>> Finished tests in 0.195217s, 5.1225 tests/s, 0. assertions/s.
>>> 1 tests, 0 assertions, 0 failures, 0 errors, 0 skips
>>>
>>> ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
>>> /Dagnan/rails_inverse_of 659 >
>>>
>>> On Monday, June 3, 2013 1:55:29 AM UTC-4, Michel Pigassou wrote:
>>>>
>>>> Help?
>>>>
>>>> On Friday, May 31, 2013 7:39:30 PM UTC+2, Michel Pigassou wrote:
>>>>>
>>>>> Hi.
>>>>>
>>>>> I created an app to illustrate my problem: 
>>>>> https://github.com/Dagnan/rails_inverse_of
>>>>>
>>>>> I have a model with a belongs_to, and the other with a has_one. So far 
>>>>> so good.
>>>>> When I configure the option inverse_of on both model and I perform a 
>>>>> simple #save on the main object, it is actually saved two times (once 
>>>>> saved 
>>>>> and then updated).
>>>>>
>>>>> *Is it an expected behavior?*
>>>>>
>>>>> A way to avoid this problem would be not to use inverse_of, or to have 
>>>>> "autovalidate: false" in the second model (Recurrence in my example) for 
>>>>> the has_one association.
>>>>>
>>>>

-- 
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/dd609006-ced8-4dff-b99f-d5838b70e31d%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: inverse_of and #save called multiple times

2013-06-03 Thread Rick
I just noticed that your error does, in fact, appear in my output.  
However, if I run inside of the rails console I don't see the redundant 
"Here".  i.e.:

/Dagnan/rails_inverse_of 659 > rails c
Loading development environment (Rails 3.2.13)
irb(main):001:0> c = Campaign.new
=> #
irb(main):002:0> c.recurrence = Recurrence.new
=> #
irb(main):003:0> c.save!
   (0.1ms)  begin transaction
  SQL (5.1ms)  INSERT INTO "recurrences" ("created_at", "updated_at") 
VALUES (?, ?)  [["created_at", Mon, 03 Jun 2013 15:15:11 UTC +00:00], 
["updated_at", Mon, 03 Jun 2013 15:15:11 UTC +00:00]]
Here
  SQL (0.5ms)  INSERT INTO "campaigns" ("created_at", "recurrence_id", 
"updated_at") VALUES (?, ?, ?)  [["created_at", Mon, 03 Jun 2013 15:15:11 
UTC +00:00], ["recurrence_id", 1], ["updated_at", Mon, 03 Jun 2013 15:15:11 
UTC +00:00]]
Here
   (49.1ms)  commit transaction
=> true
irb(main):004:0> c
=> #
irb(main):005:0>

My guess is it's a "test mode" artifact of some kind.


On Monday, June 3, 2013 11:13:26 AM UTC-4, Rick wrote:
>
> I cannot duplicate your error running your github example.  Here's what I 
> see:
>
> /Dagnan/rails_inverse_of 656 > rails --version
> Rails 3.2.13
> /Dagnan/rails_inverse_of 657 > ruby --version
> ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
> /Dagnan/rails_inverse_of 658 >  ruby -Itest test/unit/campaign_test.rb
> Run options:
>
> # Running tests:
>
> [1/1] CampaignTest#test_create_a_campaign_with_recurrenceHere
> Here
> Finished tests in 0.195217s, 5.1225 tests/s, 0. assertions/s.
> 1 tests, 0 assertions, 0 failures, 0 errors, 0 skips
>
> ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
> /Dagnan/rails_inverse_of 659 >
>
> On Monday, June 3, 2013 1:55:29 AM UTC-4, Michel Pigassou wrote:
>>
>> Help?
>>
>> On Friday, May 31, 2013 7:39:30 PM UTC+2, Michel Pigassou wrote:
>>>
>>> Hi.
>>>
>>> I created an app to illustrate my problem: 
>>> https://github.com/Dagnan/rails_inverse_of
>>>
>>> I have a model with a belongs_to, and the other with a has_one. So far 
>>> so good.
>>> When I configure the option inverse_of on both model and I perform a 
>>> simple #save on the main object, it is actually saved two times (once saved 
>>> and then updated).
>>>
>>> *Is it an expected behavior?*
>>>
>>> A way to avoid this problem would be not to use inverse_of, or to have 
>>> "autovalidate: false" in the second model (Recurrence in my example) for 
>>> the has_one association.
>>>
>>

-- 
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/e13e4aef-5ca6-49d7-88fd-17d1c584bf1c%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: inverse_of and #save called multiple times

2013-06-03 Thread Rick
I cannot duplicate your error running your github example.  Here's what I 
see:

/Dagnan/rails_inverse_of 656 > rails --version
Rails 3.2.13
/Dagnan/rails_inverse_of 657 > ruby --version
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
/Dagnan/rails_inverse_of 658 >  ruby -Itest test/unit/campaign_test.rb
Run options:

# Running tests:

[1/1] CampaignTest#test_create_a_campaign_with_recurrenceHere
Here
Finished tests in 0.195217s, 5.1225 tests/s, 0. assertions/s.
1 tests, 0 assertions, 0 failures, 0 errors, 0 skips

ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]
/Dagnan/rails_inverse_of 659 >

On Monday, June 3, 2013 1:55:29 AM UTC-4, Michel Pigassou wrote:
>
> Help?
>
> On Friday, May 31, 2013 7:39:30 PM UTC+2, Michel Pigassou wrote:
>>
>> Hi.
>>
>> I created an app to illustrate my problem: 
>> https://github.com/Dagnan/rails_inverse_of
>>
>> I have a model with a belongs_to, and the other with a has_one. So far so 
>> good.
>> When I configure the option inverse_of on both model and I perform a 
>> simple #save on the main object, it is actually saved two times (once saved 
>> and then updated).
>>
>> *Is it an expected behavior?*
>>
>> A way to avoid this problem would be not to use inverse_of, or to have 
>> "autovalidate: false" in the second model (Recurrence in my example) for 
>> the has_one association.
>>
>

-- 
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/65ef8fb8-2e4b-4068-999c-b68a8fc29d15%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: accidentally created a rails app in the home folder

2013-06-01 Thread Rick
i now see i misstyped the instructions to step 2.  here it is, corrected

2) type the command "wc -l `which rails`" -- if you can't figure out the 
quoting just use the result of step 1.  i.e. on my system "wc -l 
/opt/local/bin/rails"

the idea is to use the wc command to get the number of lined in the rails 
script you are calling by default.  the quoting used in *wc -l `which rails`
* an open single quote - on a mac keyboard it's found on the key to the 
left of number one.  it's a bit of unix shell magic that causes the quoted 
text to be evalulated as a command and the results to be handed off the the 
*wc -l* command as argument(s).  thus, on my system, it becomes *wc -l 
/opt/local/bin/rails*.

in your case *wc -l `which rails` *would be equivalent to *wc -l 
/home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails* and i'll be surprised if the 
result is much greater than 6.  i don't use rvm so cannot help you 
troubleshoot rvm specific errors.  i can say that you don't want to be 
creating your new app anywhere inside the *.../.rvm/...* directory tree.  
think of this as a managed software repository - anything that gets changed 
there is done through rvm.  make yourself a working directory, cd there and 
run the *rails new* command.  something like:
*
mkdir /home/mwr/RailsApps*
*cd /home/mwr/RailsApps
rails new my_new_app

*
On Friday, May 31, 2013 11:28:19 PM UTC-4, Ruby-Forum.com User wrote:
>
> Hi Rick, 
> thanks! I tried carrying out those instructions: heres what i got - 
> mwr@mwr-Ubuntu:/home$ which rails 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails 
>
>
> mwr@mwr-Ubuntu:/home$ which 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails 
>
> I suppose im having trouble with step 2 of your directions. However its 
> nice to have a kind of explanation of whats going on. Again, excuse my 
> illiteracy on this, but it look like maybe i do have rails installed in 
> my home directory? 
>
> **just discovered by accident I can do this: 
> mwr@mwr-Ubuntu:/home$ which 
> /home/mwr/.rvm.gems/ruby-1.9.3-p429/bin/rails 
> mwr@mwr-Ubuntu:/home$ wc -l 'which rails' 
> wc: which rails: No such file or directory 
> mwr@mwr-Ubuntu:/home$ cd .. 
> mwr@mwr-Ubuntu:/$ which rails 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails 
> mwr@mwr-Ubuntu:/$ which /home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/bin/rails 
> mwr@mwr-Ubuntu:/$ rails new path/here 
>   create 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:247:in 
> `mkdir': Permission denied - /path (Errno::EACCES) 
>   from 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:247:in 
> `fu_mkdir' 
>   from 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:221:in 
> `block (2 levels) in mkdir_p' 
>   from 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:219:in 
> `reverse_each' 
>   from 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:219:in 
> `block in mkdir_p' 
>   from 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:205:in 
> `each' 
>   from 
> /home/mwr/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/fileutils.rb:205:in 
> `mkdir_p' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:51:in
>  
>
> `block in invoke!' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:117:in
>  
>
> `call' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:117:in
>  
>
> `invoke_with_conflict_check' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:50:in
>  
>
> `invoke!' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions.rb:95:in
>  
>
> `action' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/empty_directory.rb:15:in
>  
>
> `empty_directory' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.13/lib/rails/generators/app_base.rb:103:in
>  
>
> `create_root' 
>   from (eval):1:in `create_root' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/command.rb:27:in
>  
>
> `run' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:120:in
>  
>
> `invoke_command' 
>   from 
> /home/mwr/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:127:in
>  
>
> `block in invoke_all' 
>   from 
> /

[Rails] Re: accidentally created a rails app in the home folder

2013-05-31 Thread Rick
for what it's worth, the error message is generated in the file: 
gems/railties-3.2.13/lib/rails/commands.rb

On Friday, May 31, 2013 9:09:16 PM UTC-4, Rick wrote:
>
> There are (at least) two executable ruby scripts named "rails".  The first 
> is found in your typical search path and should be the one that gets called 
> when you type "rails new my_app".  The second is found, after creating your 
> new application "my_app", in the directory "my_app/script" (rails version 
> 3) or "my_app/bin" (rails version 4).
>
> These ruby scripts named "rails" are not the same and, if you call the 
> second with the "new my_app" arguments, "rails" will assume you are running 
> inside an existing application and hurl error chunks at you.
>
> Do this
>
> 1) type the command "which rails" and you will see the full path to what 
> your current shell assumes to be the true rails command.  
>
> i.e. on my system
> 555 > which rails
> /opt/local/bin/rails
>  556 >
>
> 2) type the command "wc -l `which rails`" -- if you can't figure out the 
> quoting just use the result of step 1.  i.e. on my system "which 
> /opt/local/bin/rails"
>
> you should see a result that is somewhere around 23 (lines) but i'm 
> thinking you'll see 6.  the first number is the correct system wide rails 
> script that will let you create a new app, the second number is the rails 
> script that is placed into "my_app/script" (or "my_app/bin") and will be 
> used when you "rails generate ..." or other such inside your new 
> application directory structure.
>
> just to beat this horse to death, here's what i get when, in my home 
> directory, i call an application (6 line) rails with new...
>
> 561 > binky/script/rails new boffo
> Can't initialize a new Rails application within the directory of another, 
> please change to a non-Rails directory first.
> Type 'rails' for help.
>  562 >
>
> look familiar?
>
> On Friday, May 31, 2013 6:28:06 PM UTC-4, Ruby-Forum.com User wrote:
>>
>> Im a new user - I just installed rails, following directions here: 
>> http://rubyonrails.org/download 
>> however, when it came time to make a rails new path/etc/etc I get this 
>> message: 
>> Can't initialize a new Rails application within the directory of 
>> another, please change to a non-Rails directory first. 
>> The only complication during the download was that I had to upgrade from 
>> version 1.8.6 to 1.9.3, which I did after installing rails. Otherwise 
>> Ive done nothing but follow the very simple directions. 
>> I found this very helpful thread http://www.ruby-forum.com/topic/1780147 
>> but when the output of ls -l shows just my usual directories. Any help 
>> is greatly appreciated. 
>>
>> -- 
>> 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/2163d288-fef7-4b1d-a34c-29e5169c6615%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: accidentally created a rails app in the home folder

2013-05-31 Thread Rick
There are (at least) two executable ruby scripts named "rails".  The first 
is found in your typical search path and should be the one that gets called 
when you type "rails new my_app".  The second is found, after creating your 
new application "my_app", in the directory "my_app/script" (rails version 
3) or "my_app/bin" (rails version 4).

These ruby scripts named "rails" are not the same and, if you call the 
second with the "new my_app" arguments, "rails" will assume you are running 
inside an existing application and hurl error chunks at you.

Do this

1) type the command "which rails" and you will see the full path to what 
your current shell assumes to be the true rails command.  

i.e. on my system
555 > which rails
/opt/local/bin/rails
 556 >

2) type the command "wc -l `which rails`" -- if you can't figure out the 
quoting just use the result of step 1.  i.e. on my system "which 
/opt/local/bin/rails"

you should see a result that is somewhere around 23 (lines) but i'm 
thinking you'll see 6.  the first number is the correct system wide rails 
script that will let you create a new app, the second number is the rails 
script that is placed into "my_app/script" (or "my_app/bin") and will be 
used when you "rails generate ..." or other such inside your new 
application directory structure.

just to beat this horse to death, here's what i get when, in my home 
directory, i call an application (6 line) rails with new...

561 > binky/script/rails new boffo
Can't initialize a new Rails application within the directory of another, 
please change to a non-Rails directory first.
Type 'rails' for help.
 562 >

look familiar?

On Friday, May 31, 2013 6:28:06 PM UTC-4, Ruby-Forum.com User wrote:
>
> Im a new user - I just installed rails, following directions here: 
> http://rubyonrails.org/download 
> however, when it came time to make a rails new path/etc/etc I get this 
> message: 
> Can't initialize a new Rails application within the directory of 
> another, please change to a non-Rails directory first. 
> The only complication during the download was that I had to upgrade from 
> version 1.8.6 to 1.9.3, which I did after installing rails. Otherwise 
> Ive done nothing but follow the very simple directions. 
> I found this very helpful thread http://www.ruby-forum.com/topic/1780147 
> but when the output of ls -l shows just my usual directories. Any help 
> is greatly appreciated. 
>
> -- 
> 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/a4accc33-e096-45e0-a966-6a125b6e9939%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Re: accidentally created a rails app in the home folder

2013-05-31 Thread Rick
What is the command you are using to create a new rails app?  Just to be 
sure, type the command into a terminal window and copy / paste the command 
you typed and the output from rails.


On Friday, May 31, 2013 7:49:14 PM UTC-4, Ruby-Forum.com User wrote:
>
> ruby -v gives ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux] 
> rails -v gives Rails 3.2.13 
> gem -v gives 1.8.25 
>
> Im running ubuntu. I had ruby 1.8.6. I installed gem but it gave an 
> error when I was trying to get rails through gem, bc i had the old 
> version of ruby. I got rvm, updated to 1.9.3 and then reinstalled rails. 
>
> It does indeed give the same " Can't initialize a new Rails application 
> within the directory of another, please change to a non-Rails directory 
> first" when Im in an empty directory I made from home. 
>
> Thank you for your help by the way. 
>
> -- 
> 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/1e479855-b494-4fbe-935a-a6a7f16762a7%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Missing template pages/layout only occasionally

2013-04-26 Thread Rick
I finally figured this out.  I have an action that only renders html, but 
googlebot for instance wants text.  So, I added this to the controller and 
everything works!

 before_filter :force_html_requests, :only => :show

  def force_html_requests
  request.format = :html
  end

Rick

On Monday, November 26, 2012 6:01:19 PM UTC-6, jim wrote:
>
>
>
>
> On Tue, Nov 27, 2012 at 7:54 AM, Rick Cockerham 
> 
> > wrote:
>
>> Excellent suggestion.  From the page view I see this agent:
>>
>> Mozilla/5.0 (compatible; oBot/2.3.1; +http://filterdb.iss.net/crawler/)
>>
>> So, how do I setup my app to only accept html requests for those routes?
>> Or, just not fail when it wants text?
>>
>
> try passing a formats option to render.
>
> render partial: 'foo', formats: [:html]
>  
>
>>
>> Thanks
>>
>> --
>> 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 post to this group, send email to 
>> rubyonra...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> rubyonrails-ta...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> -- 
> -
> visit my blog at http://jimlabs.heroku.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/msg/rubyonrails-talk/-/GjeWL-1w3bMJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Missing template pages/layout only occasionally

2013-04-25 Thread Rick Cockerham
I finally figured this out.  I have an action that only renders html, 
but googlebot for instance asks for text format.  So, it tries to find 
action.text.erb which doesn't exist.

I added this to my controller and everything works now.

before_filter :force_html_requests, :only => :show

def force_html_requests
  request.format = :html
end

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Building a Gem around an API for Shopify

2013-03-07 Thread Rick


On Wednesday, March 6, 2013 8:34:10 PM UTC-5, Matthew Robinson wrote:
>
> Hi,
>
> Can anyone assist with API connection with Shopify?
>
> We are looking to connect and link our shopify account with an inventory 
> fulfillment center that we are using. The logistics company has provided us 
> with connectivity guidelines via either API connection or FTP. 
>
> Let me know if you can assist with this one (hours). I can send the info 
> you through.
>
> Thanks Matthew
>
Have you looked at https://github.com/Shopify/shopify_api ?

-- 
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/msg/rubyonrails-talk/-/FVfYtQ4Jy94J.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: RoR on IDE for Beginner

2013-03-07 Thread Rick
I would suggest you use as little non-RoR baggage as possible when starting 
out.  An editor that does auto indent and context color highlighting is 
nice, if you're already comfortable with it.  Also avoid rvm initially, and 
git, and any db other than sqlite.  All these items have there own learning 
curve that will just confuse you - it's hard to discriminate the true 
source of an error if you have too many poorly understood layers between 
you and your code.

Make an extra effort to learn on a Mac or Ubuntu system.  Do not use 
windoze, it's like touching the third rail in the subway or licking the 
metal pole in the winter.  If you haven't yet gotten comfortable with unix, 
this is the only complex tool you need to put between yourself and RoR.

The hardest part for me was (and continues to be) debugging.  Particularly 
difficult are errors that occur during application startup as these are 
just as likely to come from your run time environment as your code and are 
not always well described.

Follow the rails tutorial, get comfortable with the architecture by 
building small projects.  Remeber that many people have run through the 
tutorial so it's unlikely to include errors.  If it does include errors 
google "rails tutorial your error message" and you will find a thread.  I 
think the Dave Thomas book "Programming Ruby" is among my best purchases, 
my copies are all dogeared from continued use.

I personally use emacs with the rinari package but I've been using emacs 
since 1980 so the learning curve is not an issue.  It's nice to have an 
editor that you can carry across platforms.

On Wednesday, February 27, 2013 10:50:20 PM UTC-5, Stewart Alsop wrote:
>
> Should I use an IDE for beginning with Rails?

-- 
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/msg/rubyonrails-talk/-/EE5lTYQn868J.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Security fix CVE-2012-5664 exists in rails 2.3.15

2013-02-24 Thread Rick
The original announcement of Rails 3.2.10...  was posted on *January 2*. 
The current version is at 3.2.12.  It's quite possible the 2.3 branch has 
also advanced.
Rick

On Sunday, February 24, 2013 9:47:00 AM UTC-5, Ariel Tal wrote:
>
> Hello,
> I was looking to migrate the patch described in this 
> link<https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/DCNTNp_qjFM>
>  (
> https://groups.google.com/forum/?fromgroups=#!topic/rubyonrails-security/DCNTNp_qjFM)
>  
> to the rails 2.3 branch, but when doing so realized that it's already there.
>
> I couldn't find anything about this in the release notes, I was wondering 
> if the link above might be incomplete? If it's not a mistake, is it 
> possible to add a note about it somewhere?
>
> Thanks,
> Ariel
>

-- 
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/msg/rubyonrails-talk/-/CtVcaC4ALZYJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Rails Admin Site missing Index file - Advice Needed Please

2012-12-05 Thread Rick
Hello Brian,

The quickest and most likely to be successful way out is to get connected 
with someone who has actually built and deployed a RoR app.  The work is 
fairly straightforward once you know how but if you're looking at a time 
constraint you'ld be best served by someone who's already familiar - 
they'll just need to learn what you want and understand what their 
predecessor has done.

Rick

On Wednesday, December 5, 2012 8:19:15 AM UTC-5, Brian wrote:
>
> Hi There,
>
> I'm hoping you guys can help me out. I have recently developed an iphone 
> location based app and unfortunately the developer went off the rails 
> towards the end (yea pun intended lol) and when we were handed over all the 
> files for the app and admin site there was a number of things missing.
>
> Basically the app doesn't work but we are trying to fix that and the admin 
> website built to integrate with the app was built using rails.
>
> I had someone install the admin site onto Amazon but after trying for some 
> time he told me that unfortunately the index file was missing and that I 
> needed to get from the developer. That's not possible as he has refused to 
> help in any way.
>
> Now I don't know anything about rails but I know if this was wordpress, a 
> missing index.html file would be no problem at all.
>
> I don't know if that is the case with rails.
>
> I was hoping you may be able to tell me what my options are as far as 
> getting the admin site up and running without the original index file and 
> if it is possible?
>
> Any advice would be greatly appreciated and if you require any further 
> detail please let me know.
>
> Thank you in advance for your assistance with this as we are lost and out 
> of pocket thousands of dollars and just trying to pick up the pieces of 
> what turned into a nightmare project.
>
> Here are some screen shots of the site admin and an error message that may 
> help you to tell us what we can do in this situation.
>
>
>
> <https://lh3.googleusercontent.com/-QeUihVKYVso/UL9JhaRe14I/AQY/ilpA62ZQj60/s1600/Site+admin+screen.jpg>
>
>
> <https://lh5.googleusercontent.com/-x0AFs3ovhsE/UL9Jq02mZ8I/AQg/kRuDcsyMzBU/s1600/Error+after+searching+for+product.jpg>
>
>
>
>
> Thank you very much,
>
> Brian
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/be6KIAUDrpIJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Missing template pages/layout only occasionally

2012-11-26 Thread Rick Cockerham
Excellent suggestion.  From the page view I see this agent:

Mozilla/5.0 (compatible; oBot/2.3.1; +http://filterdb.iss.net/crawler/)

So, how do I setup my app to only accept html requests for those routes? 
Or, just not fail when it wants text?

Thanks

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Missing template pages/layout only occasionally

2012-11-26 Thread Rick Cockerham
I have my app email me errors when they occur.  I get this about 2-3
times a week with thousands of hits a day to the site.  pages/show is a
.html.erb file that renders the partial
_strategicrelationshipacademy.html.erb essentially.  Or whatever partial
it calls for.  I get this on many different 'pages'.  Obviously the
partial exists if it renders it fine most of the time.  What could cause
this?

Message = Missing template pages/layout with {:formats=>["text/*"],
:locale=>[:en, :en], :handlers=>[:rhtml, :rxml, :builder, :erb, :rjs]}
in view paths "/var/www/procyon-live/app/views",
"/var/www/procyon-live/vendor/plugins/wicked_pdf/app/views",
"/var/www/procyon-live/vendor/plugins/file_column/app/views",
"/var/www/procyon-live/vendor/plugins/acts_as_tree/app/views",
"/var/www/procyon-live/vendor/plugins/acts_as_list/app/views"

Request = {"controller"=>"pages",
"page"=>"strategicrelationshipacademy", "action"=>"show"}

/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9.rc5/lib/action_view/paths.rb:15:in
`find'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9.rc5/lib/action_view/lookup_context.rb:81:in
`find_template'
...
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9.rc5/lib/action_controller/metal/instrumentation.rb:39:in
`render_without_wicked_pdf'
/var/www/procyon-live/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:19:in
`render'
/var/www/procyon-live/app/controllers/pages_controller.rb:154:in `show'
...

Rails 3.0.9.rc5
Ruby 1.8.7

Obviously I didn't want to include the entire backtrace.  Let me know if
it would help.

Thanks,
Rick

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] SEEKING DEVELOPERS TO HELP ON ANTI-FRACKING PROJECT

2012-09-29 Thread Rick Casey
Hello ROR community at large,

I am seeking some help for a fairly simply Ruby On Rails/Facebook
project which could help greatly in an intense local anti-fracking
campaign in Colorado.

I am a ROR beginner, but do not have the expertise to knock out this
project quickly; but I have been a database developer for over 20 years,
and can provide excellent support. I am familiar with Engine Yard,
Heroku and github, and hope this project can be done using all open
source, free services.

The need is this: my local anti-fracking group badly needs an online
database to help us support a political campaign against fracking in the
local area. All we need is (1) a data entry form to create a record, and
then (2) a form to allow us to edit a record, then (3) a form to allow
us to download a select list from the database in a csv file.

All of the surrounding communities where I live in Lafayette, CO are
about to be invaded by gas wells getting drilled within the city limits
of our towns, such as Boulder, Longmont, Erie, Lyons, and outlying parts
of Denver, such as Commerce City and Aurora. This is known as the Front
Range, and we are about to become the national battleground of the oil &
gas industry versus alternative energy -- and I need your help.

If you don't know about fracking, but want to find out, go search for
watching the full length documentary GASLAND (gaslandthemovie.com), or
watch "The Sky Is Pink" on YouTube, a short sequel.

Basically, we a simple online database (described above) on a website,
plus a button from our Facebook page for East Boulder County United (see
http://www.facebook.com/EastBoulderCountyUnited?fref=ts)

to the database.

If anybody is willing to help me with this, please let me know at
caseyr...@gmail.com

Thank you for your time,
Rick Casey
Lafayette,  CO

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Regexp pre_match

2012-09-06 Thread Rick
http://www.ruby-doc.org/core-1.9.3/MatchData.html#method-i-pre_match

On Thursday, September 6, 2012 1:40:31 AM UTC-4, John Merlino wrote:
>
> I looked in ruby documentation 
>
> http://www.ruby-doc.org/core-1.9.3/Regexp.html 
>
> I cannot find a method called pre_match but its used in Rails... 
>
> @template.instance_variable_get("@#{Regexp.last_match.pre_match}") 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/NiP2THLS7y0J.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Re: Re: trouble with new app in rails

2012-07-25 Thread Rick
So where did those astericks come from?

You have a problem with your rvm ruby installation.

Here's what I see when I type *$(which ruby) --version

b*ash-3.2$* rvm list

rvm rubies

=* ruby-1.9.3-p194 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

*bash-3.2$* which ruby
/Users/richardlloyd/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
*bash-3.2$ *$(which ruby) --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]
*bash-3.2$ *

*My suggestion is to uninstall your ruby-1.9.3-p194 and install a clean 
copy.

Rick

On Monday, July 23, 2012 8:45:25 AM UTC-4, Ruby-Forum.com User wrote:
>
> Rick Lloyd wrote in post #1069775: 
> > My guess is you've got something wrong in your shell environment.  What 
> > do 
> > you see when you type: 
> > 
> > $(*which ruby) --version* 
> produced 
> bash: syntax error near unexpected token `--version*' 
>
> and 
> > *`which ruby` --version* 
>
> produced 
> bash: */home/sebah/.rvm/rubies/ruby-1.9.3-p194/bin/ruby: No such file or 
> directory 
>
> -- 
> 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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/tS-yyC6qWgQJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Re: Re: trouble with new app in rails

2012-07-23 Thread Rick
My guess is you've got something wrong in your shell environment.  What do 
you see when you type:

$(*which ruby) --version*

NOTE: this is proper syntax for sh, bash, or ksh.  For csh use: *`which 
ruby` --version*

Rick

On Monday, July 23, 2012 7:15:39 AM UTC-4, Ruby-Forum.com User wrote:
>
> Colin Law wrote in post #1069764: 
> > On 23 July 2012 11:58, Sebastjan H.  wrote: 
> >>> Colin 
> >> # =* - current && default 
> >> #  * - default 
> > 
> > What does 
> > rvm info 
> > show? 
> > 
> > Colin 
>
> rvm info: 
>
> ruby-1.9.3-p194: 
>
>   system: 
> uname:   "Linux sebah-laptop 3.0.0-23-generic #38-Ubuntu SMP Fri 
> Jul 6 13:47:10 UTC 2012 i686 i686 i386 GNU/Linux" 
> bash:"/bin/bash => GNU bash, version 4.2.10(1)-release 
> (i686-pc-linux-gnu)" 
> zsh: " => not installed" 
>
>   rvm: 
> version:  "rvm 1.13.4 (stable) by Wayne E. Seguin 
> , Michal Papis  
> [https://rvm.io/]"; 
> updated:  "2 months 11 days 13 seconds ago" 
>
>   ruby: 
> interpreter:  "ruby" 
> version:  "1.9.3p194" 
> date: "2012-04-20" 
> platform: "i686-linux" 
> patchlevel:   "2012-04-20 revision 35410" 
> full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) 
> [i686-linux]" 
>
>   homes: 
> gem:  "/home/sebah/.rvm/gems/ruby-1.9.3-p194" 
> ruby: "/home/sebah/.rvm/rubies/ruby-1.9.3-p194" 
>
>   binaries: 
> ruby: "/home/sebah/.rvm/rubies/ruby-1.9.3-p194/bin/ruby" 
> irb:  "/home/sebah/.rvm/rubies/ruby-1.9.3-p194/bin/irb" 
> gem:  "/home/sebah/.rvm/rubies/ruby-1.9.3-p194/bin/gem" 
> rake: "/home/sebah/.rvm/rubies/ruby-1.9.3-p194/bin/rake" 
>
>   environment: 
> PATH: 
> "/home/sebah/.rvm/gems/ruby-1.9.3-p194/bin:/home/sebah/.rvm/gems/ruby-1.9.3-p194@global/bin:/home/sebah/.rvm/rubies/ruby-1.9.3-p194/bin:/home/sebah/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
>  
>
> GEM_HOME: "/home/sebah/.rvm/gems/ruby-1.9.3-p194" 
> GEM_PATH: 
> "/home/sebah/.rvm/gems/ruby-1.9.3-p194:/home/sebah/.rvm/gems/ruby-1.9.3-p194@global"
>  
>
> MY_RUBY_HOME: "/home/sebah/.rvm/rubies/ruby-1.9.3-p194" 
> IRBRC:"/home/sebah/.rvm/rubies/ruby-1.9.3-p194/.irbrc" 
> RUBYOPT:  "" 
> gemset:   "" 
>
> -- 
> 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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/nnBki4VKj9gJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: rb_class_superclass not located in msvcrt-ruby191.dll

2012-07-14 Thread Rick
I don't see *gem install rake* in the list of tasks you ran after 
reinstalling ruby et. al.

Rick

On Saturday, July 14, 2012 1:06:16 AM UTC-4, Ricky D wrote:
>
> So, long story short, I had o format and reinstall my OS hence all my 
> dev utilities.
> git env sorted.
> DevKit was fine.
> Sphinx/mysql fine.
> Bundle installed perfectly.
> Everything is gravy until I go to rake db:create and build my database.
>
> Environment:
> OS: Win7 64-bit
> Ruby192
> gem -v 1.8.24
> rails 3.1.3
>
> Now the problem, when I rake anything I get a pop-up window
>
> "
> ruby.exe - Entry Point Not Found
>
> The procedure entry point rb_class_superclass could not be located in the 
> dynamic link library msvcrt-ruby191.dll
> "
>
> I've tried clean installing ruby, clearing the gems and reinstalling. 
> Stuck on what to do next.
>
> trace output:
> rake aborted!
> no such file to load -- ruby/prof
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:74:in
>  
> `require'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:74:in
>  
> `rescue in block in require'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:62:in
>  
> `block in require'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in
>  
> `each'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in
>  
> `require'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in 
> `require'
> E:/Documents/Websites/rails-app /trunk/config/application.rb:7:in ` (required)>'
> C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
> `require'
> C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
> `require'
> E:/Documents/Websites/rails-app/trunk/Rakefile:4:in `'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in
>  
> `load'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in
>  
> `load_rakefile'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in
>  
> `raw_load_rakefile'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:in
>  
> `block in load_rakefile'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
>  
> `standard_exception_handling'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:in
>  
> `load_rakefile'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in
>  
> `block in run'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
>  
> `standard_exception_handling'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
>  
> `run'
> C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in ` (required)>'
> C:/Ruby192/bin/rake:23:in `load'
> C:/Ruby192/bin/rake:23:in `'
>
> I've seen similar issues raised but for different lines in the dll and 
> relating to sqlite3. I'm not using sqlite3 at all though. I'm on mysql with 
> the mysql2 connector.
>
> Any help?
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/5nHSvQKiqQgJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



[Rails] Re: DEMO PROJECT

2012-07-12 Thread Rick
google rails demo app yields 
http://ruby.railstutorial.org/chapters/a-demo-app

looks like a good place to start

Rick

On Thursday, July 12, 2012 7:02:06 AM UTC-4, Amardeep Singh wrote:
>
> HELLO
>
> I need some Demo Project of ROR to practice on it..Plz anyone help me to 
> start with ROR.
> or send Pdf File With Description.
>
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/na9iZSIAYYMJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



[Rails] Re: active record association: has only one.

2012-07-11 Thread Rick
Go to http://guides.rubyonrails.org/association_basics.html and you'll find 
what you need.

As a side note, you should bookmark http://guides.rubyonrails.org/ and get 
familiar with its' contents.

Rick

On Wednesday, July 11, 2012 9:47:55 AM UTC-4, Ruby-Forum.com User wrote:
>
> Hello guys! 
> I'm new on RoR. I'm testing an application for married person using this 
> source 
> https://github.com/serv/Ruby-on-Rails-Tutorial-by-Michael-Hartl--v3.2- 
> The goal is: 
> - A sign-in person can only get only one follower ( his wife or husband) 
>
> Where should i modified this app for this features? 
> Thanks for your help! 
>
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/k6AvUWw7lxoJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



[Rails] Re: Controller Models

2012-07-10 Thread Rick
Rails uses four naming conventions for throughout it's code which need to 
be followed by the developer (you) for their code to fit with Rails.  These 
involve selective use or* singular* and *plural *together with *camelize*and 
*underscore*.

The simplest way to demonstrate the conventional use is to run:
   *rails generate scaffold your_new_object name:string 
description:text size:integer*

Then look at the model/view/controller files for uses of the variants on *
your_new_object
   your_new_object
   your_new_objects
   YourNewObject
   YourNewObjects

*If you're running on a unix system (any Linux or OSX) this command will 
find them all when run within your application directory:
*find . -name \*.rb -exec grep your_new {} \; -a -exec grep YourNew 
{} \; -a -print*

Rick 

On Monday, July 9, 2012 3:13:02 PM UTC-4, Ruby-Forum.com User wrote:
>
> Here I Just started to learn Ruby on Rails! My issues is when reading 
> the data using my controller pages. 
>
> I initiate my controller using this command 
>
> rails g controller schoolTypes 
>
> I then initiate my model has the following command 
>
> rails g model schoolType 
>
> Once this is done i then modify has follow the following pages 
>
> create_school_type 
> class CreateSchoolTypes < ActiveRecord::Migration 
>   def change 
> create_table :school_types do |t| 
>   t.integer :schoolTypeID 
>   t.string :name 
>   t.description :text 
>
>   t.timestamps 
> end 
>   end 
> end 
> did a rake db:migrate 
>
> Change the following page 
>
> school_types_controller.rb 
> class SchoolTypesController < ApplicationController 
>   def index 
> @schoolTypes = schooltype.all 
>   end 
>   def show 
>   end 
>   def new 
>   end 
>   def create 
>   end 
>   def update 
>   end 
>   def destroy 
>   end 
>   def edit 
>   end 
> end 
>
> index.html.erb 
> School Types 
> <% @schoolTypes.each do |schoolType|%> 
> <%= schoolTypes.name %> 
> <% end %> 
> If I go to the following page http://localhost:3000/school_types I get 
> the following errors 
> undefined local variable or method `schooltype' for 
> # 
>
> Any reason why? 
>
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/oFDQCqjw9N0J.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



[Rails] Re: Proxy Error

2012-07-06 Thread Rick


On Thursday, July 5, 2012 2:25:48 PM UTC-4, Gurdipe Dosanjh wrote:
>
> Hi All,
>
> I have just started to support a rails application and during the day I 
> have to restart the apache proxy becuase I get proxy errors.
>
> Is there any good guides I can look at that will help my understand apache 
> and the apache proxy, how to configure it so that this error is removed?
>
> Hello Gurdipe,

I've always found the documentation provided by Apache at 
http://httpd.apache.org/docs/ to be an excellent place to start.  You want 
to pay attention to the version of httpd you're using so you don't get a 
mismatch with the docs.  The FAQ at the same site is also helpful.
 
Rick

> Kind Regards and Thanks in advance.
>
> Gurdipe
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/o24fNGidiZAJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.



Re: [Rails] Re: Creating a new record doesnt update the browser view

2012-07-06 Thread Rick


On Friday, July 6, 2012 4:07:11 AM UTC-4, Colin Law wrote:
>
> On 5 July 2012 23:29, cyber c.  wrote: 
> >>Now run the app, bring up the index and note the count shown (what is 
> >>it and how many records do you see), add a record and then show the 
> >>index again.  Does the count change?  Post the log for that complete 
> >>cycle. 
> > 
> > 
> > The count shown is old , doesnt include the newly created one. 
> > 
> > 
> > Started GET "/trials/new" for 127.0.0.1 at Thu Jul 05 15:22:17 -0700 
> > 2012 
> > Processing by TrialsController#new as HTML 
> >   Rendered trials/_form.html.erb (43.9ms) 
> >   Rendered trials/new.html.erb within layouts/application (54.3ms) 
> > Completed 200 OK in 90ms (Views: 88.9ms | ActiveRecord: 0.0ms) 
> > 
> > 
> > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 
> > 15:22:17 -0700 2012 
> > Served asset /trials.css - 304 Not Modified (0ms) 
> > 
> > 
> > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 
> > 15:22:17 -0700 2012 
> > Served asset /trials.js - 304 Not Modified (0ms) 
> > 
> > 
> > Started POST "/trials" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 
> > Processing by TrialsController#create as HTML 
> >   Parameters: {"commit"=>"Create Trial", 
> > "authenticity_token"=>"cDA9t9ShPJPyZAOQH8rlXS038tLGJGCE9nItrHrD8JA=", 
> > "trial"=>{"name"=>"python", "email"=>"m...@gmail.com"}, "utf8"=>"✓"} 
> >   ^[[1m^[[35m (0.1ms)^[[0m  begin transaction 
> >   ^[[1m^[[36mSQL (31.6ms)^[[0m  ^[[1mINSERT INTO "trials" ("created_at", 
> > "email", "name", "updated_at") VALUES (?, ?, ?, ?)^[[0m  [["created_at", 
> > Thu, 05 Jul 2012 22:22:41 UTC +00:00], ["email", "m...@gmail.com"], 
> > ["name", "python"], ["up 
> >   ^[[1m^[[35m (1.2ms)^[[0m  commit transaction 
> > Redirected to http://localhost:3001/trials/3 
> > Completed 302 Found in 40ms (ActiveRecord: 32.9ms) 
> > 
> > 
> > Started GET "/trials/3" for 127.0.0.1 at Thu Jul 05 15:22:41 -0700 2012 
> > Processing by TrialsController#show as HTML 
> >   Parameters: {"id"=>"3"} 
> >   ^[[1m^[[36mTrial Load (0.3ms)^[[0m  ^[[1mSELECT "trials".* FROM 
> > "trials" WHERE "trials"."id" = ? LIMIT 1^[[0m  [["id", "3"]] 
> >   Rendered trials/show.html.erb within layouts/application (2.6ms) 
> > Completed 200 OK in 29ms (Views: 25.7ms | ActiveRecord: 0.3ms) 
> > 
> > 
> > Started GET "/assets/trials.css?body=1" for 127.0.0.1 at Thu Jul 05 
> > 15:22:41 -0700 2012 
> > Served asset /trials.css - 304 Not Modified (0ms) 
> > 
> > 
> > Started GET "/assets/trials.js?body=1" for 127.0.0.1 at Thu Jul 05 
> > 15:22:41 -0700 2012 
> > Served asset /trials.js - 304 Not Modified (0ms) 
> > 
> > 
> > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:22:43 -0700 2012 
> > Processing by TrialsController#index as HTML 
> >   Rendered trials/index.html.erb within layouts/application (2.8ms) 
> > Completed 200 OK in 11ms (Views: 11.0ms | ActiveRecord: 0.0ms) 
>
> Once again note that there is no sql showing the trials being fetched 
>
> > ... 
> > I see the newer count (expected) once i restart the server 
> > 
> > log: 
> > 
> > Started GET "/trials" for 127.0.0.1 at Thu Jul 05 15:27:08 -0700 2012 
> > Connecting to database specified by database.yml 
> > Processing by TrialsController#index as HTML 
> >   Trial Load (0.1ms)  SELECT "trials".* FROM "trials" 
> >   Rendered trials/index.html.erb within layouts/application (7.2ms) 
> > Completed 200 OK in 94ms (Views: 72.9ms | ActiveRecord: 1.3ms) 
>
> Here we /do/ see the sql fetching the records.  Very odd.  There must 
> be something going wrong with the caching.  Have you changed anything 
> in the the config directory other than database.yml and routes.rb? 
> Specifically environment.rb or anything in config/environments?  Are 
> you including any gems that might be relevant? 
>
> Post database.yml and the result of 
> gem list 
>
> Has anyone else seen this situation before? 
>
> If, after you create a new record in your database, you just use the 
browser's back button (or delete) to go back in history to your 

[Rails] Re: Deploying a rails 3.2 app

2012-07-06 Thread Rick
Hello Louis,

Just to add to Fred's good advice, specifically the paragraph on "disaster 
recovery plans"...

I realize this might sound like extreme advise but it's based on experience 
deploying complex systems to various government agencies.  I would suggest 
that you need 3 sets of your production hardware.  One to run your 
production system on, two to serve as your hot-swappable backup (running in 
parallel and mirroring the live server) and three to serve as your 
production test bed.

My experience has been that the things you do least often, like build a new 
server, are the things most apt to chomp on your tender bits.  It's 
surprising how fast you forget the files you modified to get to the final 
magic moment with apache and passenger, the change and the reasons for 
them.  Document every step you go through building your first server then 
hand your document off to someone else to build the second.  Fold their 
comments and changes into your document and have another person build the 
third server.

Also, always have fun.

Rick

On Friday, July 6, 2012 4:18:54 AM UTC-4, Frederick Cheung wrote:
>
> On Jul 5, 6:32 pm, Louis Davin  wrote: 
> > Hello there, 
> > 
> > I have been working in a startup for a few weeks now, and I am 
> responsible 
> > for setting up the production environment and for "strengthening" the 
> > product (a rails app). 
> > By the way I've started reading "Deploying rails" from pragprog. 
> > 
> > The deployment of the app will be done through a private beta with about 
> > 200 members. 
> > 
> > The startup currently owns a VPS where the staging environment runs. 
> > For now, it is planned to install the production environment on the same 
> > server. (I guess it's not ideal, but is this a real mistake? should we 
> > reconsider those small savings?) 
> > 
> > I inherit this configuration from the VPS: a ubuntu install, with MySQL, 
> > Apache/Passenger and Sphinx. Deployment is done via capistrano. 
> > (Do you have any comments about the apache/passenger combo ? How is it 
> > compared to nginx/unicorn ? Should we consider changing?) 
> > 
> > Here is my battle plan: 
> > 
> > Concerning the server/monitoring part 
> > - I consider installing the New Relic service and gem to monitor the app 
> > and the server. 
> > - I consider using Papertrail to aggregate all the logs (server and 
> app). 
> > - Stay with exception_notification (by mail) or use Airbrake to track 
> > notifications. 
> > 
> > Concerning the app itself 
> > - I have finished migrating the static files to the assets pipeline. 
> (These 
> > assets are precompiled by capistrano when deploying). 
> > - I consider migrating the assets to Amazon S3 (I consider specifying 
> the 
> > host-name and using the "asset_sync" gem for the static assets, and use 
> the 
> > "fog" gem for the uploads through carrierwave). 
> > - Use a task queue for time-consuming tasks (especially sending mails, 
> are 
> > there other task to immediately delay?), with "delayed_job" 
> > - Use SendGrid to send mails generated by the app 
> > 
> > Do you have any remarks, suggestions ? 
> > Are there things bothering you concerning the choices (they are of 
> course 
> > temporary) of services or gems ? 
> > Have I forgotten important points ? 
>
> So with 200 users, a lot of this stuff just doesn't matter (e.g. S3 
> served static assets versus static assets served straight from disk). 
> The choices you've made sound sensible though. Stuff like switching 
> from passenger to nginx + unicorn isn't particularly hard. 
>
> I have found airbrake to be a little flaky of late - we stopped 
> getting exception notifications and it took 4-5 days of pestering 
> their support guys to  get it fixed. I've heard good things about 
> bugsnag although I haven't got around to leaving airbrake yet. 
>
> You may wish to consider your disaster recovery plans - if your VPS 
> should fail how would you replace it. I assume you have backups of the 
> data (or better a slave continually replicating the master database) 
> but server stuff is important too: the last thing you want to be doing 
> after such an incident is spending half a day reinstalling/ 
> reconfiguring apache, rails etc. I would highly recommend automating 
> how you build server instances. Chef, puppet, sprinkle, homegrown - to 
> me it doesn't matter so much as long as you can bring up new instances 
> easily. You may be in an environment where you can build images that 
> servers boot off (e.g. EC2 allows you to make A

[Rails] Project Fedena

2012-06-12 Thread Rick Bychowski
Hi,

I'm new to RoR. I am interested in Project Fedena (http://projectfedena.org/), 
an open source school information system. Actually the bare open source 
code base is not much help to me by itself, but Foradian sells a "Pro" 
version (http://www.fedena.com/solutions). The project has been in the open 
source for three years, but I can't find a single 3rd party open source 
contribution. That worries me. They claim that fedena is in use in over 
40,000 schools, but NOT ONE 3rd PARTY MODULE?

The price for the "Pro" version is very very competitive. I am thinking 
"too good to be true". If I saw an active developer community I'd feel 
better. Even the forums are fairly vacant, except for installation issues. 
I need to make a recommendation soon to our school director. The other 
system is PHP based and will likely be much more expensive.

Can anyone here vouch for the quality of the code? Is it inherently 
extensible because it is a rails application? I have a need to add LDAP 
support, and if the code is well-structured, I'd hope that wouldn't require 
a lot of work.

Any insight that you have would be appreciated.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/I9ZJRFgAhoUJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] RoR 2.3.5

2012-06-12 Thread Rick Bychowski
I am evaluating an application that runs on RoR 2.3.5. What are the 
liabilities of an application that is based on this older version of RoR? I 
am concerned about security and ease of development. How common is this in 
the Rails world?

TIA

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/tiAu285h0zUJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Using activeresource for client/server model

2012-06-11 Thread Rick


On Friday, June 8, 2012 7:35:56 PM UTC-4, Ruby-Forum.com User wrote:
>
> Hi, 
>
> i have a rails app running which has a DB of records. I wanted to 
> develop a client app which can 
> 1) view the records 
> 2) edit them 
>
> So i have created a new rails app (for this client) and edited the model 
> file "record.rb" 
>
> class Record < ActiveResource::Base 
>   self.site = "http://0.0.0.0:3000"; 
> end 
>
> From the rails console of client i can access the DB records 
> (Record.find :all etc ). But when i started a rails server on this 
> client using a diff port , i cant retrieve the DB records . Anyone who 
> have used Activeresource could throw some light on this? 
>

Your class Record has the site and port hardwired in with the line:
*self.site = "http://0.0.0.0:3000"*

You need to change that to the new value and reconnect.

Rick

>
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/1WLORCq1Xp8J.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] rake about > Environment staging

2012-06-11 Thread Rick
I'm not really too up on rvm but I wonder...

Is it possible that your work environment, specifically the login shell 
that you are using to type commands in a terminal window, includes an alias 
for rake?  Since staging is not one of the three default environments for 
RoR it had to be created with all rules for it's use somewhere "outside" 
the vanilla system.

What I'm thinking is that somewhere you have a runtime command file (eg.: 
.bashrc, .cshrc, .profile, ...) that contains a line:
 *alias rake='rake RAILS_ENV=staging'*

To find out if this is so, type:
 *alias rake*

Rick

On Sunday, June 10, 2012 7:19:30 AM UTC-4, der_tom wrote:
>
> inline
>
> On Sun, Jun 10, 2012 at 12:30 PM, Colin Law wrote:
>
>> On 10 June 2012 11:19, tom  wrote:
>>
>> Top posting still :(
>>
>> > yes, thats correct
>> >
>> > RAILS_ENV=development rake db:migrate
>> >>> runs in staging env.
>>
>> I don't understand why you then went on to ask
>> >> > where does rake get the environment info if i ommit  'RAILS_ENV' when
>> >> > executing a rake command?
>>
>> Two points (please reply inline so that it makes it easier to follow
>> the thread.  Thanks
>>
>> 1. How do you know that rake db:migrate is running in staging environment?
>> > because the migrations are being executed on the staging-db (eg adding 
>> a new colum)
>> 2. Please post database.yml here.
>>
>  
> >> database.yml is pretty much standard:
>  
> staging:
>   adapter: mysql2
>   encoding: utf8
>   reconnect: false
>   database: myproject_staging
>   pool: 5
>   username: myproject_dbuser
>   password: myproject_dbuser
>   socket: /var/run/mysqld/mysqld.sock
> development:
>   adapter: mysql2
>   encoding: utf8
>   reconnect: false
>   database: myproject_development
>   pool: 5
>   username: myproject_dbuser
>   password: myproject_dbuser
>   socket: /var/run/mysqld/mysqld.sock
> test:
>   adapter: mysql2
>   encoding: utf8
>   reconnect: false
>   database: myproject_test
>   pool: 5
>   username: myproject_dbuser
>   password: myproject_dbuser
>   socket: /var/run/mysqld/mysqld.sock
> production:
>   adapter: mysql2
>   encoding: utf8
>   reconnect: false
>   database: myproject_production
>   pool: 5
>   username: myproject_dbuser
>   password: myproject_dbuser
>   socket: /var/run/mysqld/mysqld.sock 
>
>
> >> as i said, starting webrick works fine in different environments, 
> whereas rake tasks always use "staging", no matter what specify. here a 
> sample of a migration:
> rails g migration add name_to_testbooks name:string
> /home/tom/.rvm/gems/ruby-1.9.3-p194@mygemset/gems/railties-3.2.1/lib/rails/script_rails_loader.rb:11:
>  
> warning: Insecure world writable dir /home/tom in PATH, mode 040777
> /home/tom/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:211:
>  
> warning: Insecure world writable dir /home/tom in PATH, mode 040777
>   invoke  active_record
>   createdb/migrate/20120610111033_add.rb
> tom@debian6ror3:~/rails3/myproject$ RAILS_ENV=development rake db:migrate 
> --trace
> /home/tom/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:211:
>  
> warning: Insecure world writable dir /home/tom in PATH, mode 040777
> ** Invoke db:migrate (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> ** Invoke db:load_config (first_time)
> ** Invoke rails_env (first_time)
> ** Execute rails_env
> ** Execute db:load_config
> ** Execute db:migrate
> ==  Add: migrating 
> 
> -- add_column(:testbooks, :name, :string)
>-> 0.3212s
> ==  Add: migrated (0.3216s) 
> ===
>
> ** Invoke db:_dump (first_time)
> ** Execute db:_dump
> ** Invoke db:schema:dump (first_time)
> ** Invoke environment 
> ** Invoke db:load_config 
> ** Execute db:schema:dump
>
>
> furthermore, removing staging from the database.yml results in rake 
> telling me that it doesnt find a staging adapter - even though when i run 
> in ''dev mode"
>
> @rvm i installed a user-rvm, straight from the docs. does that interfere?
>
> @ill setup a new user and rvm  again, then reusing the GEMFILE/rvmrc
>
>
>
>
>
>
>
>> Colin
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-talk@googl

Re: [Rails] rake about > Environment staging

2012-06-10 Thread Rick
How about running: "export RAILS_ENV=development ; rake about"

What does rake report for Environment in this case?

On Sunday, June 10, 2012 6:30:39 AM UTC-4, Colin Law wrote:
>
> On 10 June 2012 11:19, tom  wrote: 
>
> Top posting still :( 
>
> > yes, thats correct 
> > 
> > RAILS_ENV=development rake db:migrate 
> >>> runs in staging env. 
>
> I don't understand why you then went on to ask 
> >> > where does rake get the environment info if i ommit  'RAILS_ENV' when 
> >> > executing a rake command? 
>
> Two points (please reply inline so that it makes it easier to follow 
> the thread.  Thanks 
>
> 1. How do you know that rake db:migrate is running in staging environment? 
>
> 2. Please post database.yml here. 
>
> Colin 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/xFP2wgVxtEAJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] why to get the error 'undefined method `write_inheritable_attribute''

2012-06-06 Thread Rick Casey
I started getting this error message when I attempt to do some rake
tasks:

$ rails destroy scaffold genotypes
/usr/share/rails-ruby1.8/railties/lib/rails_generator/options.rb:32:in
`default_options': undefined method `write_inheritable_attribute' for
Rails::Generator::Base:Class (NoMethodError)
  from
/usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:90:in
`'
  from
/usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:85:in
`'
  from
/usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:48:in
`'
  from
/usr/share/rails-ruby1.8/railties/lib/rails_generator/base.rb:6:in `'
  from
/home/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
  from
/home/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
  from /usr/share/rails-ruby1.8/railties/lib/rails_generator.rb:34:in
`'
  from
/home/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
  from
/home/caseyr/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
  from /usr/share/rails-ruby1.8/railties/bin/rails:14:in `'
$


I found a related old message here that seemed to indicate my problem
might be caused because I did not install gems as root, so here is what
my gem environment looks like:

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.21
  - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i486-linux]
  - INSTALLATION DIRECTORY: /home/caseyr/.rvm/gems/ruby-1.9.3-p194
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /home/caseyr/.rvm/gems/ruby-1.9.3-p194/bin
  - RUBYGEMS PLATFORMS:
- ruby
- x86-linux
  - GEM PATHS:
 - /home/caseyr/.rvm/gems/ruby-1.9.3-p194
 - /home/caseyr/.rvm/gems/ruby-1.9.3-p194@global
  - GEM CONFIGURATION:
 - :update_sources => true
 - :verbose => true
 - :benchmark => false
 - :backtrace => false
 - :bulk_threshold => 1000
  - REMOTE SOURCES:
 - http://rubygems.org/

Can anyone tell if this is incorrect? Do I need to uninstall and
reinstall gems?

Any suggestions much appreciated...

--rick

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: CSV Import Issue

2012-05-01 Thread Rick
You'll probably have better results if you use the read method.  CSV.parse 
is meant to be applied to a String.

>From the docs:
*

parse( str, options = Hash.new ) { |row| ... } click to toggle source 
 parse( str, options = Hash.new ) 

This method can be used to easily parse 
CSVout of a 
String . 
You may either provide a block which will be called with each row of the 
String in 
turn, or just use the returned 
Array  of 
Arrays (when no block is given).

You pass your str to read from, and an optional options Hash containing 
anything 
CSV::new()understands.
read(path, *options) 
 
Use to slurp a 
CSVfile into an 
Array  of 
Arrays. Pass the path to the file and any options 
CSV::new()understands.
 This method also understands an additional 
:encoding parameter that you can use to specify the Encoding of the data in 
the file to be read. You must provide this unless your data is in 
Encoding::default_external(). 
CSVwill use this 
to determine how to parse the data. You may provide a second 
Encoding to have the data transcoded as it is read. For example, encoding: 
"UTF-32BE:UTF-8" would read UTF-32BE data from the file but transcode it to 
UTF-8 before 
CSVparses it.
  readlines(*args) 
 
Alias for 
CSV::read()
.
  table(path, options = Hash.new) 

A shortcut for:

CSV.read( path, { headers:   true,
  converters::numeric,
  header_converters: :symbol }.merge(options) )

*


On Tuesday, May 1, 2012 12:29:32 PM UTC-4, Ruby-Forum.com User wrote:
>
> Hi, This seems to be a very small error but I cannot find any solution 
> to this problem.. I am trying to use the CSV gem in my rails(3.2) 
> application(ruby 1.9.3) and I am getting an error "NoMethodError". My 
> controller is: 
> require 'csv' 
>
>def import 
>   file = params[:file] <-- error 
>   CSV.parse(file, :headers => false) do |row| 
>   Event.new(:Ename => row[0], :Edate => row[1], :Elocation => 
> row[2], :Edesc => row[3], :Oname => row[4], :Oemail => row[5], :Odetail 
> => row[6]) 
>   end 
> end 
>
> I am getting this file from a view where the users can upload the csv 
> file. I am getting a NoMethodError(undefined method 'nil' for 
> nil:NilClass). My best guess is I am using this method wrong, but then 
> my next question is how to parse the Csv data? I want to retrieve the 
> file from my view and then parse the data into the database. How can I 
> open the file for the same? Is the above method not correct? 
>
> -- 
> Posted via http://www.ruby-forum.com/. 
>

On Tuesday, May 1, 2012 12:29:32 PM UTC-4, Ruby-Forum.com User wrote:
>
> Hi, This seems to be a very small error but I cannot find any solution 
> to this problem.. I am trying to use the CSV gem in my rails(3.2) 
> application(ruby 1.9.3) and I am getting an error "NoMethodError". My 
> controller is: 
> require 'csv' 
>
>def import 
>   file = params[:file] <-- error 
>   CSV.parse(file, :headers => false) do |row| 
>   Event.new(:Ename => row[0], :Edate => row[1], :Elocation => 
> row[2], :Edesc => row[3], :Oname => row[4], :Oemail => row[5], :Odetail 
> => row[6]) 
>   end 
> end 
>
> I am getting this file from a view where the users can upload the csv 
> file. I am getting a NoMethodError(undefined method 'nil' for 
> nil:NilClass). My best guess is I am using this method wrong, but then 
> my next question is how to parse the Csv data? I want to retrieve the 
> file from my view and then parse the data into the database. How can I 
> open the file for the same? Is the above method not correct? 
>
> -- 
> 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 view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/QNLiQBHzpAAJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] How to cap table with active record

2012-04-30 Thread Rick
If your strategy is to just keep the newest MAXNUMBER records you might 
consider just adding an after_create method to your model.

On Friday, April 27, 2012 4:56:30 PM UTC-4, Colin Law wrote:
>
> On 27 April 2012 16:23, Jedrin  wrote: 
> >  We want to use SQL/active record for logging but limit the table size 
> > so that older messages disappear off of the table Some process has to 
> > run periodically to do that. 
> > 
> > Suppose I want to keep my table size to not much bigger than 
> > 50,000,000 rows or so. What is the easiest, most efficient way to 
> > delete any extra rows that there may be ? This is an SQL/active record 
> > problem I have not encountered before. 
> > 
> >  I would know in theory how to get all the records as an array by 
> > calling MyLog.find(:all) and ordering it by date and then iterating 
> > from where I want to chop off to the end and deleting each one, but 
> > that may not be the most efficient or acceptable way to do that. 
>
> If you have a reasonably consistent number of new records each day or 
> week or whatever then you could delete old ones by date rather than 
> count, so keeping six months worth of records for example.  This would 
> be much easier as you could just find the records where created_at is 
> before a given date and delete them.  Put an index on created_at 
> obviously. 
>
> Colin 
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/xzIqMB-OhlYJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: "no such file to load -- sqlite3" Rails

2011-11-15 Thread Rick W.
Check that you have gcc installed.

This error comes up if it is not installed, because of the method they
use to check the existence of sqlite3.h: They simply try to compile this
one-line program:

#include 

If the compilation fails, they tell you that sqlite3.h is missing, but
the compilation will also fail if gcc is not present. It's not a very
smart check...

Lisa Concli wrote in post #641008:
> Hi to everyone!
>
> I'm new with Ruby on Rails..
> I use linux (an italian distribution, that is just like Slackware)
>
> I'm writing my first program with rails.. Nothing special.. it is the
> famous Hello World..!
> (I'm reading the book of Dave Thomas "Agile Web Development with Rails")
>
> Well the problem is that when I point my browser to
> http://localhost:3000/dire/ciao
> ("dire" is my controller and "ciao" is the action)
> the browser displays this problem:
>
>
>  MissingSourceFile in DireController#ciao
>
>  no such file to load -- sqlite3
>
>  This error occurred while loading the following files:
>sqlite3
>
>
> So I write in my shell:
>  gem install sqlite3-ruby
>
> The gem was installed, but the problem remains..!
>
> Do you know what should I do?
>
>
> I don't know if I have to change something in the file database.yml..?
> database.yml:
>
>  # SQLite version 3.x
>  #   gem install sqlite3-ruby (not necessary on OS X Leopard)
>  development:
>adapter: sqlite3
>database: db/development.sqlite3
>timeout: 5000
>
>  # Warning: The database defined as 'test' will be erased and
>  # re-generated from your development database when you run 'rake'.
>  # Do not set this db to the same as development or production.
>  test:
>adapter: sqlite3
>database: db/test.sqlite3
>timeout: 5000
>
>  production:
>adapter: sqlite3
>database: db/production.sqlite3
>timeout: 5000
>
>
> Can someone help me?
> Thanks!!!
>
> Lisa

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rails 3.1 string conversion errors

2011-10-07 Thread Rick
I'm seeing many errors when installing Rails 3.1 and other gems.
These are all showing up in the ri/rdoc portion of the install
sequence and look like this:


gem install rdoc
Depending on your version of ruby, you may need to install ruby rdoc/
ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-3.9.4
1 gem installed
Installing ri documentation for rdoc-3.9.4...
unable to convert U+201D from UTF-8 to US-ASCII for lib/rdoc/text.rb,
skipping
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to
UTF-8 to US-ASCII for History.txt, skipping
Installing RDoc documentation for rdoc-3.9.4...
unable to convert U+201D from UTF-8 to US-ASCII for lib/rdoc/text.rb,
skipping
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to
UTF-8 to US-ASCII for History.txt, skipping


ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

Any idea what's going on?

thanks in advance
Rick

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] t.references question regarding migrations..

2011-08-02 Thread Rick F
Ok.. So I've been doing more reading after buying a few RoR books
now.. I've got
my data models setup without any foreign keys between the tables (much
to my dismay).

What I'm wondering are the following :

1) should I be manually setting up the foreign keys by editing the
initial migration
stuff to add the missing "t.references :my_cool_object" or should
I be using the
scaffold generator for that when I create the 2nd and subsequent
tables --?  I'm
ordering the creation of the tables to ensure the initial tables
are created first and
subsequent belongs_to and has_xxx are put in afterwards by hand --
I'm now
thinking I should probably have put xxx:references as part of the
scaffold generation
line when building the secondary set of tables to ensure the
proper "t:references"
were put in the migration area -- will that ensure my foreign keys
are established
when I do the first "rake db::migrate"?

2) If I've got tailored changes in either of the model files or in the
migrations area,
would the scaffolding blow those away if I re-do a piece of it
from the command line?
(e.g. will I lose my belongs_to and has_one/many associations in
the model files)?

3) Where can I find the available list of commands for the scaffold
generator so I can make
proper use of it?  I didn't see much in the full rails API docs
but perhaps I overlooked it?

Thanks!  I'm hoping I can put this data modeling behind me today and
move on to the
more entertaining parts (generating an app!).

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Question regarding associations..

2011-07-29 Thread Rick & Nellie Flower
Chris -- 

one more question if you don't mind too much!  So, I blew away everything and 
started over this
time using just the command line tools w/o fiddling around (at least outside of 
adding the enum
pieces -- which seem on the surface like they might plug into the generator).. 
Below are the commands I use and works (sort-of) when using the web-interface 
to http://localhost:3000/users/new

However, I don't believe it's creating the associations correctly -- the 
"has_one" is incorrect as it's
kicked out when issuing the initial migrate to setup the database..  Do I need 
to put the has_one
in by hand or is my syntax messed up?  I was looking over the api-docs and 
thought i had it right
but perhaps not.  Below are the commands I issued :

1) rails new test
2) rails generate scaffold user address:has_one acct_locked:boolean 
family_id:integer is_profile_setup:boolean last_login:datetime password:string 
security_question:string security_answer:string username:string type:string
3) rails generate model address user:references street:string city:string 
state:string zip:string email:string phone:string
4) bundle exec rake db:migrate

I get this on step #4 above :
rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `has_one' for 
#
/Users/nrf/.rvm/gems/ree-1.8.7-2011.03/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/schema_definitions.rb:326:in
 `method_missing'

Ugg.. 

On Jul 28, 2011, at 11:50 PM, Chris Kottom wrote:

> If you want to do revisions on existing tables (adding columns, changing data 
> types, etc.) you can use migrations for that as well.  Experiment on the 
> command line with patterns like:
> 
> rails g migration add_columns_to_addresses column_1:string column_2:integer 
> ...
> rails g migration remove_columns_from_addresses column_1:string 
> column_2:integer ...
> 
> The generator will try to figure out what you're attempting to do if you give 
> it some basic instructions and if what you want to do isn't too complicated.
> 
> On Fri, Jul 29, 2011 at 8:35 AM, Rick & Nellie Flower  
> wrote:
> Thanks for the reply Chris..
> 
> I'll switch away from Camelcase.. I use that at work all day long (C++) so 
> I'm used to looking at
> it.
> 
> I initially used the generator but when revising tables it didn't want to run 
> anymore complaining 
> some of the files were already there -- which is why I resorted to 
> hand-edits.  I'll do some more
> reading on what you suggested.. Thx!
> 
> -- Rick
> 
> On Jul 28, 2011, at 11:22 PM, Chris Kottom wrote:
> 
>> Are you not using generators for the initial creation of your model and 
>> migration source files?  I'm asking because I think I can count on one hand 
>> the number of times I've ever written out a create_table function myself.  
>> Your inputs from the command line should do all this for you along with some 
>> of the work of setting up your model associations (e.g. the belongs_to call 
>> in your Address class definition) and save you some effort.  If you're using 
>> the generators properly, you may never have to touch the migration files for 
>> simpler applications.
>> 
>> rails g scaffold user acctLocked:boolean familyId:integer 
>> isProfileSetup:boolean ...
>> rails g model address user:references address:string city:string ...
>> 
>> For more info:
>> http://guides.rubyonrails.org/getting_started.html
>> http://guides.rubyonrails.org/command_line.html#rails-generate
>> 
>> One other small thing: you're writing your variable names using camel case 
>> (lowerCaseWithCapitalsIndicatingWordBoundaries) whereas the more widely 
>> recognized Ruby convention is to use all_lower_case_with_underscores.  I 
>> left your variable names as-is in the sample code above, but if it's code 
>> that anyone else will ever see or work on, you might consider changing it.
>> 
>> On Fri, Jul 29, 2011 at 4:43 AM, Rick & Nellie Flower  
>> wrote:
>> Ok.. Still working on this stuff.. I've got the t.reference in the migration 
>> for the address class and moved the belongs_to and has_one in the model 
>> classes as indicated (I didn't notice that!).
>> 
>> I noticed in the association-basics that I should be putting a create_table 
>> function (if that's what
>> it's called) in the CreateUsers class for Migrations but I'm concerned about 
>> doing that since I'll be using the address class on more than just the 
>> 'users' class -- does it really belong there or ??
>> Perhaps I'm overthinking this.. ??
>> 
>> Below are the tw

Re: [Rails] Question regarding associations..

2011-07-29 Thread Rick & Nellie Flower
Thanks!  I just realized I've got the "destroy" feature at my disposal and that 
I've got a LOT of 
reading ahead of me!

I'm thinking I'll just blow things away and recreate until I find what I'm 
looking for and it works
as expected.  That might be easiest to ensure that the migrations don't bite me 
since this is just
the VERY early stages of an application..

-- Rick
On Jul 28, 2011, at 11:50 PM, Chris Kottom wrote:

> If you want to do revisions on existing tables (adding columns, changing data 
> types, etc.) you can use migrations for that as well.  Experiment on the 
> command line with patterns like:
> 
> rails g migration add_columns_to_addresses column_1:string column_2:integer 
> ...
> rails g migration remove_columns_from_addresses column_1:string 
> column_2:integer ...
> 
> The generator will try to figure out what you're attempting to do if you give 
> it some basic instructions and if what you want to do isn't too complicated.
> 
> On Fri, Jul 29, 2011 at 8:35 AM, Rick & Nellie Flower  
> wrote:
> Thanks for the reply Chris..
> 
> I'll switch away from Camelcase.. I use that at work all day long (C++) so 
> I'm used to looking at
> it.
> 
> I initially used the generator but when revising tables it didn't want to run 
> anymore complaining 
> some of the files were already there -- which is why I resorted to 
> hand-edits.  I'll do some more
> reading on what you suggested.. Thx!
> 
> -- Rick
> 
> On Jul 28, 2011, at 11:22 PM, Chris Kottom wrote:
> 
>> Are you not using generators for the initial creation of your model and 
>> migration source files?  I'm asking because I think I can count on one hand 
>> the number of times I've ever written out a create_table function myself.  
>> Your inputs from the command line should do all this for you along with some 
>> of the work of setting up your model associations (e.g. the belongs_to call 
>> in your Address class definition) and save you some effort.  If you're using 
>> the generators properly, you may never have to touch the migration files for 
>> simpler applications.
>> 
>> rails g scaffold user acctLocked:boolean familyId:integer 
>> isProfileSetup:boolean ...
>> rails g model address user:references address:string city:string ...
>> 
>> For more info:
>> http://guides.rubyonrails.org/getting_started.html
>> http://guides.rubyonrails.org/command_line.html#rails-generate
>> 
>> One other small thing: you're writing your variable names using camel case 
>> (lowerCaseWithCapitalsIndicatingWordBoundaries) whereas the more widely 
>> recognized Ruby convention is to use all_lower_case_with_underscores.  I 
>> left your variable names as-is in the sample code above, but if it's code 
>> that anyone else will ever see or work on, you might consider changing it.
>> 
>> On Fri, Jul 29, 2011 at 4:43 AM, Rick & Nellie Flower  
>> wrote:
>> Ok.. Still working on this stuff.. I've got the t.reference in the migration 
>> for the address class and moved the belongs_to and has_one in the model 
>> classes as indicated (I didn't notice that!).
>> 
>> I noticed in the association-basics that I should be putting a create_table 
>> function (if that's what
>> it's called) in the CreateUsers class for Migrations but I'm concerned about 
>> doing that since I'll be using the address class on more than just the 
>> 'users' class -- does it really belong there or ??
>> Perhaps I'm overthinking this.. ??
>> 
>> Below are the two class definitions for both the model & migration :
>> 
>> class Address < ActiveRecord::Base
>>  belongs_to :user
>>  belongs_to :organization
>>  belongs_to :supplier
>> end
>> 
>> class CreateAddresses < ActiveRecord::Migration
>> 
>>  def self.up
>>create_table :addresses do |t|
>>  t.string :address
>>  t.string :city
>>  t.string :state
>>  t.string :zip
>>  t.string :email
>>  t.string :phone
>>  t.references : users
>> 
>>  t.timestamps
>>end
>>  end
>> 
>>  def self.down
>>drop_table :addresses
>>  end
>> end
>> 
>> =
>> class User < ActiveRecord::Base
>>  enum_attr :accountType, %w(regular admin site_admin), :init=>:regular
>> 
>>  has_one :name
>>  has_one :address
>>  has_one :organization
>> 
>> end
>> 
>> class CreateUsers < ActiveRecord

Re: [Rails] Question regarding associations..

2011-07-28 Thread Rick & Nellie Flower
Thanks for the reply Chris..

I'll switch away from Camelcase.. I use that at work all day long (C++) so I'm 
used to looking at
it.

I initially used the generator but when revising tables it didn't want to run 
anymore complaining 
some of the files were already there -- which is why I resorted to hand-edits.  
I'll do some more
reading on what you suggested.. Thx!

-- Rick

On Jul 28, 2011, at 11:22 PM, Chris Kottom wrote:

> Are you not using generators for the initial creation of your model and 
> migration source files?  I'm asking because I think I can count on one hand 
> the number of times I've ever written out a create_table function myself.  
> Your inputs from the command line should do all this for you along with some 
> of the work of setting up your model associations (e.g. the belongs_to call 
> in your Address class definition) and save you some effort.  If you're using 
> the generators properly, you may never have to touch the migration files for 
> simpler applications.
> 
> rails g scaffold user acctLocked:boolean familyId:integer 
> isProfileSetup:boolean ...
> rails g model address user:references address:string city:string ...
> 
> For more info:
> http://guides.rubyonrails.org/getting_started.html
> http://guides.rubyonrails.org/command_line.html#rails-generate
> 
> One other small thing: you're writing your variable names using camel case 
> (lowerCaseWithCapitalsIndicatingWordBoundaries) whereas the more widely 
> recognized Ruby convention is to use all_lower_case_with_underscores.  I left 
> your variable names as-is in the sample code above, but if it's code that 
> anyone else will ever see or work on, you might consider changing it.
> 
> On Fri, Jul 29, 2011 at 4:43 AM, Rick & Nellie Flower  
> wrote:
> Ok.. Still working on this stuff.. I've got the t.reference in the migration 
> for the address class and moved the belongs_to and has_one in the model 
> classes as indicated (I didn't notice that!).
> 
> I noticed in the association-basics that I should be putting a create_table 
> function (if that's what
> it's called) in the CreateUsers class for Migrations but I'm concerned about 
> doing that since I'll be using the address class on more than just the 
> 'users' class -- does it really belong there or ??
> Perhaps I'm overthinking this.. ??
> 
> Below are the two class definitions for both the model & migration :
> 
> class Address < ActiveRecord::Base
>  belongs_to :user
>  belongs_to :organization
>  belongs_to :supplier
> end
> 
> class CreateAddresses < ActiveRecord::Migration
> 
>  def self.up
>create_table :addresses do |t|
>  t.string :address
>  t.string :city
>  t.string :state
>  t.string :zip
>  t.string :email
>  t.string :phone
>  t.references : users
> 
>  t.timestamps
>end
>  end
> 
>  def self.down
>drop_table :addresses
>  end
> end
> 
> =
> class User < ActiveRecord::Base
>  enum_attr :accountType, %w(regular admin site_admin), :init=>:regular
> 
>  has_one :name
>  has_one :address
>  has_one :organization
> 
> end
> 
> class CreateUsers < ActiveRecord::Migration
> 
>  def self.up
>create_table :users do |t|
>  t.boolean  :acctLocked
>  t.integer  :familyId
>  t.boolean  :isProfileSetup
>  t.datetime :lastLogin
>  t.string   :password
>  t.string   :securityQ
>  t.string   :securityA
>  t.string   :username
>  t.enum :accountType
> 
>  t.timestamps
>end
> 
>create_table :a
>  end
> 
>  def self.down
>drop_table :users
>  end
> end
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Question regarding associations..

2011-07-28 Thread Rick & Nellie Flower
Ok.. Still working on this stuff.. I've got the t.reference in the migration 
for the address class and moved the belongs_to and has_one in the model classes 
as indicated (I didn't notice that!).

I noticed in the association-basics that I should be putting a create_table 
function (if that's what
it's called) in the CreateUsers class for Migrations but I'm concerned about 
doing that since I'll be using the address class on more than just the 'users' 
class -- does it really belong there or ??  
Perhaps I'm overthinking this.. ??

Below are the two class definitions for both the model & migration :

class Address < ActiveRecord::Base
  belongs_to :user
  belongs_to :organization
  belongs_to :supplier
end

class CreateAddresses < ActiveRecord::Migration
  
  def self.up
create_table :addresses do |t|
  t.string :address
  t.string :city
  t.string :state
  t.string :zip
  t.string :email
  t.string :phone
  t.references : users

  t.timestamps
end
  end

  def self.down
drop_table :addresses
  end
end

=
class User < ActiveRecord::Base
  enum_attr :accountType, %w(regular admin site_admin), :init=>:regular
  
  has_one :name
  has_one :address
  has_one :organization
  
end

class CreateUsers < ActiveRecord::Migration
  
  def self.up
create_table :users do |t|
  t.boolean  :acctLocked
  t.integer  :familyId
  t.boolean  :isProfileSetup
  t.datetime :lastLogin
  t.string   :password
  t.string   :securityQ
  t.string   :securityA
  t.string   :username
  t.enum :accountType

  t.timestamps
end

create_table :a
  end

  def self.down
drop_table :users
  end
end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Question regarding associations..

2011-07-28 Thread Rick & Nellie Flower
Thanks guys!  I'll play with this some more when I come home this evening.. 

One more question if I could.. If I get the plumbing all plugged in as needed, 
do I ned to do
anything in particular with the view for the address object to get it to show 
up when adding or
editing a user record or will it get pulled in automagically?  Just curious. 
Thanks!

I'm still trying to figure this all out in my head!

On Jul 28, 2011, at 12:43 AM, Chris Kottom wrote:

> You don't have a FK for user_id in your ADDRESSES table for starters, and you 
> didn't include your model files, so there's no way of knowing whether you've 
> defined the relationships there.
> 
> See:
> http://guides.rubyonrails.org/migrations.html
> http://guides.rubyonrails.org/association_basics.html
> 
> On Thu, Jul 28, 2011 at 8:53 AM, Rick & Nellie Flower  
> wrote:
> Ok.. So I've got my initial table structures setup and I was hoping I could 
> have associations help me out with something akin to embedded/nested objects 
> but without the direct nesting (unless there's another way to achieve that 
> goal)..
> 
> So, I've got an Address class that looks like the following :
> 
> class CreateAddresses < ActiveRecord::Migration
>  belongs_to :user
> 
>  def self.up
>create_table :addresses do |t|
>  t.string :address
>  t.string :city
>  t.string :state
>  t.string :zip
>  t.string :email
>  t.string :phone
> 
>  t.timestamps
>end
>  end
> 
>  def self.down
>drop_table :addresses
>  end
> end
> 
> I've then got a user class that looks like the following :
> 
> class CreateUsers < ActiveRecord::Migration
>  has_one :address
> 
>  def self.up
>create_table :users do |t|
>  t.srting  :name
>  t.boolean  :isProfileSetup
>  t.datetime :lastLogin
>  t.string   :password
>  t.string   :securityQ
>  t.string   :securityA
>  t.string   :username
> 
>  t.timestamps
>end
>  end
> 
>  def self.down
>drop_table :users
>  end
> end
> 
> I was hoping I could do something like the following in the rails console and 
> have it work
> but it does not:
> 
> => @user=User.create
> =>@city=@user.address.city
> 
> Any ideas on whether I'm barking up the wrong tree with associations -- 
> perhaps using
> the wrong syntax or is it even possible with what I want to do?  I feel like 
> they ought to work
> but…
> 
> Any ideas?? Thanks!
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Question regarding associations..

2011-07-27 Thread Rick & Nellie Flower
Ok.. So I've got my initial table structures setup and I was hoping I could 
have associations help me out with something akin to embedded/nested objects 
but without the direct nesting (unless there's another way to achieve that 
goal)..

So, I've got an Address class that looks like the following :

class CreateAddresses < ActiveRecord::Migration
  belongs_to :user
  
  def self.up
create_table :addresses do |t|
  t.string :address
  t.string :city
  t.string :state
  t.string :zip
  t.string :email
  t.string :phone

  t.timestamps
end
  end

  def self.down
drop_table :addresses
  end
end

I've then got a user class that looks like the following :

class CreateUsers < ActiveRecord::Migration
  has_one :address
  
  def self.up
create_table :users do |t|
  t.srting  :name
  t.boolean  :isProfileSetup
  t.datetime :lastLogin
  t.string   :password
  t.string   :securityQ
  t.string   :securityA
  t.string   :username

  t.timestamps
end
  end

  def self.down
drop_table :users
  end
end

I was hoping I could do something like the following in the rails console and 
have it work
but it does not:

=> @user=User.create
=>@city=@user.address.city

Any ideas on whether I'm barking up the wrong tree with associations -- perhaps 
using
the wrong syntax or is it even possible with what I want to do?  I feel like 
they ought to work
but…

Any ideas?? Thanks!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Newbie question..

2011-07-26 Thread Rick & Nellie Flower

On Tue, 26 Jul 2011 09:11:53 -0700 (PDT), Frederick Cheung wrote:

On Jul 26, 5:06 pm, Rick & Nellie Flower  wrote:

> Sounds like you want either validates_with, which enables you to
> package up  a set of validations into something reusable or
> validates_associated, which would tell your user that when it
> validates itself it should also validate the associated address
> object.

Ok.. I'll check into that.. However, I'm still wondering if I can
have nested objects like I mentioned above -- e.g. a User object
containing an Address object and when it's time to write to the
database, both a User object is written but the associated Address
object is also written with some sort of foreign key between the 
two?


Well contain isn't how I would describe it, but objects that have
associations with other objects happens all the time.
Checkout the active record associations guide (
http://guides.rubyonrails.org/association_basics.html )


Thanks!  I'll check it out!

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Newbie question..

2011-07-26 Thread Rick & Nellie Flower

On Tue, 26 Jul 2011 05:37:42 -0700 (PDT), Frederick Cheung wrote:

On Jul 26, 6:20 am, Rick F  wrote:


[ snipped ]

So -- is this sort of compound objecting possible in Rails or should 
I

just eliminate the first two classes and add their respective fields
directly into Users?


Sounds like you want either validates_with, which enables you to
package up  a set of validations into something reusable or
validates_associated, which would tell your user that when it
validates itself it should also validate the associated address
object.


Ok.. I'll check into that.. However, I'm still wondering if I can
have nested objects like I mentioned above -- e.g. a User object
containing an Address object and when it's time to write to the
database, both a User object is written but the associated Address
object is also written with some sort of foreign key between the two?

Just want to make sure before I proceed down a dead end path with
Rails.  Does anyone architect your data that way or just have
duplicated data (e.g. an address for a user vs an address record for
a vendor vs ??)

Thanks!

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Newbie question..

2011-07-26 Thread Rick F
Hi all.. Just trying out Rails for the first time.. I've got a project
I'd like to port over from another environment and am just not sure
how to achieve the same sort of OO goodness I'm used to.. In my other
environment, I've declared a few classes similar to the following
(these are only a few of the overall classes):

class Address :
   street : string
   city : string
   state : string
   zip : string
   email : string
   phone : string

class Name :
   lastname : string
   husband : string
   wife : string
   children : array of strings

class User
   acctLocked : boolean
   address : Address (object)
   isProfileSetup : boolean
   lastLogin : datetime
   name : Name (object)
   userType : enum(#regular, #admin)

In this case, my old environment allowed me to create validation logic
associated
with each class so I didn't have to reproduce (for instance) address
validation logic for the various classes (not present here) that had
address records -- all was encapsulated within a single class to
reduce/eliminate redundant code.

So -- is this sort of compound objecting possible in Rails or should I
just eliminate the first two classes and add their respective fields
directly into Users?

Also, if I want to set a max field size for some of the strings (for
validation purposes or otherwise), what's the best way to do that to
ensure my generated SQL limits string length to 2 characters for state
(for instance)?

Please keep in mind that I've only been playing with Rails for about 2
hours, so I'm still learning..

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Validates uniqueness of FAILURE Help!

2011-04-04 Thread Rick F.
Thanks Fred,

So I backed the rails version to 2.3.3 and all is well again. I would 
think others would see this issue as well in 2.3.5?? I tried 2.3.11 and 
the problem for me remains there as well.

Anyway, I am going to see if I can find out what changed between 2.3.3 
and 2.3.5 to cause my pain.

Thanks again.

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Validates uniqueness of FAILURE Help!

2011-04-01 Thread Rick F.
Hi all,

Running Rails: 2.3.5
Ruby: 1.8.7p302
Firebird: 2.1


I am running into a weird issue. When connecting to a firebird database
I get the following on any model that uses "validates_uniqueness_of".
Other validations work fine. The unique check is simply on a name field.
I should add this code works fine with Postgres...no issues. Access to
all tables for reads / writes without the unique validation works
without issue on the Firebird database.

These models worked without issue on earlier versions of ruby 1.8.6 and
rails 2.1.1 AND firebird.

Can anyone point me in a direction to better understand what is going on
here?

Does the Firbird DB need to be Multibyte as well? Is there anyway to
prevent using multibyte?

ActiveRecord::StatementInvalid in RoleController#create

RangeError: VARCHAR overflow: 72 bytes exceeds 64 byte(s) allowed.:
SELECT FIRST 1 "OC_USER_ROLE".id FROM "OC_USER_ROLE" WHERE
("OC_USER_ROLE"."NAME" = ?) , ---
!ruby/object:ActiveSupport::Multibyte::Chars
wrapped_string: Testname

RAILS_ROOT: D:/4.3Branch/webui
Application Trace | Framework Trace | Full Trace

D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:219:in
`log'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/connection_adapters/fb_adapter.rb:306:in
`log'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/connection_adapters/fb_adapter.rb:311:in
`select_all'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/connection_adapters/fb_adapter.rb:294:in
`translate'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/connection_adapters/fb_adapter.rb:310:in
`select_all'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/base.rb:665:in
`find_by_sql'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/base.rb:1556:in
`find_every'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/base.rb:1513:in
`find_initial'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/base.rb:700:in
`exists?'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:827:in
`validates_uniqueness_of'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/base.rb:2151:in
`with_scope'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/base.rb:2159:in
`with_exclusive_scope'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:826:in
`validates_uniqueness_of'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:468:in
`validates_each'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:465:in
`each'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:465:in
`validates_each'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:in
`call'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:182:in
`evaluate_method'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in
`call'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in
`run'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in
`each'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in
`send'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:90:in
`run'
D:/4.3Branch/webui/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in
`run_callbacks'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:1098:in
`valid_without_callbacks?'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/callbacks.rb:315:in
`valid?'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/validations.rb:1077:in
`save_without_dirty'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in
`save_without_transactions'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in
`send'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in
`with_transaction_returning_status'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in
`transaction'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in
`transaction'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in
`with_transaction_returning_status'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in
`save'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in
`rollback_active_record_state!'
D:/4.3Branch/webui/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in
`save'
D:/4.3Branch/webui/app/controllers/role_controller.rb:278:in `create'

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
o

[Rails] Re: Covert HTML to PDF

2011-02-18 Thread Tt Rick
If you are a non profit organization, you have a chance to obtain a nice
html to pdf converting library - PD4ML for
Ruby for free from http://pd4ml.com/. Just contact them.

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] 32 bit ruby versus 64 bit gem ELF issues

2011-02-15 Thread Rick Fiorentino
I am running into what I thought should be a simple solution...however
not the case yet.

I am running on Suse 64 bit:
Linux 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100
x86_64 x86_64 x86_64 GNU/Linux

My version of ruby is 32 bit version 1.8.7. I normally run a Lightty
front end with two instances of mongrel behind it. When I go to run the
gem install for mongrel 1.1.5 it builds fine, however, it builds as a 64
bit lib for http11.so. This causes ELF64 issues when I attempt to run
the rails (2.3.5) app.

Is there a way to have a gem compile as 32 bit when doing the install? I
could not find a command-line switch etc.

For now the plan has been to remain all 32-bit versus getting everything
to 64-bit...maybe that is not solid thinking.

Any information is appreciated...

thanks,
Rick

-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



  1   2   3   4   5   6   7   8   >