Questions tagged [ruby-1.9.2]

For issues relating to developing in Ruby, version 1.9.2. If your question applies to Ruby in general, use the tag [tag:ruby].

Related tags

234 questions
108
votes
8 answers

Get list of a class' instance methods

I have a class: class TestClass def method1 end def method2 end def method3 end end How can I get a list of my methods in this class (method1, method2, method3)?
Vladimir Tsukanov
  • 4,269
  • 8
  • 28
  • 34
89
votes
15 answers

Invalid gemspec because of the date format in specification

When I include a gem that I made, thanks to Bundler (version 1.0.12), in a Gemfile and then I try to bundle or to rake just like that: $ rake I've got this error message: Invalid gemspec in…
Zag zag..
  • 6,041
  • 6
  • 27
  • 36
55
votes
4 answers

How to set default Ruby version with RVM?

Ubuntu 11. I do the following: $ rvm --default use 1.9.2 and I get: Using /home/md/.rvm/gems/ruby-1.9.2-p180 so that is good. but when I now open a new terminal window I still get: $ ruby -v ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
51
votes
3 answers

Thread Safety: Class Variables in Ruby

Performing writes/reads on class variables in Ruby is not thread safe. Performing writes/reads on instance variables appears to be thread safe. That said, is it thread safe to perform write/reads on instance variables of a class or metaclass…
30
votes
7 answers

Neither ruby and nor irb can load .rb file in current directory

I'm having a really noob problem with importing files in Ruby. I'm making a Ruby app in Windows XP. All the class files for the app are in "C:/Documents/Prgm/Surveyor_Ruby/lib". But when I require a file in another file, neither ruby nor irb can…
Bad Request
  • 3,990
  • 5
  • 33
  • 37
25
votes
1 answer

Ruby zerofill a string

Formating an Integer to be filled with zeros is easy in Ruby: sprintf( "%010d", 345 ) #=> "0000000345" But when I try to fill a String with zeros I can't find an easy solution: sprintf( "%010d", "12AD" ) #=> ArgumentError: invalid value for…
fguillen
  • 36,125
  • 23
  • 149
  • 210
23
votes
2 answers

load works on local path, require doesn't

loadee.rb puts '> This is the second file.' loaddemo.rb puts 'This is the first (master) program file.' load 'loadee.rb' puts 'And back again to the first file.' When I run "ruby loaddemo.rb", This works fine. Both files are in the same directory,…
Benjamin Lindley
  • 101,917
  • 9
  • 204
  • 274
20
votes
8 answers

Installing linecache19 for Ruby 1.9.2 via rvm

I am having a problem with installing linecache19(dependency of ruby-debug19) for ruby 1.9.2 Here is my term output $ rvm use 1.9.2 Using /home/bogdan/.rvm/gems/ruby-1.9.2-p180 $ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] $…
Bogdan Gusiev
  • 8,027
  • 16
  • 61
  • 81
18
votes
6 answers

How to set SameSite attribute to 'None; Secure' in Rails3.1.12 and Ruby1.9.3

A cookie associated with a cross-site resource at https://example.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set with SameSite=None and Secure. You can…
17
votes
7 answers

How to create ActiveRecord tableless Model in Rails 3

I am trying to create a Active Record tableless Model. My user.rb looks like this class User < ActiveRecord::Base class_inheritable_accessor :columns def self.columns @columns ||= []; end def self.column(name, sql_type = nil, default…
Achaius
  • 5,904
  • 21
  • 65
  • 122
17
votes
4 answers

Error installing debugger-linecache: ERROR: Failed to build gem native extension

I am trying to bundle install but it is showing the above error or debugger..Please find the detailed error from the terminal Installing debugger-linecache (1.1.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build…
rubyist
  • 3,074
  • 8
  • 37
  • 69
16
votes
1 answer

Getting Started with MiniTest and Rails

I want to switch an existing rails application from rspec to minitest starting with the models. Therefore I created a folder test. Inside there I created a file named minitest_helper.rb with the following content: require…
moonglum
  • 801
  • 5
  • 13
16
votes
1 answer

What will the major/minor differences be between ruby 1.9.2 and ruby 2.0?

I've been told that ruby 1.9.2 is ruby 2.0 but ruby 1.9.3 is slated to be released in the near future and it will contain some performance enhancements. So what are they planning for 2.0? Will it be much different than ruby 1.9.x?
aarona
  • 35,986
  • 41
  • 138
  • 186
15
votes
1 answer

Make Ruby 1.9 regard all source files to be UTF-8 encoded. (Even if recompiling the interpreter is necessary)

I want to port a rails app from Ruby 1.8.7 to 1.9.2. Some of the files contain umlauts like ä/ö/ü both within strings and comments. The files were saved as UTF-8 but without a BOM (byte order mark) at the beginning. As you might know, Ruby 1.9…
Malte
  • 1,200
  • 10
  • 18
15
votes
2 answers

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT)

I am using Ruby 1.9.2, Rails 3.0.4/3.0.5 and Phusion Passenger 3.0.3/3.0.4. My templates are written in HAML and I am using the MySQL2 gem. I have a controller action that when passed a parameter that has a special character, like an umlaut, gives…
Pan Thomakos
  • 34,082
  • 9
  • 88
  • 85
1
2 3
15 16