[Rails] Re: Errno::ENOENT: No such file or directory

2012-05-07 Thread Amir Z.
I stuck in the problem when, I am running performance test. Below is the 
error code.

Errno::ENOENT: No such file or directory

Please help me out.

Thanks
Amir

-- 
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] Authlogic Single Access Token-Web Service Iphone app

2012-05-07 Thread Muruga
Hi all
 I am working on Rails 2 application where i need to provide
web services for iphone app.
I am using authlogic gem for authentication.For web services i am
using single access token(user_credentials=X).

Every thing is working fine except session[:something] for API
call.This session variable is not working for API call.This session
variable is not persisting.

 Is anyone used authlogic for API call on Rails application.Please
help me out this.

   Thank you..

-- 
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] Errno::ENOENT: No such file or directory

2012-05-07 Thread Colin Law
On 30 April 2012 13:28, Amir Z. li...@ruby-forum.com wrote:
 I am working with Agile Web Development Book. I create complete app but
 when I am trying to test my first unit testing. Its showing following
 error.


  1) Error:
 test_truth(ProductTest):
 Errno::ENOENT: No such file or directory - rails.png
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:814:in `readlines'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:814:in `read_fixture_file'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:768:in `initialize'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:712:in `new'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:712:in `read_yaml_fixture_files'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:707:in `each'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:707:in `read_yaml_fixture_files'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:706:in `each'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:706:in `read_yaml_fixture_files'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:676:in `read_fixture_files'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:549:in `initialize'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:509:in `new'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:509:in `create_fixtures'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:508:in `map'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:508:in `create_fixtures'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/connection_adapters/mysql_adapter.rb:234:in
 `disable_referential
 _integrity'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:505:in `create_fixtures'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/base.rb:1198:in `silence'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:504:in `create_fixtures'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:1000:in `load_fixtures'
    
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:934:in `setup'

For some reason it seems to be looking for a file rails.png while
reading the fixtures files.  I would start by moving away all your
fixtures files to see if it is a problem in one of those.  If the
error goes away (you will get errors in your tests of course because
of the missing fixtures, but at least it should start running the
tests) then you can put them back to find which one is causing the
problems.  Also make sure you have no extra files in the fixtures
directory.

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@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: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-07 Thread Raghuram Duvvuri
Hi,

I have installed the same devkit on other 2008 server 64 bit which is
Windows 2008 server Standard edition and using that I was able to
install ruby-odbc gem.
The server version which I am trying to install now is on a windows 2008
server Enterprise edition.

I do not think it is the problem of corrupted devkit file but there is
something else which I am unable to figure out.

Kindly let me know what else can be done next as I followed the steps in
the link which have been provided but none of them worked.

Regards,
Raghuram.

-- 
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] applying TwitterBootstrap and LESS

2012-05-07 Thread Soichi Ishida
Rails 3.1.3

I'm trying to apply TwitterBootstrap and LESS

bundle install the following
  gem 'less-rails-bootstrap', '~ 2.0.4'

Normal Twitter bootstrap is applied without problem.
But I need to change themes to my own creation or downloaded from

http://bootswatch.com/

My question is WHERE exactly should I place the LESS setting as a
separate file?

Of course, in assets/stylesheet directory, but I placed it there, and
checked the source code of the generated web page.  For some reason, the
normal twitter bootstrap setting comes AFTER the LESS I created.

The order of reading files seems important.  Could anyone give me tips
for this?

soichi

-- 
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: Errno::ENOENT: No such file or directory

2012-05-07 Thread pepe
It might not have anything to do with your problems but when I develop/
test in Windows I get the same type of error when the log files get
big. The only thing I have to do to keep going is clear them up.

On Apr 30, 8:28 am, Amir Z. li...@ruby-forum.com wrote:
 I am working with Agile Web Development Book. I create complete app but
 when I am trying to test my first unit testing. Its showing following
 error.

   1) Error:
 test_truth(ProductTest):
 Errno::ENOENT: No such file or directory - rails.png
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:814:in `readlines'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:814:in `read_fixture_file'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:768:in `initialize'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:712:in `new'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:712:in `read_yaml_fixture_files'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:707:in `each'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:707:in `read_yaml_fixture_files'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:706:in `each'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:706:in `read_yaml_fixture_files'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:676:in `read_fixture_files'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:549:in `initialize'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:509:in `new'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:509:in `create_fixtures'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:508:in `map'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:508:in `create_fixtures'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/connection_adapters/mysql_adapter.rb:234:in
 `disable_referential
 _integrity'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:505:in `create_fixtures'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/base.rb:1198:in `silence'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:504:in `create_fixtures'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:1000:in `load_fixtures'
     
 C:/Users/Amir/Downloads/IR/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/li
 b/active_record/fixtures.rb:934:in `setup'

 1 tests, 0 assertions, 0 failures, 1 errors

 Please help me out. Your inputs and suggestions are welcome.

 Thanks
 Amir

 --
 Posted viahttp://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: autocomplete word by word

2012-05-07 Thread pepe
I think what Guillem is saying is that you can still do it with jQuery/
Javascript like you did before and that you'll need to control the
logic yourself.

On May 6, 5:02 pm, rubix Rubix li...@ruby-forum.com wrote:
 Hi,
 I am trying to implement an autocomplete form with rails, I used jquery
 in a first version, to suggest phrases to user and it worked
 Now I am trying to have a service of autocomplete word by word, it means
 when the user it typing in the text area, I suggest only words and not
 phrases and when he finishes the word and starts a new one I do the same
 suggestion for the new word
 Is there a way to do this easily in rails
 regards,

 --
 Posted viahttp://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] Creating an API key (many to many mapping), how would I go about it

2012-05-07 Thread Beau
Hey guys. 

I'm still a super rails noob, and trying to figure this out in relation to 
learning how to write controllers/models and where stuff should go.

Basically I have my models set up with a many-to-many mapping of API keys 
to users. There's three models here, users, api_keys_users, and 
api_keys. I've got a view/controller setup for the users. But have avoided 
doing it for the api_keys and api_keys_users tables. Manually I can create 
a API key and map it to a user using SQL but now I want to set it up for 
generation via the view.

However I have no idea where the logic should go. Basically I want a 
generate new api key button on the show users page. This would create a 
unique entry in the api_key table. Then create an entry in the 
api_keys_users table with the id of the user and the id of the new key.

Any pointers?

-Beau

-- 
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/-/bFQDLWvKSgcJ.
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] Creating an API key (many to many mapping), how would I go about it

2012-05-07 Thread Colin Law
On 7 May 2012 13:05, Beau beautr...@gmail.com wrote:
 Hey guys.

 I'm still a super rails noob, and trying to figure this out in relation to
 learning how to write controllers/models and where stuff should go.

I suggest first working through some Rails tutorials.
railstutorial.org is good and is free to use online.  Once you have
worked right through that, including doing all the exercises, then you
will be better placed to get going.

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@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: Unable to Install ruby-odbc gem on windows 2008 server bit

2012-05-07 Thread Luis Lavena
On Monday, May 7, 2012 5:58:10 AM UTC-3, Ruby-Forum.com User wrote:

 Hi, 

 I have installed the same devkit on other 2008 server 64 bit which is 
 Windows 2008 server Standard edition and using that I was able to 
 install ruby-odbc gem. 
 The server version which I am trying to install now is on a windows 2008 
 server Enterprise edition. 

 I do not think it is the problem of corrupted devkit file but there is 
 something else which I am unable to figure out. 


As I linked before, it might be that you require to rebase the msys DLL 
that is used by Make.

Seems you haven't read that part.

Kindly let me know what else can be done next as I followed the steps in 
 the link which have been provided but none of them worked. 


I did, the first link in my previous response.

I don't think the only difference between your system is just editions 
(standard vs enterprise), I think there is more that we aren't seeing.

Please join RubyInstaller and bring the subject there, as others in the 
list might have other ideas on what could be the reason for this issue.

https://groups.google.com/forum/?fromgroups#!forum/rubyinstaller 

--
Luis Lavena

-- 
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/-/lOXme-LFkZwJ.
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] not sure why download csv file test fails on windows

2012-05-07 Thread Jedrin

 I have this sinatra app test where I downloaded a file by hand from
the app and stored it in the test area. I then have my test program
download the same file, save it and compare the two.
The test seems to fail because the one  downloaded by hand has
newlines of the form
\r\n whereas the one that the test program downloads using rack/test
has newlines of the form
\r\r\n

 Any obvious insights from my test code below ?

Thanks ..



require 'fileutils'

require 'test/unit'
require 'rack/test'

class MyAppTest  Test::Unit::TestCase
  include Rack::Test::Methods

  def app
Sinatra::Application
  end

  def test_recreate_csv
csv_path = File.dirname(__FILE__) + '/csv_files/web_test_file.csv'
csf = File.open(csv_path,'w'){|f| f.write(last_response.body)}

downloaded_csv_path = File.dirname(__FILE__) + '/csv_files/
downloaded_file.csv'

assert FileUtils.identical?(csv_path, downloaded_csv_path)
  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.



[Rails] Re: not sure why download csv file test fails on windows

2012-05-07 Thread Luis Lavena
Hello,

On Monday, May 7, 2012 10:48:35 AM UTC-3, Jedrin wrote:


 The test seems to fail because the one  downloaded by hand has 
 newlines of the form 
 \r\n whereas the one that the test program downloads using rack/test 
 has newlines of the form 
 \r\r\n 


If you want identical files then you should tell Ruby to open your file in 
a binary mode.
 

  Any obvious insights from my test code below ? 

 Thanks .. 

 

 csf = File.open(csv_path,'w'){|f| f.write(last_response.body)} 


Change the mode from 'w' to 'wb' (write binary)

Also, don't forget to close the file (csf.close) as you keep that open in 
your test, leaking file handlers.

--
Luis Lavena

-- 
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/-/oyWnXIhZVRgJ.
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] Creating an API key (many to many mapping), how would I go about it

2012-05-07 Thread Kevin Bedell
Here's a bit of information on building out an API using security and API keys.

http://stackoverflow.com/questions/10470509/building-an-api-as-a-service/10470584#10470584

I'd use 'devise' to manage api users with token auth enabled and have
the token be their api key.

I've done this before and it's not too bad once you've gotten devise
installed and configured correctly.

-Kevin

On Mon, May 7, 2012 at 8:05 AM, Beau beautr...@gmail.com wrote:
 Hey guys.

 I'm still a super rails noob, and trying to figure this out in relation to
 learning how to write controllers/models and where stuff should go.

 Basically I have my models set up with a many-to-many mapping of API keys to
 users. There's three models here, users, api_keys_users, and api_keys. I've
 got a view/controller setup for the users. But have avoided doing it for the
 api_keys and api_keys_users tables. Manually I can create a API key and map
 it to a user using SQL but now I want to set it up for generation via the
 view.

 However I have no idea where the logic should go. Basically I want a
 generate new api key button on the show users page. This would create a
 unique entry in the api_key table. Then create an entry in the
 api_keys_users table with the id of the user and the id of the new key.

 Any pointers?

 -Beau

 --
 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/-/bFQDLWvKSgcJ.
 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] Can't mass-assign protected attributes

2012-05-07 Thread overlap
Hi there!
I started learning Rails using the guides.rubyonrails.org/*
documentation, and I have started a simple project with only two model
classes so start with. However, I've came across some errors, and with
some trial I got it working. I have a final question about the error
Can't mass-assign protected attributes, but first some version
numbers and what I did:

% rails --version
Rails 3.2.3
% rails new testapp
% cd testapp
% rails g scaffold project name:string file:binary
% rails g scaffold auction name:string begin:datetime
project:references
% rake db:migrate

==  CreateProjects: migrating
=
-- create_table(:projects)
   - 0.0014s
==  CreateProjects: migrated (0.0015s)


==  CreateAuctions: migrating
=
-- create_table(:auctions)
   - 0.0010s
-- add_index(:auctions, :project_id)
   - 0.0004s
==  CreateAuctions: migrated (0.0015s)


% rails c
Loading development environment (Rails 3.2.3)
irb(main):002:0 p = Project.new(name: test, file:fff)
= #Project id: nil, name: test, file: fff, created_at: nil,
updated_at: nil
irb(main):003:0 p.save()
 = true


irb(main):010:0 Auction.new(:name = tzap, :begin =
nil, :project_id = 1)
ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign
protected attributes: project_id
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
activemodel-3.2.3/lib/active_model/mass_assignment_security/
sanitizer.rb:48:in `process_removed_attributes'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
activemodel-3.2.3/lib/active_model/mass_assignment_security/
sanitizer.rb:20:in `debug_protected_attribute_removal'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
activemodel-3.2.3/lib/active_model/mass_assignment_security/
sanitizer.rb:12:in `sanitize'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
activemodel-3.2.3/lib/active_model/mass_assignment_security.rb:230:in
`sanitize_for_mass_assignment'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
activerecord-3.2.3/lib/active_record/attribute_assignment.rb:75:in
`assign_attributes'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
activerecord-3.2.3/lib/active_record/base.rb:498:in `initialize'
  from (irb):10:in `new'
  from (irb):10
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
railties-3.2.3/lib/rails/commands/console.rb:47:in `start'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
railties-3.2.3/lib/rails/commands/console.rb:8:in `start'
  from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/
