Displaying 20 results from an estimated 10000 matches similar to: "Rails 3 (beta3) and paths in the console"
2006 Apr 06
2
rails 1.1 - console broken
Have upgraded to rails 1.1 and now ruby script/console does not work.
Throws an error:
c:\work\development\rails\application1>ruby script/console
Loading development environment.
c:/tools/ruby/lib/ruby/1.8/irb/init.rb:151:in `parse_opts'': undefined
method `up
case'' for nil:NilClass (NoMethodError)
from c:/tools/ruby/lib/ruby/1.8/irb/init.rb:19:in `setup''
2008 Oct 30
2
Rails console
I tried to create an addition to Enumerable called choose_randomly
that picks a random element from the Enumerable object. However when I
define it and execute the code rand complains about the wrong number
of arguments. Below is a capture of the ./script/console session.
farrel@nicodemus ~/Work/GreenGreen/Code/green_green_client_application
$ ./script/console
Loading development environment
2006 Mar 30
9
script/console not working after Rails 1.1 upgrade
Whenever I do script/console I get an error message:
Loading development enviroment.
c:/ruby/lib/ruby/1.8/irb/init.rb:151: in ''parse_opts'' : undefined method
''upcase'' for nil:NilClass (NoMethodError)
from c:/ruby/lib/ruby/1.8/irb/init.rb: in ''setup''
from c:/ruby/lib/ruby/1.8/irb/init.rb:54: in ''start''
from c:/ruby/bin/irb:13
2010 Dec 24
0
keep getting "undefined method `map' for nil:NilClass (NoMethodError) " in new server
hi guys,
I have a new development server (ubuntu 10).
I have done the following (the versions match my existing development
machine which works fine):
1. installed ruby 1.9.1p378
2. installed ruby gems 1.3.7
3. installed rails 2.3.8 (used "gem install rails -v 2.3.8")
4. manually installed my other gems including sphinx and thinking
sphinx with "gem install ..."
5. ran
2009 Jul 26
2
How knows my paths in link_to? If I do not defined.
Hello,
It´s my first post here. :)
I´l following the guide of Ruby, but I need to know how the Ruby knows
my path to other pages if I did not define anything, like this:
app/views/posts/index.html.erb:
<td><%= link_to ''Show'', post %></td>
<td><%= link_to ''Edit'', edit_post_path(post) %></td>
Other
2006 Jul 17
3
Extending Ruby classes in Rails
Hi.
I''ve placed the following in lib/mods.rb:
class String
def String.foo
"bar"
end
def bar
"baz"
end
end
But it does not get picked up:
white:~/svn/tagticks morten$ script/console
Loading development environment.
>> String.foo
NoMethodError: undefined method `foo'' for String:Class
from (irb):1
>>
2007 Jul 29
1
Curious why this doesn't work. (has_many, belongs_to)
Two Models.
class Gm < ActiveRecord::Base
belongs_to :pool
# mode code here.
end
class Pool < ActiveRecord::Base
has_many :gms
# mode code here.
end
Testing code through the console.
>> gm_list.each{ | gm | puts " GM name: #{ gm.user_name } belongs to Pool: #{ gm.pool.pool_name } " }; nil
GM name: John belongs to Pool: RHP 07-08 Season - Career League
GM name:
2005 Nov 22
1
Ferret NoMethodError
Using the current ferret gem (on Win-XP):
irb(main):001:0> require ''ferret''
c:/ruby/lib/ruby/1.8/fileutils.rb:950: warning: already initialized constant
OPT_TABLE
=> true
irb(main):002:0> include Ferret
=> Object
irb(main):003:0> index = Index::Index.new
=> #<Ferret::Index::Index:0x3477ba8 @qp=nil, ...>
irb(main):004:0> index << "This is
2010 Apr 27
0
undefined method 'each' in acts_as_taggable_on with rails 3 beta 3 and ruby 1.9
Hi
I am trying to use acts_as_taggable_on in my new projects. But I got
Error when I try to save tags.
undefined method `each'' for "[]":String
NoMethodError: undefined method `each'' for "":String
from C:/Ruby19/lib/ruby/gems/1.9.1/gems/
activerecord-3.0.0.beta3/lib/active_record/associations/
association_collection.rb:347:in `replace''
2006 Dec 01
2
more_like_this not working?
Hi all,
using ferret 0.10.13 and aaf trunk, i cannot get more_like_this to work.
I read other posts on this forum related to that, but that did not solve
it.
I have a model Question with a field question_text. I do:
-----------------------------------------------
>> q = Question.find(:first)
>> q.more_like_this
NoMethodError: You have a nil object when you didn''t expect
2012 Jan 15
1
NoMethodError: undefined method `expect'
Ideas?
ruby-1.9.2-p290 :002 > require ''rspec''
=> true
ruby-1.9.2-p290 :003 > RSpec::Version::STRING
=> "2.8.0"
ruby-1.9.2-p290 :004 > describe ''division by zero'' do
ruby-1.9.2-p290 :005 > expect { 2/0 }.to raise_error
ruby-1.9.2-p290 :006?> end
NoMethodError: undefined method `expect'' for
2009 Sep 10
2
undefined method `get_client_info' for Mysql:Class
after upgraded to Snow Leopard... (32bits arch)
I re-installed the mysql gem (i386 architecture) , all gems and
rails 2.3.4
testing in the console
$ irb
irb(main):001:0> require ''rubygems''
=> true
irb(main):002:0> require ''mysql''
=> true
Mysql.get_client_info
NoMethodError: undefined method `get_client_info'' for Mysql:Class
from
2006 Mar 31
4
Date magic?
Hi.
When I read Dave and Davids excellent book "Agile Web Development with
Rails" the first time, I was particularly impressed with the following
statement:
1.day.from_now
It was used in a test class to set the date of tomorrow dynamically. Since
it was enclosed in in ERb tags, I assumed this was a normal ruby statement,
but when I tried it in my irb, i get the following error:
2006 Jun 05
0
Plugin Namespace Oddities?
Hi all,
I''m trying to throw together an acts_as_copyable, to add the ability to:
@new_ar_object = @ar_object.copy
I''m using the Fox example for the basic loading into AR with a module:
http://wiki.rubyonrails.org/rails/pages/HowToWriteAnActsAsFoxPlugin
so in my instance methods:
module InstanceMethods
def copy( options = {} )
copyable_attributes
2012 Nov 19
0
has_one :through NoMethodError: undefined method `klass' for nil:NilClass when doing class_name on reflection
Not sure if this is expected or not. Only happened with a has_one :through
I had setup. (Workaround is just to remove it and go through the
association manually vs has_one ..., through: .)
Not a big deal if no one has time to look at it, as it''s not a big enough
deal to look into a fix on our side.
In Rails (3.2.9) console if I do:
MyModel.reflections.each {|name,reflection|
2010 Apr 23
3
rails-3.0.0.beta3 install error on ri 'lib' ENOENT
Hi,
I was getting an odd error installing rails-3.0.0.beta3 on a fresh
Ubuntu 10.04 install. The same exact error was occurring on my Ubuntu
9.10 install, so I''m sure it isn''t something specific to the Ubuntu
version (nor beta for that matter).
This is the error:
mike@ubuntu:~/rubygems-1.3.6$ sudo gem1.9.1 install rails --pre
Successfully installed activesupport-3.0.0.beta3
2006 Jul 04
2
has_many working correctly only on reload!
I have this code that is using svn externals with rails EDGE working
fine for the past couple of months. A couple of days ago, this code
died. Even after deleting vendor/rails, this code doesnt work:
class Tag < ActiveRecord::Base
has_many :taggings
has_many :events, :through => :taggings
has_many :users, :through => :taggings
end
class User < ActiveRecord::Base
# Virtual
2009 Sep 16
1
Problems while loading 'spec/stubs/cucumber'
Rodrigo Flores wrote:
> Hi
>
> I''m reading the rspec book and I''m having problems when I require the
> file ''spec/stubs/cucumber''. When I go to an IRB prompt and type
> require ''spec/stubs/cucumber'' after requiring another libraries [1] I
> get the false in ''spec/expectations'' and an error in
>
2008 Jun 06
1
Need help with Decryption using blowfish CBC
Hello all,
Hoping someone can help me out here. I''ve burned almost a week trying
to figure out how to decrypt
an image file that has been encrypted using Blowfish CBC.
I found some code on the net and have modified as follows:
require ''openssl''
require ''digest/sha1''
ivArr = [0x0D,
0x0E,
0x0A,
0x0D,
0x0F,
0x0A,
0x0C,
0x0E
]
2006 May 02
0
YAML failing to de-serialize
I''m seeing this same problem that Josh was seeing back on March 23rd
(see below)
I''ve got the following YAML snippet stored in a text field:
"--- !ruby/object:FieldValue \nattributes: \n item_id: 60\n title:
Test\n field_id: 15\n created_by_id: 5\n locale: en\n link:
www.cclearn.com\n comment: this is a test\n created_at: 2006-05-02
15:43:14.256792 Z\nnew_record: