[Rails] Re: rake db:create:all gives the error ??

2011-07-03 Thread Amrit Pal Pathak
On Mon, Jul 4, 2011 at 2:08 AM, Amrit Pal Pathak
wrote:

> I executed the "rake db:create:all" and it gives following error message
>
>rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
> rake aborted!
> uninitialized constant ActiveSupport::Dependencies::Mutex
>
> (See full trace by running task with --trace)
>
> I have:
>
> rails => 2.3.5,3.0.7
> gem => 1.8.5
> I degraded the gem to 1.3.7 ,but it didn't work
>

   Thanks

  amritpalpathakgne.wordpress.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] when use mongoid , Model.count can't work.

2011-07-03 Thread Rock Liu
Hi, when i use mongoid to get the count of model named "User", I met a
error :

irb(main):001:0> User.count

ArgumentError: wrong number of arguments (1 for 0)
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
cursor.rb:37:in `count'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
cursor.rb:37:in `send'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
cursor.rb:37:in `count'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
collections/retry.rb:29:in `retry_on_connection_failure'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
cursor.rb:36:in `count'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/contexts/
mongo.rb:73:in `count'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
criteria.rb:48:in `__send__'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
criteria.rb:48:in `count'
from /var/lib/gems/1.8/gems/mongoid-2.0.2/lib/mongoid/
finders.rb:34:in `count'
from (irb):2

version of mongoid is "2.0.2"
version of ruby is "1.8.7"
version of rails is "3.0.3"

Any suggestions/help?

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] rake db:create:all gives the error ??

2011-07-03 Thread Amrit Pal Pathak
I executed the "rake db:create:all" and it gives following error message

   rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
rake aborted!
uninitialized constant ActiveSupport::Dependencies::Mutex

(See full trace by running task with --trace)

I have:

rails => 2.3.5,3.0.7
gem => 1.8.5
ruby => 1.8.7

 I will appreciate the help

 Thanks in advance

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



Re: [Rails] Social Networking

2011-07-03 Thread Amrit Pal Pathak
On Fri, Jun 24, 2011 at 1:52 PM, exelstu...@gmail.com
wrote:

>  Try some of these:
>
> https://github.com/insoshi/insoshi#readme
>
> http://communityengine.org/
>
> http://lovdbyless.com/
>
> http://www.enginey.com/
>
> Lovd by Less looks pretty good, haven’t had a chance to try it yet tho.
>

 hey
  anybody is using any one from   above  links ?

Thanks

   amritpalpathakgne.wordpress.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] Why does rendered.should have_field pass when it shouldn't?

2011-07-03 Thread David Zhang
This is my new.html.erb_spec.rb:

  let(:meal) do
mock_model("Meal").as_new_record.as_null_object
  end
  
  before(:each) do
assign(:meal, meal)
  end

  it "shows the name text field" do
  render
  rendered.should have_field(:name) # checks for both the label and the 
text field... right?
end

it "shows the description text area" do
  pending "This passes when it shouldn't"
  render
  rendered.should have_field(:description) # have_field is for text 
fields and text areas (w/labels)... right?
end

it "shows the ingredients text area" do
  pending "This passes when it shouldn't"
  render
  rendered.should have_field(:ingredients)
end

==
This is my new.html.erb:


New Meal
<%= render :partial => "form", :locals => { :meal => @meal, :button_name => 
"Create" } %>

It renders this partial...
==
The partial - _form.html.erb

<%= form_for [:admin, meal] do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
 
 <%= f.submit button_name %>
<% end %>

=


The problem: rendered.should have_field(:description) and the one for 
ingredients are passing although I never specify the description / 
ingredient text fields or textareas in the form.  Why is this?  It seems 
that the presence of the label and text field for :name is enough to make 
any have_field pass...

(have_field DOES test for text fields or text areas, right?)
(why does the documentation basically tell you /nothing/? no example or 
anything 
http://rubydoc.info/github/jnicklas/capybara/master/Capybara/RSpecMatchers#have_field-instance_method)

Help would be greatly 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/-/BqpTVkUheasJ.
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] Does the asset pipeline (RoR 3.1) waste cycles?

2011-07-03 Thread Dieter Lunn
In a development environment it recompiles the assets on every
request. When in production it does it once and adds a hash to the
filename for caching.

Dieter Lunn
http://ubiety.ca



On Sun, Jul 3, 2011 at 11:15 AM, Jeff Pickhardt  wrote:
> With the Ruby on Rails asset pipeline in RoR 3.1, it's unclear if the
> .coffee and the //= require files get processed only once or with each asset
> request.
>
> For example, I have a file that looks like this:
>
> //= require source/main.js.coffee
> //= require source/second.js.coffee
> //= require source/third.js.coffee
>
> Ideally, the server would compile these to js ONCE, then bundle them, then
> create a static file.  Otherwise it's going to be wasting cycles repeating
> effort.
>
> Can someone clarify what happens?
>
> Thanks,
> Jeff
>
> --
> Jeff Pickhardt
> (650) 530-0036
> pickha...@gmail.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] when to add validations to database

2011-07-03 Thread Adrian Caceres

Normally all my validation is done in my models.

Michael Hart in his rails tutorial explains why the uniqueness 
validation should also be done at the database layer ( 
http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-one#sec:the_caveat).


I am curious if people have experienced other validations that should 
also be done at the database layer?


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] Does the asset pipeline (RoR 3.1) waste cycles?

2011-07-03 Thread Jeff Pickhardt
With the Ruby on Rails asset pipeline in RoR 3.1, it's unclear if the
.coffee and the //= require files get processed only once or with each asset
request.

For example, I have a file that looks like this:

//= require source/main.js.coffee
//= require source/second.js.coffee
//= require source/third.js.coffee

Ideally, the server would compile these to js ONCE, then bundle them, then
create a static file.  Otherwise it's going to be wasting cycles repeating
effort.

Can someone clarify what happens?

Thanks,
Jeff

--
Jeff Pickhardt
(650) 530-0036
pickha...@gmail.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.



Re: [Rails] Can't upload files when WEBrick running in daemon mode.

2011-07-03 Thread Hassan Schroeder
On Sun, Jul 3, 2011 at 6:19 AM, Jen  wrote:
> When running my app in development with WEBrick in daemon mode I get the
> following error when trying to upload a file:
>
> Errno::ENOENT in UploadController#create
>
> No such file or directory - public/data/upload/google

> I do not get this error when not running in daemon mode. I've googled a bit
> but can't find a reason. Does anyone have any ideas?

My guess would be that 'current working directory' doesn't mean the
same thing to a daemonized process; how are you specifying the target
directory? Regardless...

> Also the reason I want to run in Daemon mode is ...

Why Webrick? It's only intended for desktop development work; you
would be better off using e.g. unicorn (my preference) or passenger
in a production environment.

Alternatively, if those aren't an option, see if you have `screen` on the
system you're using (http://www.gnu.org/software/screen/).

HTH,
-- 
Hassan Schroeder  hassan.schroe...@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 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] Web services - json-rcp

2011-07-03 Thread Marketlija Pik
Hello.


I am starting to write a web services in RoR, and considering different 
technologies to use. I am wondering if someone had experience working with 
json-rcp and what are its (dis)advandages over SOAP and REST.


Thank you,
Derek

-- 
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 upload files when WEBrick running in daemon mode.

2011-07-03 Thread Jen

Hi,
When running my app in development with WEBrick in daemon mode I get the 
following error when trying to upload a file:



 Errno::ENOENT in UploadController#create

No such file or directory - public/data/upload/google

|Rails.root: /home/resource_portal/website|

Application Trace  | Framework Trace 
 | Full Trace 



|app/models/upload.rb:29:in `initialize'
app/models/upload.rb:29:in `open'
app/models/upload.rb:29:in `filesave'
app/controllers/upload_controller.rb:16:in `create'
rake-0.8.7/ruby/1.9.1/gems/actionpack-3.0.3/lib/action_controller/metal/implicit_render.rb:4:in
 `send_action'