railties-3.2.3/lib/rails/commands.rb:41:in `top (required)'
  from script/rails:6:in `require'
  from script/rails:6:in `main'

== So I added :project_id to the model:

% cat app/models/auction.rb
class Auction  ActiveRecord::Base
  belongs_to :project
  attr_accessible :begin, :name, :project_id
  ^
end

And this time is working from the console:

% rails c
Loading development environment (Rails 3.2.3)
irb(main):001:0 Project.all
  Project Load (0.1ms)  SELECT projects.* FROM projects
= [#Project id: 1, name: test, file: fff, created_at:
2012-05-05 13:05:44, updated_at: 2012-05-05 13:05:44]
irb(main):008:0 a = Auction.new(:name = foo, :begin =
nil, :project_id = 1)
= #Auction id: nil, name: foo, begin: nil, project_id: 1,
created_at: nil, updated_at: nil
irb(main):009:0 a.save()
= true

% rails s

1 = trying to add an auction using the front end:
http://dl.dropbox.com/u/8724298/Screen%20Shot%202012-05-05%20at%203.44.19%20PM.png
2 = I receive another error:
ActiveModel::MassAssignmentSecurity::Error in
AuctionsController#create

Can't mass-assign protected attributes: project
Rails.root: /private/tmp/testapp

Application Trace | Framework Trace | Full Trace
app/controllers/auctions_controller.rb:43:in `new'
app/controllers/auctions_controller.rb:43:in `create'
Request

Parameters:

{utf8=✓,
 authenticity_token=0gcU4dbRGsgmiXGEcMKO1o1Oec6GoGQ4OziwNbRyfoc=,
 auction={name=FFF,
 begin(1i)=2012,
 begin(2i)=5,
 begin(3i)=5,
 begin(4i)=13,
 begin(5i)=44,
 project=1},
 commit=Create Auction}

[ 
http://dl.dropbox.com/u/8724298/Screen%20Shot%202012-05-05%20at%203.44.19%20PM.png
]

Where am I wrong?

Thank you!

-- 
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] run script after initialize

2012-05-07 Thread Rodrigo Vieira
Well, I'd create a file and put it in /lib and include/initialize that file in 
the config.ru file before the actual app initialization (run 
YourApp::Application).

On 06/05/2012, at 16:22, Guillem Vidal li...@ruby-forum.com wrote:

 hi there!!
 
 I'm just trying to run a script that adds certain methods to all
 ActiveRecord::Base descendants, but what happens is that it seems that
 all models are loaded after the application runs
 
 ActiveRecord::Base.send(:descendants).each do |subclass|
 #do stuff
 end
 
 ActiveRecord::Base.send(:descendants) and
 ActiveRecord::Base.send(:subclasses) is allways empty [].
 
 I've tried it on config/environment.rb and config/application.rb with no
 success, can someone tell me what i can do about it?
 
 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 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] Problem with process_view_paths DEPRECATION WARNING

2012-05-07 Thread João Víctor Rocon Maia
Hi, I read this commit (
https://github.com/rspec/rspec-rails/commit/ff6a9ff9555eaead5167497dd7d2e6c5519171c7)
to eliminate process_view_paths warning. But, process_view_paths still
warning and I don't understand why.

Warning message: DEPRECATION WARNING: process_view_paths is deprecated and
will be removed from Rails 3.2. (called from set_custom_view at
/.../app/controllers/application_controller.rb:43)

* code *
[line 42] def set_custom_view
[line 43] prepend_view_path
([ActionView::PathSet.new([themes/base/default]).first, @@base_default,
@@base_theme, @@published])
[line 44] end
* end code *

My environment
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]
$ rails -v
Rails 3.2.3

o/
-- 
*João Víctor Rocon Maia*
www.joaovrmaia.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] Freelance Ruby on Rails Developer needed for a project

2012-05-07 Thread Jason
I am in immediate need of a Ruby on Rails Developer to help us
complete a project.  The majority of our application is already built
and it's running on our development web server, we just need to finish
up some remaining requirements, resolve some defects, finish testing
and deploy it in conjunction with our soon to be released iOS app.  We
anticipate having additional long term project needs after we go live.
Do you know anyone who would be interested?  If so please contact me
as soon as you're free. Thanks!

Jason

-- 
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: Rails Tutorial 3 attribue unknown

2012-05-07 Thread Rodrigo Vieira
Be aware that, it is not safe to set passwords changeable via mass-assignment.

On 06/05/2012, at 05:10, Sergey Ezhov li...@ruby-forum.com wrote:

 I simply add in model:
 attr_accessible ... :password, :password_confirmation, ...
 
 it work
 but it can not absolutely truly
 
 -- 
 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.
 

-- 
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] ActiveRecord Postgres small inconsistency

2012-05-07 Thread rahaji...@bankofbaku.com
Hi, I'm using Rails 3.2.1 and following through Mike Hartl's
tutorial.

irb(main):024:0 User.first
  User Load (0.6ms)  SELECT users.* FROM users LIMIT 1
= ...
irb(main):025:0 User.last
  User Load (1.0ms)  SELECT users.* FROM users ORDER BY
users.id DESC LIMIT 1
= ...

Here's what PostgreSQL docs say concerning ORDER-less SELECTs:
If the ORDER BY clause is specified, the returned rows are sorted in
the specified order. If ORDER BY is not given, the rows are returned
in whatever order the system finds fastest to produce. (See ORDER BY
Clause below.)


So, shouldn't ORDER BY .. ASC be specified explicitly, instead of
relying on an implementation detail that might later change?

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] ActionMailer Linode

2012-05-07 Thread Rodrigo Vieira
Try the guides: http://guides.rubyonrails.org/action_mailer_basics.html 

You should also look for your Linode SMTP settings.

On 06/05/2012, at 19:21, Bruno Meira goesme...@gmail.com wrote:

 Hi Guys,
 I created a mail server at Linode.
 I would like to configure my rails app to send mails using one of this mail 
 accounts.
 Does anybody know any tutorial about how to do it?
 
 
 Thx 
 Bruno Meira
 
 
 -- 
 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] Re: Can't mass-assign protected attributes

2012-05-07 Thread Frederick Cheung


On May 5, 3:02 pm, overlap over...@gmail.com wrote:
 Hi there!

 % rails c
 Loading development environment (Rails 3.2.3)
 irb(main):001:0 Project.all
   Project Load (0.1ms)  SELECT projects.* FROM projects
 = [#Project id: 1, name: test, file: fff, created_at:
 2012-05-05 13:05:44, updated_at: 2012-05-05 13:05:44]
 irb(main):008:0 a = Auction.new(:name = foo, :begin =
 nil, :project_id = 1)
 = #Auction id: nil, name: foo, begin: nil, project_id: 1,
 created_at: nil, updated_at: nil
 irb(main):009:0 a.save()
 = true

 % rails s

 1 = trying to add an auction using the front 
 end:http://dl.dropbox.com/u/8724298/Screen%20Shot%202012-05-05%20at%203.4...
 2 = I receive another error:
 ActiveModel::MassAssignmentSecurity::Error in
 AuctionsController#create

 Can't mass-assign protected attributes: project
 Rails.root: /private/tmp/testapp


Well you skipped over the code that raises the error, but I'm guessing
you load the project from the database and do something like

Auction.new(:project = p)

If so then you need to add :project to your attr_accessible list. The
prefix attr_ sort of implies that everything on the list has to be an
attribute, but that's not so. Any key that you want to be allowed when
calling new,create etc. should be on the list (and before you add it
to the list, take a minute to think about the consequences of the user
being able to set arbitrary value)

Fred


 Application Trace | Framework Trace | Full Trace
 app/controllers/auctions_controller.rb:43:in `new'
 app/controllers/auctions_controller.rb:43:in `create'
 Request

 Parameters:

 {utf8=✓,
  authenticity_token=0gcU4dbRGsgmiXGEcMKO1o1Oec6GoGQ4OziwNbRyfoc=,
  auction={name=FFF,
  begin(1i)=2012,
  begin(2i)=5,
  begin(3i)=5,
  begin(4i)=13,
  begin(5i)=44,
  project=1},
  commit=Create Auction}

 [http://dl.dropbox.com/u/8724298/Screen%20Shot%202012-05-05%20at%203.4...
 ]

 Where am I wrong?

 Thank you!

-- 
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] ActiveRecord Postgres small inconsistency

2012-05-07 Thread Jeremy Walker
On 7 May 2012 08:31, rahaji...@bankofbaku.com rahaji...@bankofbaku.comwrote:

 Hi, I'm using Rails 3.2.1 and following through Mike Hartl's
 tutorial.

 irb(main):024:0 User.first
  User Load (0.6ms)  SELECT users.* FROM users LIMIT 1
 = ...
 irb(main):025:0 User.last
  User Load (1.0ms)  SELECT users.* FROM users ORDER BY
 users.id DESC LIMIT 1
 = ...

 Here's what PostgreSQL docs say concerning ORDER-less SELECTs:
 If the ORDER BY clause is specified, the returned rows are sorted in
 the specified order. If ORDER BY is not given, the rows are returned
 in whatever order the system finds fastest to produce. (See ORDER BY
 Clause below.)


 So, shouldn't ORDER BY .. ASC be specified explicitly, instead of
 relying on an implementation detail that might later change?


This strikes me as a good suggestion. I'll put a pull request together for
it unless anyone has any objections.

Jeremy Walker
http://www.ihid.co.uk



 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.



Re: [Rails] ActiveRecord Postgres small inconsistency

2012-05-07 Thread Jeremy Walker
On 7 May 2012 17:34, Jeremy Walker jez.wal...@gmail.com wrote:



 On 7 May 2012 08:31, rahaji...@bankofbaku.com rahaji...@bankofbaku.comwrote:

 Hi, I'm using Rails 3.2.1 and following through Mike Hartl's
 tutorial.

 irb(main):024:0 User.first
  User Load (0.6ms)  SELECT users.* FROM users LIMIT 1
 = ...
 irb(main):025:0 User.last
  User Load (1.0ms)  SELECT users.* FROM users ORDER BY
 users.id DESC LIMIT 1
 = ...

 Here's what PostgreSQL docs say concerning ORDER-less SELECTs:
 If the ORDER BY clause is specified, the returned rows are sorted in
 the specified order. If ORDER BY is not given, the rows are returned
 in whatever order the system finds fastest to produce. (See ORDER BY
 Clause below.)


 So, shouldn't ORDER BY .. ASC be specified explicitly, instead of
 relying on an implementation detail that might later change?


 This strikes me as a good suggestion. I'll put a pull request together for
 it unless anyone has any objections.


After a quick browse through the code, this has already been added to Rails
master and will appear in a future release.



 Jeremy Walker
 http://www.ihid.co.uk



 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.



[Rails] Re: Re: run script after initialize

2012-05-07 Thread Guillem Vidal
Jeremy Walker wrote in post #1059759:
 On 6 May 2012 22:13, Guillem Vidal li...@ruby-forum.com wrote:

  You could just reopen ActiveRecord::Base. Create a new initializer (a
  http://www.ihid.co.uk
   end
  end


 OK, so two more suggestions:
 1) Use an after_initialize block in your config (
 http://guides.rubyonrails.org/configuring.html#rails-general-configuration)
 to call your method_creation code.
 2) Re-open the class (as per my prev suggestion) but write a
 create_association_tokens method that contains the code to define your
 reflected methods, and use ActiveRecord::Base's after_initialize method
 to
 call that method on an object, thus creating your methods on an
 object-by-object basis, rather than for the class.

 I'm intrigued by the point of all this?


Sorry about the delay, I couldn't access to a computer since now :(.

Done it, but it raises me an error because i have a attr_writer, i need 
to initialize the method.


module MyModule
def self.included(base)
  base.send(:extend, InstanceMethods)
  base.send(:after_initialize, :set_reader_writer_tokens)
end

module InstanceMethods
  def set_reader_writer_tokens
class.reflect_on_all_associations.each do |association|
  class.send(:define_method,#{association.name.to_s}_tokens) do
attribute(__method__)
  end
  self.class.send(:define_method, 
#{association.name.to_s}_tokens=) do |value|
write_attribute(__method__, self.another_custom_method)
  end
end
  end
end


ActiveRecord::Base.send(:include, MyModule)

Loading development environment (Rails 3.2.2)
class OptionType  ActiveRecord::Base
belongs_to :type
end

OptionType.new(:type_tokens = ba,b)
raises an unknown attribute :type_tokens.

But if I first initialize the record withouth accessing to the 
attribute:

 OptionType.new
 = #OptionType ...
 OptionType.new(:type_tokens = ba,b)
 = #OptionType id: nil, name: nil, presentation: nil, created_at: nil, 
updated_at: nil

Then I can done it. The problem is that I need to set up that attribute 
before the initialitzation of the class.

Is a very good approach, but still not enogh for a ruby on rails 
application.

Maybe it can be done using method_missing... but I'm a little bit scared 
of overwriting activerecord method_missing, also it's not clear.

-- 
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: Paperclip saving/retrieving files above public/

2012-05-07 Thread Cyle H.
For those of you who recommend the public folder, the only problem with 
that for me and I'm sure others is that we may want some uploads to be 
private, and prevent users from simply browsing the public directory on 
our webapps to look at every-bodies uploads. By using our own custom 
folders we can prevent this with very little code.

-- 
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: run script after initialize

2012-05-07 Thread Guillem Vidal
Rodrigo Vieira wrote in post #1059873:
 Well, I'd create a file and put it in /lib and include/initialize that
 file in the config.ru file before the actual app initialization (run
 YourApp::Application).


That worked! The problem is that this is only working when rails app 
starts, not on rake tasks or test/units.

But from now on, what I need for my application is ok.



Just to know... Is it possible to do add those methods on the entire 
application? (not only on the middleware)

-- 
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] Complex sorting question, or not?

2012-05-07 Thread Chris Klimek
I have a function that displays all depts and related info from other
tables in my Department model, such as:

  def dept_and_hospital
#{name} (#{floor.building.hospital.name})
  end

... which is used in my view, like:

  p
%= f.label :department_id %br /
%= collection_select(:device, :department_id, Department.all(),
:id, :dept_and_hospital, :prompt = 'Select Department') %
  /p

How do I sort the display names by the hospital name (which is a few
tables away in the db schema), and then by the department name.

The relationship in the db is as follows:
department--floor--building-- hospital.

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 this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] out of memory generating huge csv from active record

2012-05-07 Thread Jedrin

 I am trying to work with generating really large CSV files from
active record. (This is actually an end case test however) I am trying
this with
a set of active records that is 70 records which is just a test
case that I have, though it is very large. The type of find() below is
supposed to work in pages and not have all active records in memory. I
get an out of memory error (see stack dump below). The print of the
count also never comes out.

I got that info from here in the first part of nailing down the root
cause
http://www.engineyard.com/blog/2009/thats-not-a-memory-leak-its-bloat/

I am also using faster_csv which is supposed to not use as much memory
from soem other google searches.

I am using jruby 1.6.7 (ruby 1.8.7) and active record 2.3 (which I
assume corresponds to rails 2,.3)

on the call here, attr =
 {:conditions=[cdr_guid_id = :cdr_guid_id, {:cdr_guid_id=30}]}

  def self.export_to_csv(attr)
self.set_client(attr[:client])
# client is our own thing,
# and not part of active record find()
attr.delete(:client)

cnt = 0
if hrec = self.find(:first)
  CSV.generate(path) do |ofil|
ofil  hrec.visible_attributes.keys
self.find(:all, attr).each do |rec|
  cnt += 1
  puts cnt.to_s if cnt % 100 == 0
  ofil  rec.visible_attributes.keys.map{|col|
rec.send(col) }
end
  end
end
  end





===



[2012-05-07 17:06:35] ERROR Java::JavaLang::OutOfMemoryError: Java
heap space
 
java.nio.channels.spi.AbstractInterruptibleChannel.begin(Unknown
Source)

May 7, 2012 5:06:35 PM com.microsoft.sqlserver.jdbc.TDSParser
throwUnexpectedTok
enException
SEVERE: ConnectionID:2: getNextResult: Encountered unexpected unknown
token (0x0
)
May 7, 2012 5:06:35 PM com.microsoft.sqlserver.jdbc.TDSReader
throwInvalidTDS
SEVERE: ConnectionID:2 got unexpected value in TDS response at offset:
0
ActiveRecord::StatementInvalid - Java::JavaLang::OutOfMemoryError:
Java heap spa
ce: SELECT * FROM record_set_3764 WHERE (cdr_guid_id = 30) :
 C:/Users/lgu/vendor/activerecord-2.3.8/lib/active_record/
connection_adapters/abst
ract_adapter.rb:221:in `log'
 C:/Users/lgu/vendor/activerecord-jdbc-adapter-0.9.7-java/lib/
