ruby-1.9.2

Make error installing Ruby 1.9.2 via rvm OSX Lion 10.7.2 XCode 4.2

穿精又带淫゛_ 提交于 2019-12-02 04:25:39
问题 I'm getting the following error when trying to install 1.9.2 with rvm /Users/craigspaeth/.rvm/scripts/functions/utility: line 152: date: command not found Installing yaml to /Users/craigspaeth/.rvm/usr /Users/craigspaeth/.rvm/scripts/functions/utility: line 152: date: command not found ERROR: Error running 'make install', please read /Users/craigspaeth/.rvm/log/ruby-1.9.2-p290/yaml/make.install.log And here is the yaml/configure.log [] make install Making install in include make[2]: Nothing

What zip library works well with Ruby 1.9.2?

℡╲_俬逩灬. 提交于 2019-12-02 00:47:26
I used the rubyzip gem in Ruby 1.8.7 before, but I heard rubyzip doesn't work well with ruby 1.9.2. What zip libraries work well with Ruby 1.9.2? Have you actually tried using rubyzip with 1.9.2? Seems to work fine for me: >> RUBY_VERSION #=> "1.9.2" >> require 'zip/zip' #=> true >> Zip::ZipFile.foreach(File.expand_path("~/Downloads/Archive.zip")) { |f| p f } #=> [bartxt, footxt] bar.txt foo.txt I used rubyzip gem in Ruby 1.8.7 also. For Ruby 1.9.x you need to use version 0.9.5 or higher. Works without any problems. I found zip it says it's compatible with 1.9.1 I don't think it would have any

Parsing URIs that have curly braces, URI::InvalidURIError: bad URI(is not URI?)

假装没事ソ 提交于 2019-12-01 09:30:39
Using ruby 1.9.2-p290. I came across an issue trying to parse a URI like the following: require 'uri' my_uri = "http://www.anyserver.com/getdata?anyparameter={330C-B5A2}" the_uri = URI.parse(my_uri) issuing the following error: URI::InvalidURIError: bad URI(is not URI?) I require a different solution than encoding the curly braces every time like this: new_uri = URI.encode("http://www.anyserver.com/getdata?anyparameter={330C-B5A2}") => "http://www.anyserver.com/getdata?anyparameter=%7B330C-B5A2%7D" Now I can parse the new_uri as usual, but had to do this every time I needed it. What is the

Parsing URIs that have curly braces, URI::InvalidURIError: bad URI(is not URI?)

房东的猫 提交于 2019-12-01 07:56:57
问题 Using ruby 1.9.2-p290. I came across an issue trying to parse a URI like the following: require 'uri' my_uri = "http://www.anyserver.com/getdata?anyparameter={330C-B5A2}" the_uri = URI.parse(my_uri) issuing the following error: URI::InvalidURIError: bad URI(is not URI?) I require a different solution than encoding the curly braces every time like this: new_uri = URI.encode("http://www.anyserver.com/getdata?anyparameter={330C-B5A2}") => "http://www.anyserver.com/getdata?anyparameter=%7B330C

javascript runtime in rails 3.1.0 and ruby 1.9.2. cant deal with with heroku. Did everything, but still does not working

拈花ヽ惹草 提交于 2019-12-01 06:20:30
Please help, it's my studying project. It work locally but not online: Hello, it is said that i dont need special gems like "therubyracer" in rails 3.1.0 but it writes in "heroku logs": 2011-10-04T23:15:30+00:00 app[web.1]: ActionView::Template::Error (Could not fin d a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. 2011-10-04T23:15:30+00:00 app[web.1]: (in /app/app/assets/javascripts/rails.js )):.... i was trying to install "therubyracer" but i have error with installing it C:\proj\lagp>gem install therubyracer Temporarily enhancing PATH to

(Object doesn't support #inspect)

假如想象 提交于 2019-12-01 02:09:02
问题 I have a simple case, involving two model classes: class Game < ActiveRecord::Base has_many :snapshots def initialize(params={}) # ... end end class Snapshot < ActiveRecord::Base belongs_to :game def initialize(params={}) # ... end end with these migrations: class CreateGames < ActiveRecord::Migration def change create_table :games do |t| t.string :name t.string :difficulty t.string :status t.timestamps end end end class CreateSnapshots < ActiveRecord::Migration def change create_table

Addition error with ruby-1.9.2 [duplicate]

别说谁变了你拦得住时间么 提交于 2019-11-30 20:16:21
This question already has an answer here: ruby: converting from float to integer in ruby produces strange results 3 answers When I add 0.1+0.2 I am getting 0.30000000000000004 but when I add the same number in ruby 1.8.7 I am getting the correct answer 0.3 . I get 0.3 by rounding but I just want to get 0.3 on ruby 1.9.2 by adding 0.1 and 0.2 You need bigdecimal for this to make work. (BigDecimal('0.1') + BigDecimal("0.2")).to_f See below link: http://redmine.ruby-lang.org/issues/4394 Your old ruby lied to you: $ ruby -v ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux] $ irb irb(main):001

collection_select method gives error in Rails 3.1.1

南笙酒味 提交于 2019-11-30 08:21:59
问题 I have a Model called Category and other Model Product. They have has_many and belongs_to relation. But code in my view <p><%= f.collection_select(:product, :category_id, Category.all, :id, :name)%> is giving me undefined method `merge' for :name:Symbol Any clue what is wrong with it? 回答1: Chances are you have something like this: <%= form_for @product do |f| %> Because f is already tied to product , you don't need to include it as your first argument, so it should just be: <%= f.collection

How to create ActiveRecord tableless Model in Rails 3

泪湿孤枕 提交于 2019-11-30 06:50:06
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 = nil, null = true) columns << ActiveRecord::ConnectionAdapters::Column.new( name.to_s, default, sql_type.to_s, null ) end column :name, :text column :exception, :text serialize :exception end When creating the new object in controller @user = User.new I am getting the error Mysql2::Error: Table 'Sampledb.users' doesn't exist: SHOW FIELDS FROM users class

Using SOAP and other Standard Libraries in Ruby 1.9.2

ぐ巨炮叔叔 提交于 2019-11-30 05:49:09
So, I recently upgraded to 1.9.2 Ruby, having used 1.8.7 for forever (I wanted to try out Rails 3). The BIGGEST problem I'm having is that none of my SOAP require statements are working...I have things like: require 'soap/rpc/driver' require 'xsd/qname' require 'soap/wsdlDriver' require 'ftools' Even ftools isn't working, but I THINK (look at the Ruby source) that this became 'fileutils'? But I don't see anything similar for SOAP.....has it just been removed? If so...what should I do? Is there any plug ins that do essentially the same thing? My code is like: require 'soap/wsdlDriver' def send