rake-0.8.7/ruby/1.9.1/gems/actionpack-3.0.3/lib/abstract_controller/base.rb:151:in
 `process_action'|
...

I do not get this error when not running in daemon mode. I've googled a bit but 
can't find a reason. Does anyone have any ideas?

Also the reason I want to run in Daemon mode is because I have to host my app 
on a uni virtual machine, and start the server after logging in with ssh. When 
I close the ssh connection the server (if not running in background) also seems 
to get killed.

Any ideas as to how I may be able to work around this?

Thanks,
Jen.


--
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: ROR Programmers?

2011-07-03 Thread ct9a
Where is it that you need arora people. I'm one and I'm in Melbourne,
victoria, AUSTRALIA

On Jul 1, 10:31 pm, Brandon  wrote:
> Where is the best place to find programmers?  I need a few ROR
> programmers for a quictoria

-- 
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: displaying attribute from related table with a collection_select

2011-07-03 Thread @demetriusolsen
Well that was easy! After a little trial and error, I created a new
method in the area.rb and used the name of that method in the
collection select :-) Cheers



On Jul 2, 11:48 pm, "@demetriusolsen"  wrote:
> I have two tables: Area, AreaType
>
> Area  belongs_to :area_type
> AreaType has_many :areas
>
> In my view, I'd like to select from a list of Areas, however, instead
> of using the :area_type_id attribute, I would like to use the
> associated area_type names. Here's what it looks like now:
>
> <%= f.collection_select(:area_id, Area.where(:subject_id =>
> @search.subject_id), :id, :area_type_id, {:include_blank => true} ) %>
>
> What I want is:
> <%= f.collection_select(:area_id, Area.where(:subject_id =>
> @search.subject_id), :id, area.area_type.name, {:include_blank =>
> true} ) %>
>
> Anyone know how I would go about creating the area.area_type.name
> "symbol" to user here?
>
> 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.