active_record/connec
tion_adapters/jdbc_adapter.rb:655:in `select'
 C:/Users/lgu/vendor/activerecord-jdbc-adapter-0.9.7-java/lib/
active_record/connec
tion_adapters/jdbc_adapter.rb:567:in `jdbc_select_all'
 C:/Users/lgu/vendor/activerecord-2.3.8/lib/active_record/
connection_adapters/abst
ract/query_cache.rb:62:in `select_all_with_query_cache'
 C:/Users/lgu/vendor/activerecord-2.3.8/lib/active_record/base.rb:
664:in `find_by_
sql'
 C:/Users/lgu/vendor/activerecord-2.3.8/lib/active_record/base.rb:
1578:in `find_ev
ery'
 C:/Users/lgu//vendor/activerecord-2.3.8/lib/active_record/base.rb:
618:in `find'
 ./recordset_models.rb:465:in `export_to_csv'
 c:/jruby-1.6.7/lib/ruby/1.8/csv.rb:330:in `open_writer'
 c:/jruby-1.6.7/lib/ruby/1.8/csv.rb:677:in `generate'
 c:/jruby-1.6.7/lib/ruby/1.8/csv.rb:329:in `open_writer'
 c:/jruby-1.6.7/lib/ruby/1.8/csv.rb:111:in `generate'
 ./recordset_models.rb:459:in `export_to_csv'
 ./recordset_models.rb:368:in `export_to_csv'
 recordset.rb:72:in `__file__'
 org/jruby/RubyProc.java:270:in `call'
 org/jruby/RubyMethod.java:129:in `call'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:1151:in
 `compile!'
 org/jruby/RubyKernel.java:2045:in `instance_eval'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:724:in
