[Rails] How to get rspec running?
I'm quite new to RoR and recently worked through Michael Hartl's Rail Tutorial. Now that I had started my first own project and began with the implementation of a first model and it's controller. The tests I wanted to implement just after that. However, I run into some error messages when I want to start rspec (see below). The Gemfile is the same as in the Tutorial example and 'rspec spec' works perfectly in the other subdirectoy (U:\railsprojects\sample_app) without any problems. Can anybody help? Thanks and kind regards, Markus Error messages: U:\railsprojects\rim2011bundle install Fetching source index for http://rubygems.org/ Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.1) Using builder (2.1.2) Using i18n (0.4.2) Using activemodel (3.0.1) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.6) Using tzinfo (0.3.23) Using actionpack (3.0.1) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.9.1) Using actionmailer (3.0.1) Using arel (1.0.1) Using activerecord (3.0.1) Using activeresource (3.0.1) Using annotate-models (1.0.4) Using bundler (1.0.3) Using diff-lcs (1.1.2) Using factory_girl (1.3.2) Using thor (0.14.4) Using railties (3.0.1) Using rails (3.0.1) Using factory_girl_rails (1.0) Using faker (0.3.1) Installing nokogiri (1.4.4) Using rspec-core (2.0.1) Using rspec-expectations (2.0.1) Using rspec-mocks (2.0.1) Using rspec (2.0.1) Using rspec-rails (2.0.1) Using sqlite3-ruby (1.3.2) Using webrat (0.7.1) Using will_paginate (3.0.pre2) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. U:\railsprojects\rim2011rspec spec/ C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri/nokogiri.rb:1:in `require': 127: Die angegebene Prozedur wurde nicht gefunden. - Init_nokogiri (LoadError) C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri/1.9/nokogiri.so from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri/nokogiri.rb:1:in `top (required)' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri.rb:13:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4-x86-mingw32/lib/nokogiri.rb:13:in `top (required)' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/webrat-0.7.1/lib/webrat.rb:2:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/webrat-0.7.1/lib/webrat.rb:2:in `top (required)' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:112:in `require' from U://railsprojects/rim2011/config/application.rb:7:in `top (required)' from internal:lib/rubygems/custom_require:29:in `require' from internal:lib/rubygems/custom_require:29:in `require' from U://railsprojects/rim2011/config/environment.rb:2:in `top (required)' from internal:lib/rubygems/custom_require:29:in `require' from internal:lib/rubygems/custom_require:29:in `require' from U://railsprojects/rim2011/spec/spec_helper.rb:3:in `top (required)' from internal:lib/rubygems/custom_require:29:in `require' from internal:lib/rubygems/custom_require:29:in `require' from U://railsprojects/rim2011/spec/models/user_spec.rb:1:in `top (required)' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `block in load_spec_files' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `map' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:306:in `load_spec_files' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:18:in `run' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun' -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google
Re: [Rails] Rails 3 Active Record bug?
On 20 November 2010 07:25, Rajinder Yadav devguy...@gmail.com wrote: I'm getting strange results with rails 3.0.1 In each case the query seems to return the correct row, however only one of them gives me the correct value for the name field. ya...@six9:$ rails console Loading development environment (Rails 3.0.1) irb(main):001:0 Ticket = Ticket(id: integer, name: string, seat: string, address: text, price: decimal, email: string, created_at: datetime, updated_at: datetime) irb(main):002:0 t = Ticket.where name like ?, Pushpa Yadav = [#Ticket id: 2, name: Pushpa Yadav, seat: 12d, address: 12 Rosewood Ave.,Toronto,ON, price: #BigDecimal:34cd558,'0.1E2',9(18), email: ya...@email.ca, created_at: 2010-11-20 06:37:21, updated_at: 2010-11-20 06:37:21] irb(main):003:0 t.name = Ticket Look carefully and you will see that t is an array, containing all rows that match, though only one in this case. so you must do t[0].name or t.first.name or similar. I am not sure why t.name evaluates to Ticket though. irb(main):004:0 t = Ticket.find 2 = #Ticket id: 2, name: Pushpa Yadav, seat: 12d, address: 12 Rosewood Ave.,Toronto,ON, price: #BigDecimal:3443dd0,'0.1E2',9(18), email: ya...@email.ca, created_at: 2010-11-20 06:37:21, updated_at: 2010-11-20 06:37:21 irb(main):005:0 t.name = Pushpa Yadav As you have asked for a single row this time it is not an array. 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-t...@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] Plz anyone help me , how to write the code for google login page .
Plz anyone help me , how to write the code for google login page using ruby. Regards Venkat SP(India). -- 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-t...@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: rake test:unit gives Command failed with status (1):
I have created a test application. It only has one model. When I run tests on it it runs but still comes up with the same error message ie 1) Failure: test_should_not_be_valid_without_story(AnnnetteTest) [./test/unit/annnette_test.rb:6:in `test_should_not_be_valid_without_story' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run']: nil is not true. 1 tests, 1 assertions, 1 failures, 0 errors rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] Any ideas? -- 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-t...@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: SOAP::RPC::Driver
i tested this service with JAVA and it works , but my Ruby code cann't get this service, i don't know , 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 post to this group, send email to rubyonrails-t...@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: rake test:unit gives Command failed with status (1):
On 20 November 2010 11:08, Neil Bye li...@ruby-forum.com wrote: I have created a test application. It only has one model. When I run tests on it it runs but still comes up with the same error message ie 1) Failure: test_should_not_be_valid_without_story(AnnnetteTest) So your test is failing. Either you have written the test incorrectly or your application is not right. If you do not understand why the test is failing show us the code of the test and we may be able to help. [./test/unit/annnette_test.rb:6:in That is the line in your test where it is failing `test_should_not_be_valid_without_story' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run']: nil is not true. You have a test for something true, but it is actually nil. 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-t...@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] [JOB] Rails developer with 1-4 years of experience wanted in Bangalore.
Hi, ( Not sure if job postings are encouraged in this forum - my apologies if it is discouraged. ) We are looking for a talented Rails developer with 1-4 years of experience for SocialRPM. Please find the job description for the same below. Look forward to hearing back from folks interested in this position. Thanks Ruban -- *Our Product:SocialRPM *- socialrpm.com (currently in private alpha) *Our Service: ODigma *- odigma.com * * * We are a social media enterprise solutions startup based out of Bangalore. We are one of the first companies to provide a comprehensive social business solution suite that includes social media online reputation management monitoring tools, social CRM, social media marketing tools, social media analytics BI tools and an end-to-end social media management and marketing services. * We are looking for a talented Ruby and Rails developer to build innovative social media web applications for our product suite. If you are a self-starter, have a passion for building clean and scalable web software, thirst for learning new and cutting edge technologies platforms, love experimenting and innovating and enjoy the vibrant startup culture, we will provide you an enriching career experience. If this is you, we would like to hear from you soon: - Have about 1 - 4 years of experience in building and scaling Ruby on Rails applications in production - Knowledge of HTML, CSS2/CSS3 and Javascript / Ajax - Excellent grasp of MVC and DRY principles - Knowledge of XSS vulnerabilities and prevention - Knowledge of NoSQL DBs - especially MongoDB - Knowledge of REST APIs, OAuth and similar concepts - Comfortable with agile software development - Proficient in Linux - Team player If you have prior experience in developing Facebook or mobile applications it is a bonus. Email us your resume at *j...@socialrpm.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-t...@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] Plugin Based Application
Hi to all. I am developing an application, i want it to be totally modular and plugin based. E.g. The main application would have a Core plugin, on which every thing works, and further as needed new features, i would develop new plugins and upload.Like redmine.. Can any one help me or provide any good reference material on it. I will greatly be thankful. Regards Nazar -- 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-t...@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: Rails 3 Active Record bug?
On Nov 20, 9:11 am, Colin Law clan...@googlemail.com wrote: On 20 November 2010 07:25, Rajinder Yadav devguy...@gmail.com wrote: Look carefully and you will see that t is an array, containing all rows that match, though only one in this case. so you must do t[0].name or t.first.name or similar. I am not sure why t.name evaluates to Ticket though. Because it's not actually an array, it's a Arel scope and you can call class methods on such scopes (the method is called with conditions etc. set by the scope). In this case it's not very useful because the class method name just returns the name of the class but it still works. fred -- 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-t...@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: rake test:unit gives Command failed with status (1):
This is the test, it looks OK to me. require 'test_helper' class AnnnetteTest ActiveSupport::TestCase def test_should_not_be_valid_without_story a = Annnette.create(:story = 'Neil') assert a.errors.on(:story) end end Gleble -- 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-t...@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] Rails 3 Active Record bug?
On 10-11-20 04:11 AM, Colin Law wrote: On 20 November 2010 07:25, Rajinder Yadavdevguy...@gmail.com wrote: I'm getting strange results with rails 3.0.1 In each case the query seems to return the correct row, however only one of them gives me the correct value for the name field. ya...@six9:$ rails console Loading development environment (Rails 3.0.1) irb(main):001:0 Ticket = Ticket(id: integer, name: string, seat: string, address: text, price: decimal, email: string, created_at: datetime, updated_at: datetime) irb(main):002:0 t = Ticket.where name like ?, Pushpa Yadav = [#Ticket id: 2, name: Pushpa Yadav, seat: 12d, address: 12 Rosewood Ave.,Toronto,ON, price: #BigDecimal:34cd558,'0.1E2',9(18), email: ya...@email.ca, created_at: 2010-11-20 06:37:21, updated_at: 2010-11-20 06:37:21] irb(main):003:0 t.name = Ticket Look carefully and you will see that t is an array, containing all rows that match, though only one in this case. so you must do t[0].name or t.first.name or similar. I am not sure why t.name evaluates to Ticket though. irb(main):004:0 t = Ticket.find 2 = #Ticket id: 2, name: Pushpa Yadav, seat: 12d, address: 12 Rosewood Ave.,Toronto,ON, price: #BigDecimal:3443dd0,'0.1E2',9(18), email: ya...@email.ca, created_at: 2010-11-20 06:37:21, updated_at: 2010-11-20 06:37:21 irb(main):005:0 t.name = Pushpa Yadav As you have asked for a single row this time it is not an array. Colin Thanks Colin, that makes sense! I had it in my head I was only getting back a single row, failed to see an array was being returned. -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- 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-t...@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: rake test:unit gives Command failed with status (1):
On 20 November 2010 11:56, Neil Bye li...@ruby-forum.com wrote: Please don't top post, it makes it difficult to follow the thread. Insert your comments at appropriate point in previous message. Thanks. This is the test, it looks OK to me. require 'test_helper' class AnnnetteTest ActiveSupport::TestCase def test_should_not_be_valid_without_story a = Annnette.create(:story = 'Neil') assert a.errors.on(:story) So what can you deduce from this? The test says a.errors.on(:story) should be true. When you run the test it says it is nil. Your app is allowing the create without generating errors. However the test looks a bit odd. The name suggests that you are checking that you cannot create an Annnette without a story, yet you appear to be giving it one ('Neil'). 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-t...@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] database rubygems
Hi everybody!! I use rails 3.0 In my new created project I tried to run it by the command rails -s but it show me that Could not find gem 'sqlite3-ruby (= 0, runtime)' in any of the gem sources.Try running `bundle install`.even after doing bundle install I've already exactly installed gem Why this error occurred! In my Gemfile in the project I've the line gem 'sqlite3-ruby', :require = 'sqlite3'. I tried to create project with mysql like rails new project -d mysql but the problem stay still Could not find gem 'mysql2 (= 0, runtime)' in any of the gem sources.Try running `bundle install`. What's wrong please??? Thanks to be pleased to help me, i really need it!!! -- 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-t...@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: rake test:unit gives Command failed with status (1):
Colin Law wrote in post #962761: On 20 November 2010 11:56, Neil Bye li...@ruby-forum.com wrote: Please don't top post, it makes it difficult to follow the thread. Insert your comments at appropriate point in previous message. Thanks. This is the test, it looks OK to me. require 'test_helper' class AnnnetteTest ActiveSupport::TestCase def test_should_not_be_valid_without_story a = Annnette.create(:story = 'Neil') assert a.errors.on(:story) So what can you deduce from this? The test says a.errors.on(:story) should be true. When you run the test it says it is nil. Your app is allowing the create without generating errors. However the test looks a bit odd. The name suggests that you are checking that you cannot create an Annnette without a story, yet you appear to be giving it one ('Neil'). Colin So I change line 6 to a = Annnette.create(:story = nil) and I still get 1) Failure: test_should_not_be_valid_without_story(AnnnetteTest) [./test/unit/annnette_test.rb:6:in `test_should_not_be_valid_without_story' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run']: nil is not true. 1 tests, 1 assertions, 1 failures, 0 errors rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] -- 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-t...@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: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 12:28, Neil Bye li...@ruby-forum.com wrote: Colin Law wrote in post #962761: On 20 November 2010 11:56, Neil Bye li...@ruby-forum.com wrote: Please don't top post, it makes it difficult to follow the thread. Insert your comments at appropriate point in previous message. Thanks. This is the test, it looks OK to me. require 'test_helper' class AnnnetteTest ActiveSupport::TestCase def test_should_not_be_valid_without_story a = Annnette.create(:story = 'Neil') assert a.errors.on(:story) So what can you deduce from this? The test says a.errors.on(:story) should be true. When you run the test it says it is nil. Your app is allowing the create without generating errors. However the test looks a bit odd. The name suggests that you are checking that you cannot create an Annnette without a story, yet you appear to be giving it one ('Neil'). Colin So I change line 6 to a = Annnette.create(:story = nil) and I still get 1) Failure: test_should_not_be_valid_without_story(AnnnetteTest) [./test/unit/annnette_test.rb:6:in `test_should_not_be_valid_without_story' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run']: nil is not true. You will have to look at the code of the app and work out why. Presumably somewhere in your code you have attempted to prevent the creation without a story. If you cannot see what is wrong with that code (the code that prevents the creation without a story) then you could look at the Rails Guide on debugging to help you to find out what is going on. 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-t...@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: Re: rake test:unit gives Command failed with status (1):
Colin Law wrote in post #962765: On 20 November 2010 12:28, Neil Bye li...@ruby-forum.com wrote: class AnnnetteTest ActiveSupport::TestCase [./test/unit/annnette_test.rb:6:in `test_should_not_be_valid_without_story' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__' /home/neil/annnette/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run']: nil is not true. You will have to look at the code of the app and work out why. Presumably somewhere in your code you have attempted to prevent the creation without a story. If you cannot see what is wrong with that code (the code that prevents the creation without a story) then you could look at the Rails Guide on debugging to help you to find out what is going on. Colin Presumably somewhere in your code you have attempted to prevent the creation without a story. That can't be so because this works n...@baby6:~/annnette$ script/console Loading development environment (Rails 2.2.3) a = Annnette.create(:story = 'neil') = #Annnette id: 3, story: neil, created_at: 2010-11-20 12:58:11, updated_at: 2010-11-20 12:58:11 -- 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-t...@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: modeling questions
Frederick Cheung wrote in post #962721: On Nov 19, 12:23pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: used it, but has probably been fixed by now. awesome_nested_set lives up to its name. Although nested sets make inserts very expensive. So use nested intervals instead. They fix that problem completely. Like most data modelling questions, the sort of access patterns that will be used - while acts as tree makes getting a whole subtree expensive, if you never need to do that in your app, who cares? If you never need a whole subtree, you probably don't need a tree structure in the first place (though there are exceptions). Fred Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- 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-t...@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: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 13:00, Neil Bye li...@ruby-forum.com wrote: Colin Law wrote in post #962765: [...] Presumably somewhere in your code you have attempted to prevent the creation without a story. That can't be so because this works n...@baby6:~/annnette$ script/console Loading development environment (Rails 2.2.3) a = Annnette.create(:story = 'neil') = #Annnette id: 3, story: neil, created_at: 2010-11-20 12:58:11, updated_at: 2010-11-20 12:58:11 I am losing track of this conversation. I think we had better start again. Can you explain: 1. What the test you wrote is attempting to check. 2. What code you have written in the application to perform the operation that the test is checking. 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-t...@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: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 12:28, Neil Bye li...@ruby-forum.com wrote: class AnnnetteTest ActiveSupport::TestCase def test_should_not_be_valid_without_story a = Annnette.create(:story = 'Neil') assert a.errors.on(:story) So I change line 6 to a = Annnette.create(:story = nil) and I still get 1) Failure: nil is not true. You should possibly not be using .create as that does a save at that point. The save will fail (because there's no story) and a won't be assigned anything. instead, try: a = Annnette.new(:story = nil) Or load a valid Annnette from your fixtures (or factories), set the story to nil, and check the errors. -- 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-t...@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: Re: Re: rake test:unit gives Command failed with status (1):
Colin Law wrote in post #962775: On 20 November 2010 13:00, Neil Bye li...@ruby-forum.com wrote: = #Annnette id: 3, story: neil, created_at: 2010-11-20 12:58:11, updated_at: 2010-11-20 12:58:11 I am losing track of this conversation. I think we had better start again. Can you explain: 1. What the test you wrote is attempting to check. 2. What code you have written in the application to perform the operation that the test is checking. Colin 1.It should show an error if an attempt is made to create a story without a story entry. 2.This is from annnettes_controller.rb def create @annnette = Annnette.new(params[:annnette]) respond_to do |format| if @annnette.save flash[:notice] = 'Annnette was successfully created.' format.html { redirect_to(@annnette) } format.xml { render :xml = @annnette, :status = :created, :location = @annnette } else format.html { render :action = new } format.xml { render :xml = @annnette.errors, :status = :unprocessable_entity } end end end It is a very simple app made with scaffold to try and understand the problems with my main app which started this thread. -- 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-t...@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: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 13:47, Neil Bye li...@ruby-forum.com wrote: Colin Law wrote in post #962775: On 20 November 2010 13:00, Neil Bye li...@ruby-forum.com wrote: = #Annnette id: 3, story: neil, created_at: 2010-11-20 12:58:11, updated_at: 2010-11-20 12:58:11 I am losing track of this conversation. I think we had better start again. Can you explain: 1. What the test you wrote is attempting to check. 2. What code you have written in the application to perform the operation that the test is checking. Colin 1.It should show an error if an attempt is made to create a story without a story entry. 2.This is from annnettes_controller.rb def create �...@annnette = Annnette.new(params[:annnette]) respond_to do |format| if @annnette.save flash[:notice] = 'Annnette was successfully created.' format.html { redirect_to(@annnette) } format.xml { render :xml = @annnette, :status = :created, :location = @annnette } else format.html { render :action = new } format.xml { render :xml = @annnette.errors, :status = :unprocessable_entity } end end end I don't see anything there stopping a save if there is no story. Anyway this code is not called when you call Annnette.create, the create method of the model is called. As Michael has pointed out you probably want to use new rather than create in the test, but you still need code to stop the save if there is no story. Usually this would be done by a validation in the controller. 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-t...@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: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 13:47, Neil Bye li...@ruby-forum.com wrote: 1.It should show an error if an attempt is made to create a story without a story entry. 2.This is from annnettes_controller.rb But you're testing a Model... so the controller code is not very useful to help with what's going on :-/ -- 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-t...@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: Re: Re: Re: rake test:unit gives Command failed with status (1):
Michael Pavling wrote in post #962781: On 20 November 2010 13:47, Neil Bye li...@ruby-forum.com wrote: 1.It should show an error if an attempt is made to create a story without a story entry. 2.This is from annnettes_controller.rb But you're testing a Model... so the controller code is not very useful to help with what's going on :-/ There is no code in models/annette.rb I would be happy if any test worked -- 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-t...@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: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 14:49, Neil Bye li...@ruby-forum.com wrote: Michael Pavling wrote in post #962781: But you're testing a Model... so the controller code is not very useful to help with what's going on :-/ There is no code in models/annette.rb no validates_presence_of :annnette? I would be happy if any test worked If you're writing code to validate db updates in your controller, and trying to test them with unit tests, I suggest you take a couple of steps back, buy and read the Agile Web Development With Rails book, and move forward from there. Regards, -- 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-t...@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: How do I create a function
Jason Hhh wrote: I have a rails app. I understand how to create a function in Rails. I have a contact that is viewable by multiple users. I want to create a function to lock and unlock the contact. I have a field in the contact database called locked. I assume I create a new function in the action controller or contact controller like: def lock(contact_id) c=Contact.find(contact_id) c.locked = 1 c.save end def unlock(contact_id) c=Contact.find(contact_id) c.locked = 0 c.save end Is this the proper way to do this? How do I make sure it's not accessible through the through the URL: /Contacts/lock? You can create a 'private' section in your controller if you have something which belongs in the controller. The stuff in private is accessable from methods in the controller but not through the url. -- 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-t...@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: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 14:49, Neil Bye li...@ruby-forum.com wrote: Michael Pavling wrote in post #962781: On 20 November 2010 13:47, Neil Bye li...@ruby-forum.com wrote: 1.It should show an error if an attempt is made to create a story without a story entry. 2.This is from annnettes_controller.rb But you're testing a Model... so the controller code is not very useful to help with what's going on :-/ There is no code in models/annette.rb I would be happy if any test worked If you just want a test that works then change your existing test to one that checks that you _can_ create an object if you _do_ provide a story, use new instead of create and change the assert to assert_nil, something like class AnnnetteTest ActiveSupport::TestCase def test_should_be_valid_with_story a = Annnette.new(:story = 'Neil') assert_nil a.errors.on(:story) end 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-t...@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: select helper with boolean and null/nil values
At that point, you *did* need it. Ugly or repetitive code is an example of a need -- in this case, for refactoring or generalization. There might have been a 'personal' need but I don't think that makes it a *real* need. The ugly code was just the way it is done. Changing it was like saying I don't like the way Ruby lets me assign strings to a variable so I am going to change it. and then you come up with something that replaces my_var = 'my string'. -- 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-t...@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: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
Colin Law wrote in post #962795: class AnnnetteTest ActiveSupport::TestCase def test_should_be_valid_with_story a = Annnette.new(:story = 'Neil') assert_nil a.errors.on(:story) end Colin OK that worked so I changed the test in my other app (the one that matters) to class StoryTest ActiveSupport::TestCase def test_should_be_valid_with_author s = Story.create(:author = 'neil', :title = 'Story', :body = 'test') assert s.errors.on(:author) end When I run the test I still get n...@baby6:~/$ rake test:units (in /home/neil/) /usr/bin/ruby1.8 -Ilib:test /usr/lib/ruby/1.8/rake/rake_test_loader.rb test/unit/comment_test.rb test/unit/user_mailer_test.rb test/unit/friendship_test.rb test/unit/helpers/friendship_helper_test.rb test/unit/helpers/profile_helper_test.rb test/unit/helpers/community_helper_test.rb test/unit/user_test.rb test/unit/story_test.rb ruby index.rb data dir index dir rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] Gleble -- 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-t...@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] Equivalent to View Page Source; No AJAX
I am developing a website that does not use AJAX. What I would like to be able to do on the server side is find the point in RoR (assuming it exists) where the HTML is rendered and capture that string so that I can manipulate it for my purposes. To be a little clearer, the user at their browser can do a View Page Source and then save that HTML to a file. I would like to generate (i.e. capture) exactly the contents of that string/file on the server side so that I can save it on the SERVER. I am not asking for the client to send back the contents of the View Page Source back to the server. I do not wish to interfere with the sending of the HTML to the client. I just want to get a copy of that HTML so that I can save it to a file on the server and have that file have exactly the same contents as a View Page Source and then Save File as that file would be on the client. Is this possible and/or easy to do? -- 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-t...@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: select helper with boolean and null/nil values
Hi David, Can you post your application in a different format? I need a C compiler to install bzip2 and I'd rather not go into all that. 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-t...@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: Equivalent to View Page Source; No AJAX
On Nov 20, 4:19 pm, Ralph Shnelvar li...@ruby-forum.com wrote: I am developing a website that does not use AJAX. What I would like to be able to do on the server side is find the point in RoR (assuming it exists) where the HTML is rendered and capture that string so that I can manipulate it for my purposes. To be a little clearer, the user at their browser can do a View Page Source and then save that HTML to a file. I would like to generate (i.e. capture) exactly the contents of that string/file on the server side so that I can save it on the SERVER. Is this possible and/or easy to do? You could probably do that from an after_filter - you should be able to play around with response.body. Fred -- 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-t...@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: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 16:07, Neil Bye li...@ruby-forum.com wrote: Colin Law wrote in post #962795: class AnnnetteTest ActiveSupport::TestCase def test_should_be_valid_with_story a = Annnette.new(:story = 'Neil') assert_nil a.errors.on(:story) end Colin OK that worked so I changed the test in my other app (the one that matters) to class StoryTest ActiveSupport::TestCase def test_should_be_valid_with_author s = Story.create(:author = 'neil', :title = 'Story', :body = 'test') What is that create doing there? assert s.errors.on(:author) That should be assert_nil if you expect no errors. end When I run the test I still get n...@baby6:~/$ rake test:units (in /home/neil/) /usr/bin/ruby1.8 -Ilib:test /usr/lib/ruby/1.8/rake/rake_test_loader.rb test/unit/comment_test.rb test/unit/user_mailer_test.rb test/unit/friendship_test.rb test/unit/helpers/friendship_helper_test.rb test/unit/helpers/profile_helper_test.rb test/unit/helpers/community_helper_test.rb test/unit/user_test.rb test/unit/story_test.rb ruby index.rb data dir index dir rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] That is a completely different error, it is rake that is aborting, not the test that is failing (that is why it says 'rake aborted'). It has not got as far as running the tests, so the content of the tests is immaterial. Show us the rest of the message - but first look through it yourself and see if you can see what is the problem, or at least some hint as to the problem. The next bit that you have not showed us may well be the key. 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-t...@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] Plz anyone help me , how to write the code for google login page .
On Sat, Nov 20, 2010 at 3:31 AM, Venkat s Patchava li...@ruby-forum.comwrote: Plz anyone help me , how to write the code for google login page using ruby. If you can be more specific I am sure someone will be willing to help. Otherwise, if you need a mind reader or psychic, perhaps this group might help: http://groups.google.com/group/free-psychic-reading. Regards Venkat SP(India). -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@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-t...@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: How to get rspec running?
I'm still looking for a solution. I have uninstalled 'nokogiri', 'webrat', 'rspec' and 'rspec-rails' several time. But after each successful 'bundle install', I will get the same error messages again when trying 'rspec spec/'. Has anybody an idea in which direction I should search? -- 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-t...@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: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
Colin Law wrote in post #962810: That is a completely different error, it is rake that is aborting, not the test that is failing (that is why it says 'rake aborted'). It has not got as far as running the tests, so the content of the tests is immaterial. Show us the rest of the message - but first look through it yourself and see if you can see what is the problem, or at least some hint as to the problem. The next bit that you have not showed us may well be the key. Colin That's what I thought at first. I built the test app t try and make sure the test bit worked . Anyhow heres the whole thing. Gleble n...@baby6:~/*$ rake test:units --trace (in /home/neil/**) ** Invoke test:units (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:abort_if_pending_migrations ** Execute db:test:prepare ** Invoke db:test:load (first_time) ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:load ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load ** Execute test:units /usr/bin/ruby1.8 -Ilib:test /usr/lib/ruby/1.8/rake/rake_test_loader.rb test/unit/comment_test.rb test/unit/user_mailer_test.rb test/unit/friendship_test.rb test/unit/helpers/friendship_helper_test.rb test/unit/helpers/profile_helper_test.rb test/unit/helpers/community_helper_test.rb test/unit/user_test.rb test/unit/story_test.rb ruby index.rb data dir index dir rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] /usr/lib/ruby/1.8/rake.rb:995 /usr/lib/ruby/1.8/rake.rb:1010:in `call' /usr/lib/ruby/1.8/rake.rb:1010:in `sh' /usr/lib/ruby/1.8/rake.rb:1094:in `sh' /usr/lib/ruby/1.8/rake.rb:1029:in `ruby' /usr/lib/ruby/1.8/rake.rb:1094:in `ruby' /usr/lib/ruby/1.8/rake/testtask.rb:117 /usr/lib/ruby/1.8/rake.rb:1112:in `verbose' /usr/lib/ruby/1.8/rake/testtask.rb:102 /usr/lib/ruby/1.8/rake.rb:636:in `call' /usr/lib/ruby/1.8/rake.rb:636:in `execute' /usr/lib/ruby/1.8/rake.rb:631:in `each' /usr/lib/ruby/1.8/rake.rb:631:in `execute' /usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:583:in `invoke' /usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task' /usr/lib/ruby/1.8/rake.rb:2029:in `top_level' /usr/lib/ruby/1.8/rake.rb:2029:in `each' /usr/lib/ruby/1.8/rake.rb:2029:in `top_level' /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:2023:in `top_level' /usr/lib/ruby/1.8/rake.rb:2001:in `run' /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:1998:in `run' /usr/bin/rake:28 -- 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-t...@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 route found to match - Routing Error on Dreamhost
I'm a newbie to Ruby/Rails as well. When I tried 'my_test' in the URL (i.e. http://localhost:3000/my_test/index), and all permutations of it thereafter, I still kept getting the 'no route to found to match...' error. However, there is a configuration in the routes.rb file that will make these URLs work (apparently, since Rails 3, this is the configuration to put in). Just insert the below configuration anywhere in the routes.rb file match 'my_test/index' = 'my_test#index' Restart Rails after this, and try the http://localhost:3000/my_test/index URL again. Hopefully, that should do it. Good luck, G. -- 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-t...@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] database rubygems
Do you have 'mysql2' gem installed?? Check your system gems or local gems if using rvm and look for mysql2 gem. I know its not there, so install it by running gem install mysql2. On Sat, Nov 20, 2010 at 4:28 AM, Aicha Aicha li...@ruby-forum.com wrote: Hi everybody!! I use rails 3.0 In my new created project I tried to run it by the command rails -s but it show me that Could not find gem 'sqlite3-ruby (= 0, runtime)' in any of the gem sources.Try running `bundle install`.even after doing bundle install I've already exactly installed gem Why this error occurred! In my Gemfile in the project I've the line gem 'sqlite3-ruby', :require = 'sqlite3'. I tried to create project with mysql like rails new project -d mysql but the problem stay still Could not find gem 'mysql2 (= 0, runtime)' in any of the gem sources.Try running `bundle install`. What's wrong please??? Thanks to be pleased to help me, i really need it!!! -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@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-t...@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: Re: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 18:21, Neil Bye li...@ruby-forum.com wrote: [...] n...@baby6:~/*$ rake test:units --trace (in /home/neil/**) ** Invoke test:units (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:abort_if_pending_migrations ** Execute db:test:prepare ** Invoke db:test:load (first_time) ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:load ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load ** Execute test:units /usr/bin/ruby1.8 -Ilib:test /usr/lib/ruby/1.8/rake/rake_test_loader.rb test/unit/comment_test.rb test/unit/user_mailer_test.rb test/unit/friendship_test.rb test/unit/helpers/friendship_helper_test.rb test/unit/helpers/profile_helper_test.rb test/unit/helpers/community_helper_test.rb test/unit/user_test.rb test/unit/story_test.rb ruby index.rb data dir index dir rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] /usr/lib/ruby/1.8/rake.rb:995 /usr/lib/ruby/1.8/rake.rb:1010:in `call' /usr/lib/ruby/1.8/rake.rb:1010:in `sh' /usr/lib/ruby/1.8/rake.rb:1094:in `sh' /usr/lib/ruby/1.8/rake.rb:1029:in `ruby' /usr/lib/ruby/1.8/rake.rb:1094:in `ruby' /usr/lib/ruby/1.8/rake/testtask.rb:117 /usr/lib/ruby/1.8/rake.rb:1112:in `verbose' /usr/lib/ruby/1.8/rake/testtask.rb:102 /usr/lib/ruby/1.8/rake.rb:636:in `call' /usr/lib/ruby/1.8/rake.rb:636:in `execute' /usr/lib/ruby/1.8/rake.rb:631:in `each' /usr/lib/ruby/1.8/rake.rb:631:in `execute' /usr/lib/ruby/1.8/rake.rb:597:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/1.8/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:583:in `invoke' /usr/lib/ruby/1.8/rake.rb:2051:in `invoke_task' /usr/lib/ruby/1.8/rake.rb:2029:in `top_level' /usr/lib/ruby/1.8/rake.rb:2029:in `each' /usr/lib/ruby/1.8/rake.rb:2029:in `top_level' /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:2023:in `top_level' /usr/lib/ruby/1.8/rake.rb:2001:in `run' /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:1998:in `run' /usr/bin/rake:28 What happens if you run one of the tests explicitly, for example ruby -I test test/unit/comment_test.rb That is a capital i in -I test, telling ruby to include the test folder. Otherwise I am getting out of my depth I think. Can anyone else suggest what the problem may be? 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-t...@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: Re: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 20:11, Colin Law clan...@googlemail.com wrote: What happens if you run one of the tests explicitly, for example ruby -I test test/unit/comment_test.rb Otherwise I am getting out of my depth I think. Can anyone else suggest what the problem may be? From the stack trace, it does look like it's failing at story_test (unless that list of test files includes every single test in the directory...). As an extension of Colin's suggestion to run one test; what if you remove the story_test.rb file from the directory to test running everything *apart* from that. If it works without the story_test, I'd guess there's something in there that's making it not parse... -- 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-t...@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] Global text search (and replace) on MacVim?
Been trying out Macvim and I think I have covered most of what I used in other editors except for how to handle global searches and replaces for text in files (i.e. not looking for file names, but search and replace text within all files below a specific directory). Can anyone who uses MacVim tell me what they use for such tasks? I have been poking around and see :grep as the main method, although not sure if I can use it to do a replace? If you can give me a few examples specific to MacVim that would be great. Thanks, David -- 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-t...@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] Global text search (and replace) on MacVim?
On 20 November 2010 20:33, David Kahn d...@structuralartistry.com wrote: Can anyone who uses MacVim tell me what they use for such tasks? Appropriate newsgroups? -- 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-t...@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] Global text search (and replace) on MacVim?
On 20 November 2010 20:37, Michael Pavling pavl...@gmail.com wrote: On 20 November 2010 20:33, David Kahn d...@structuralartistry.com wrote: Can anyone who uses MacVim tell me what they use for such tasks? Appropriate newsgroups? http://groups.google.com/group/vim_mac/web/macvim?pli=1 -- 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-t...@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] Global text search (and replace) on MacVim?
On Sat, Nov 20, 2010 at 2:38 PM, Michael Pavling pavl...@gmail.com wrote: On 20 November 2010 20:37, Michael Pavling pavl...@gmail.com wrote: On 20 November 2010 20:33, David Kahn d...@structuralartistry.com wrote: Can anyone who uses MacVim tell me what they use for such tasks? Appropriate newsgroups? Thanks... did not think of that http://groups.google.com/group/vim_mac/web/macvim?pli=1 -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@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-t...@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: Re: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
Does any of this help? Michael Pavling wrote in post #962835: On 20 November 2010 20:11, Colin Law clan...@googlemail.com wrote: What happens if you run one of the tests explicitly, for example ruby -I test test/unit/comment_test.rb n...@baby6:~/*$ ruby -I test test/unit/comment_test.rb ruby index.rb data dir index dir n...@baby6:~/*$ As an extension of Colin's suggestion to run one test; what if you remove the story_test.rb file from the directory to test running everything *apart* from that. That gives /usr/bin/ruby1.8 -Ilib:test /usr/lib/ruby/1.8/rake/rake_test_loader.rb test/unit/comment_test.rb test/unit/user_mailer_test.rb test/unit/friendship_test.rb test/unit/helpers/friendship_helper_test.rb test/unit/helpers/profile_helper_test.rb test/unit/helpers/community_helper_test.rb test/unit/user_test.rb ruby index.rb data dir index dir rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -Ilib:test /usr/lib/ru...] (See full trace by running task with --trace) n...@baby6:~/wagging_tales$ -- 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-t...@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: Re: Re: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
On 20 November 2010 21:30, Neil Bye li...@ruby-forum.com wrote: Does any of this help? Michael Pavling wrote in post #962835: On 20 November 2010 20:11, Colin Law clan...@googlemail.com wrote: What happens if you run one of the tests explicitly, for example ruby -I test test/unit/comment_test.rb n...@baby6:~/*$ ruby -I test test/unit/comment_test.rb ruby index.rb data dir index dir Is that all? What on earth is that about? What if you try one of the other tests? 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-t...@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: Re: Re: Re: Re: Re: Re: Re: rake test:unit gives Command failed with status (1):
Colin Law wrote in post #962842: On 20 November 2010 21:30, Neil Bye li...@ruby-forum.com wrote: Does any of this help? Michael Pavling wrote in post #962835: On 20 November 2010 20:11, Colin Law clan...@googlemail.com wrote: What happens if you run one of the tests explicitly, for example ruby -I test test/unit/comment_test.rb n...@baby6:~/*$ ruby -I test test/unit/comment_test.rb ruby index.rb data dir index dir Is that all? What on earth is that about? What if you try one of the other tests? Colin n...@baby6:~/wagging_tales$ ruby -I test test/unit/story_test.rb ruby index.rb data dir index dir n...@baby6:~/wagging_tales$ Gleble -- 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-t...@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] syntax error, unexpected tSTRING_BEG
Rails is throwing this error C:/Ruby/Depot/app/views/products/index.html.erb:28: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' ...er.privilege == 50 ? {link_to 'Show', product} : 'a' );@out... in line %= current_user.privilege == 50 ? {link_to 'Show', product} : 'a' % current_user at ApllicationController def current_user return unless session[:user_id] @current_user ||= User.find_by_id(session[:user_id]) 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 post to this group, send email to rubyonrails-t...@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] Could not find RubyGem sqlite3-ruby (= 0)
Hi all, I just copied a small project from my computer to my vps. When I try to run rake db:migrate I get the error: Could not find RubyGem sqlite3-ruby (= 0) Here's the output with trace: (in /home/ed/blog_branch) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! Could not find RubyGem sqlite3-ruby (= 0) /usr/local/lib/site_ruby/1.8/rubygems.rb:779:in `report_activate_error' /usr/local/lib/site_ruby/1.8/rubygems.rb:214:in `activate' /usr/local/lib/site_ruby/1.8/rubygems.rb:1082:in `gem' /home/ed/blog_branch/config/environment.rb:43 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19 I do have sqlite3-ruby installed though. Any suggestions? Thanks a lot, Eddie -- 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-t...@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] Gem environment has wrong ruby version
Hi all, This appears to be wrong, I'm not sure how to fix it. Here's my output from gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /usr/lib/ruby/gems/1.8 - /home/ed/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources = true - :verbose = true - :benchmark = false - :backtrace = false - :bulk_threshold = 1000 - REMOTE SOURCES: - http://rubygems.org/ And here's ruby -v ruby 1.9.1p0 (2009-01-30 revision 21907) [x86_64-linux] So gem has the wrong version of ruby in the environment. I suspect this may be the reason of some weird errors I've been seeing. So how do I change the gem environment? Thanks, Eddie -- 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-t...@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: How to get rspec running?
Gave up for today, still not working. I would really appreciate if somebody could give me a hint what I should try or check. 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-t...@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: syntax error, unexpected tSTRING_BEG
On Nov 20, 10:04 pm, Jose tomas R. li...@ruby-forum.com wrote: Rails is throwing this error C:/Ruby/Depot/app/views/products/index.html.erb:28: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' ...er.privilege == 50 ? {link_to 'Show', product} : 'a' );@out... in line %= current_user.privilege == 50 ? {link_to 'Show', product} : 'a' % I think you meant those to be () rather than {} Fred current_user at ApllicationController def current_user return unless session[:user_id] �...@current_user ||= User.find_by_id(session[:user_id]) end -- 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-t...@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 get the :remote = true working to update a part of the page?
In Rails 2, I used this kind of code to get a certain part of the page to update. !-- section/show-- % if @section.has_sidebar % div id='sidebar_div' class='span-3' ul class='sidebar_list' % for page in @section.pages % li%= link_to_remote #{page.name}, :update='show_page', :url = { :controller='pages',:action='show_page', :id=page.id }, :html={} %/li hr/ % end % /ul /div % end % div id='show_page' % if @section.has_sidebar %class='span-18 last vert_divider'% end % %= render :partial = 'pages/show', :locals = { :page=@page } % /div - In the controller :pages, I had a show_page method that just rendered the partial again. In Rails 3, I don't know how to accomplish this. I want to use jQuery, which I already know how to code, but I don't know how to get it working in this way. Should I create a js.erb file in my view? I watched the http://railscasts.com/episodes/205-unobtrusive-javascript but I still don't know how to get it working to update one part of the page! Basically, I have this sidebar with links on it, and each time a user a clicks on one of them, the central part of the page should update - AJAX! How do I do this? Do I still need this show_page method in the controller? -- 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-t...@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: syntax error
i notice, thanks i use that line too mucho on my code so i made on ApplicationControlller def privilege (session[:user_id].exist? session[:user_id].privilege == 50) ? true : false end and on the actual page i put %= :privilege ? link_to('Edit', edit_product_path(product)) : % but it doesnt work -- 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-t...@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] Streaming video servers for Ruby on Rails App
We have an application that makes heavy use of Videos that need to be served from a streaming server. Ideally, this server should be able to support both quick-time and flash clients (e.g. IPad and Android tablets). If anyone has any suggestions based on a product/vendor that has worked well, please let us know. Thanks. Bharat -- 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-t...@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] needs RUBY-XML tutorial..please help me
HI, To built a rss feed for my project, I need to learn xml or I want to learn how to parse xml with ruby. So, if possible, please provide some tutorial links so that I will be grateful:) -- Thanks, Irfan Ahmed Rizvi http://www.welltreat.us +880 1676 246 991 +880 1723 712 288 -- 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-t...@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] Troubles getting :id
im using %= button_to 'Rent', :controller = 'transaction' , :action = 'rent', :id = @product.id % on ProductsController to pass an :id to a TransactionController but when searching for the product's id def load_product @product = Product.find(:id).id end i get Couldn't find Product with ID=id Error i tried using @product = Product.find(1).id for testint an worked, also, the URL is ok transaction/rent/1 controller/action/id BTW, how can i turn that button_to onto a link_to that works with an action outside self controller -- 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-t...@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] Gem environment has wrong ruby version
On Nov 20, 2010, at 5:33 PM, Eddie Du wrote: Hi all, This appears to be wrong, I'm not sure how to fix it. Here's my output from gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /usr/lib/ruby/gems/1.8 - /home/ed/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources = true - :verbose = true - :benchmark = false - :backtrace = false - :bulk_threshold = 1000 - REMOTE SOURCES: - http://rubygems.org/ And here's ruby -v ruby 1.9.1p0 (2009-01-30 revision 21907) [x86_64-linux] So gem has the wrong version of ruby in the environment. I suspect this may be the reason of some weird errors I've been seeing. So how do I change the gem environment? You need to install gem (and all your gems) again, under the new ruby. Each ruby gets its own gems, stored in its own version tree. Walter -- 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-t...@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: Rails2/Rails3 nested form, fields_for not displayed
Nicolas, Sorry to drag up this old topic, but I'm having the exact same problem. So what was your error? I assume I'm making the same mistake. Thanks in advance, Chris -- 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-t...@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: How to get the :remote = true working to update a part of the page?
I found a clean answer, and I thought I'd explain the solution. Basically, I was too caught up in the jQuery and etc. - in this case, Prototype works very nicely. With jQuery, I got to fumbling around with a js.erb files. With prototype, in this, case the solution is really clean. http://www.ruby-forum.com/topic/211467 describes a similar solution. ---The View--- !-- section/show -- % if @section.has_sidebar % div id='sidebar_div' class='span-3' ul class='sidebar_list' % for page in @section.pages % li%= link_to #{page.name}, page, :remote = true %/li hr/ % end % /ul /div % end % div id='show_page' % if @section.has_sidebar %class='span-18 last vert_divider'% end % %= render :partial = 'pages/show_page', :locals = { :page=@page } % /div ---PagesController--- class PagesController ApplicationController def show @page = Page.find(params[:id]) respond_to do |format| format.js { render(:update) do |page| # uses Prototype, the JS framework page.replace_html 'show_page', :partial = show_page, :locals = { :page = @page } end } end end end Hopefully this will help anyone who's encountered this same problem, so that person can come to the answer more quickly. :D -- 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-t...@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: syntax error
On Sat, Nov 20, 2010 at 5:22 PM, Jose tomas R. li...@ruby-forum.com wrote: i notice, thanks i use that line too mucho on my code so i made on ApplicationControlller def privilege (session[:user_id].exist? session[:user_id].privilege == 50) ? true : false end and on the actual page i put %= :privilege ? link_to('Edit', edit_product_path(product)) : % but it doesnt work There might be other issues, but the reason you can not access it is that you either need to put it in a helper (app/helpers), *or* make your code in the application controller look like: helper_method :privelige def privelige # your code here 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 post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@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-t...@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] needs RUBY-XML tutorial..please help me
Hey Irfan, Have a look at REXML tutorial @; http://www.germane-software.com/software/rexml/docs/tutorial.html http://www.germane-software.com/software/rexml/docs/tutorial.html http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html http://www.xml.com/pub/a/2005/11/09/rexml-processing-xml-in-ruby.html http://www.tutorialspoint.com/ruby/ruby_xml_xslt.htm http://www.tutorialspoint.com/ruby/ruby_xml_xslt.htmOther available Ruby XML libraries are(You can also look at); - Chilkat Ruby XML library http://www.chilkatsoft.com/ruby-xml.asp - hpricot XML http://code.whytheluckystiff.net/hpricot/wiki/HpricotXML - libXML http://libxml.rubyforge.org/ Regards, Naren On Sun, Nov 21, 2010 at 6:56 AM, Irfan Ahmed irfan...@gmail.com wrote: HI, To built a rss feed for my project, I need to learn xml or I want to learn how to parse xml with ruby. So, if possible, please provide some tutorial links so that I will be grateful:) -- Thanks, Irfan Ahmed Rizvi http://www.welltreat.us +880 1676 246 991 +880 1723 712 288 -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- ~N a r e n -- 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-t...@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: Gem environment has wrong ruby version
Great, that worked! 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 post to this group, send email to rubyonrails-t...@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.