`route_eval'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:708:in
`route!'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:758:in
`process_route'
 org/jruby/RubyKernel.java:1183:in `catch'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:755:in
`process_route'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:707:in
`route!'
 org/jruby/RubyArray.java:1615:in `each'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:706:in
`route!'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:843:in
`dispatch!'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:644:in
`call!'
 org/jruby/RubyKernel.java:2045:in `instance_eval'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:808:in
`invoke'
 org/jruby/RubyKernel.java:1183:in `catch'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:808:in
`invoke'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:644:in
`call!'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/sinatra-1.2.6/lib/sinatra/
base.rb:629:in
`call'
 C:/Users/lgu/nakajima-rack-flash-0.1.0/lib/rack/flash.rb:154:in
`call'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.3.1/lib/rack/session/
abstract/id.r
b:195:in `context'
 c:/jruby-1.6.7/lib/ruby/gems/1.8/gems/rack-1.3.1/lib/rack/session/
abstract/id.r
b:190:in `call'
 

[Rails] XSendfile via Nginx

2012-05-07 Thread Ari King
Hi,

I'm trying to configure nginx to serve a video file on behalf of my
rails 3 backend using xsendfile. I want rails to redirect the request
for http://myapp.com/recipes/1/video to nginx to handle. Unfortunately,
my current configuration results in a 404 (page not found) error. I've
pasted my nginx configuration at http://pastebin.com/VA4QFM35

Does anyone know what could be wrong?

Note: I have activated X-Accel-Redirect in rails by:

# Rails configuration (e.g. config/environments/production.rb)
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'

Thanks.

Ari

-- 
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] How to boot multiple Rails apps on Apache2 with a shared Passenger gem?

2012-05-07 Thread brian piercy
http://stackoverflow.com/q/10422047/280069?sem=2

-- 
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: Freelance Ruby on Rails Developer needed for a project

2012-05-07 Thread Agis A.
I'm a junior rails developer that have already finished the first stage of 
my first real-world app. Let me know if you're interested: 
corestudios...@gmail.com


On Monday, 7 May 2012 06:39:34 UTC+3, Jason wrote:

 I am in immediate need of a Ruby on Rails Developer to help us 
 complete a project.  The majority of our application is already built 
 and it's running on our development web server, we just need to finish 
 up some remaining requirements, resolve some defects, finish testing 
 and deploy it in conjunction with our soon to be released iOS app.  We 
 anticipate having additional long term project needs after we go live. 
 Do you know anyone who would be interested?  If so please contact me 
 as soon as you're free. Thanks! 

 Jason

-- 
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/-/GpsN3DTFj90J.
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] ActionMailer Linode

2012-05-07 Thread Bruno Meira
Hi Rodrigo,
I'll take a look.
Thx :D

2012/5/6 Rodrigo Vieira rodrigovieira1...@gmail.com

 Try the guides: http://guides.rubyonrails.org/action_mailer_basics.html

 You should also look for your Linode SMTP settings.

 On 06/05/2012, at 19:21, Bruno Meira goesme...@gmail.com wrote:

 Hi Guys,
 I created a mail server at Linode.
 I would like to configure my rails app to send mails using one of this
 mail accounts.
 Does anybody know any tutorial about how to do it?


 Thx
 Bruno Meira


  --
 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.




-- 
Bruno Meira

-- 
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] how to run a cronjob in rackspace

2012-05-07 Thread Benjamin Iandavid Rodriguez
You can take a look at the whenever gem, it provides a nice way to manage
cron jobs through ruby and if you are deploying using capistrano you just
need to add this two lines to your deploy.rb file:

set :whenever_command, bundle exec whenever
require whenever/capistrano

Give it a try =D

Best regards!

2012/5/6 honey ruby emailtohoneyr...@gmail.com

 hi everyone im trying to run the cronjob in rackspace server can
 anyone help me out how to run cronjob. before i used host getter
 server to run cronjobs with the help of cpanel when it comes to
 rackspace there is no cpanel .help me out guys..

 thanks in advance

 --
 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] run script after initialize

2012-05-07 Thread Rodrigo Vieira
If the config.ru trick doesn't work for you, you should try the same but only 
initializing the file in config/boot.rb, instead. This should work for sure.

Sent from my iPod

On 06/05/2012, at 16:22, Guillem Vidal li...@ruby-forum.com wrote:

 hi there!!
 
 I'm just trying to run a script that adds certain methods to all
 ActiveRecord::Base descendants, but what happens is that it seems that
 all models are loaded after the application runs
 
 ActiveRecord::Base.send(:descendants).each do |subclass|
 #do stuff
 end
 
 ActiveRecord::Base.send(:descendants) and
 ActiveRecord::Base.send(:subclasses) is allways empty [].
 
 I've tried it on config/environment.rb and config/application.rb with no
 success, can someone tell me what i can do about it?
 
 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 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] Re: Freelance Ruby on Rails Developer needed for a project

2012-05-07 Thread vishal singh
hi,

   I have 1+ year experience in ruby on rails.I will work for you.let me
know if you are interested vishal.singh...@gmail.com .


Regards,
Vishal Singh
Ruby On Rails Developer




On Tue, May 8, 2012 at 3:45 AM, Agis A. corestudios...@gmail.com wrote:

 I'm a junior rails developer that have already finished the first stage of
 my first real-world app. Let me know if you're interested:
 corestudios...@gmail.com


 On Monday, 7 May 2012 06:39:34 UTC+3, Jason wrote:

 I am in immediate need of a Ruby on Rails Developer to help us
 complete a project.  The majority of our application is already built
 and it's running on our development web server, we just need to finish
 up some remaining requirements, resolve some defects, finish testing
 and deploy it in conjunction with our soon to be released iOS app.  We
 anticipate having additional long term project needs after we go live.
 Do you know anyone who would be interested?  If so please contact me
 as soon as you're free. Thanks!

 Jason

  --
 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/-/GpsN3DTFj90J.

 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] how to run a cronjob in rackspace

2012-05-07 Thread hanish jadala
thanks Rodriguez for your reply i am using rails 2.3.8 does whenever will
work in 2.3.8. i tried but i am missing something i can not run a file with
whenever i was following this link
http://railscasts.com/episodes/164-cron-in-ruby can you plz help me
out.asyou said to add those 2 line in deploy.rb file in rails 2.3.8
you don't
find deploy.rb file. i am trying in my local system first so that i can
implement in server.

Best regards!


On Tue, May 8, 2012 at 5:52 AM, Benjamin Iandavid Rodriguez 
ian@gmail.com wrote:

 You can take a look at the whenever gem, it provides a nice way to manage
 cron jobs through ruby and if you are deploying using capistrano you just
 need to add this two lines to your deploy.rb file:

 set :whenever_command, bundle exec whenever
 require whenever/capistrano

 Give it a try =D

 Best regards!


 2012/5/6 honey ruby emailtohoneyr...@gmail.com

 hi everyone im trying to run the cronjob in rackspace server can
 anyone help me out how to run cronjob. before i used host getter
 server to run cronjobs with the help of cpanel when it comes to
 rackspace there is no cpanel .help me out guys..

 thanks in advance

 --
 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.