ruby-1.9.3

Bundler could not find compatible versions for gem, updating Rails app

醉酒当歌 提交于 2019-12-03 01:50:41
After createing a brand new rails app Following the official rails blog post , attempting to convert apps to rails 3.2.0.rc2 yields the following Updated Gemfile to depend on rails ~> 3.2.0.rc2 gem 'rails', '~>3.2.0.rc2' Updated Gemfile to depend on sass-rails ~> 3.2.3 gem 'sass-rails', '~> 3.2.3' $ bundle install Fetching source index for http://rubygems.org/ Bundler could not find compatible versions for gem "activesupport": In snapshot (Gemfile.lock): activesupport (3.1.1) In Gemfile: rails (~> 3.2.0.rc2) ruby depends on activesupport (= 3.2.0.rc2) ruby Running `bundle update` will rebuild

Is it possible to run my Rails app on Heroku with Ruby 1.9.3? If so, how?

纵饮孤独 提交于 2019-12-02 20:58:51
I tried this tip: https://github.com/thoughtbot/laptop/pull/14#issuecomment-3192270 . On deploy I see -----> Using RUBY_VERSION: ruby-1.9.3-p0 But my logs show the environment variable is not respected INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] Hacky / experimental solutions accepted! Edit: I am on the cedar stack. Here's an update for everyone referencing this question... Heroku now allows you to specify your ruby version in your Gemfile, thanks to their addition to the latest version of bundler. First run: gem install bundler --pre then add ruby '1.9.3' to your Gemfile as such. source 'http

Mac Automator (OS 10.7) not reading Ruby 1.9.3?

痞子三分冷 提交于 2019-12-02 18:52:00
问题 I have some Ruby code in a .rb file that I am trying to run with Automator as opposed to the Command Line. Here is a sample of the code (filename is "filelines_revise.rb"): lines = IO.readlines('filelines_before_CAP.txt').map do |line| array = line.split.each { |i| i.capitalize! } if array.include?("Ws") array.delete("Ws") array[-1,0] = "Ws" end if array.include?("Es") array.delete("Es") array[-1,0] = "Es" end array_2 = array.join(" ") array_2.gsub(/ Ws /, ", west side") .gsub(/ ES /, ", east

ActiveRecord objects in hashes aren't garbage collected — a bug or a sort of caching feature?

喜夏-厌秋 提交于 2019-12-02 16:38:19
I have a simple ActiveRecord model called Student with 100 records in the table. I do the following in a rails console session: ObjectSpace.each_object(ActiveRecord::Base).count # => 0 x = Student.all ObjectSpace.each_object(ActiveRecord::Base).count # => 100 x = nil GC.start ObjectSpace.each_object(ActiveRecord::Base).count # => 0 # Good! Now I do the following: ObjectSpace.each_object(ActiveRecord::Base).count # => 0 x = Student.all.group_by(&:last_name) ObjectSpace.each_object(ActiveRecord::Base).count # => 100 x = nil GC.start ObjectSpace.each_object(ActiveRecord::Base).count # => 100 #

Cannot install Ruby 1.9.3 on a clean Lion Install

风格不统一 提交于 2019-12-02 03:39:31
Trying to install 1.9.3 using RVM. Getting these errors in my make.log compiling readline.c readline.c:1499:9: error: use of undeclared identifier 'username_completion_function'; did you mean 'rl_username_completion_function'? rl_username_completion_function); ^ readline.c:69:42: note: expanded from macro 'rl_username_completion_function' # define rl_username_completion_function username_completion_function ^ /usr/local/include/readline/readline.h:443:14: note: 'rl_username_completion_function' declared here extern char *rl_username_completion_function PARAMS((const char *, int)); ^ 1 error

Ruby 1.9.3 Teeny Version

你说的曾经没有我的故事 提交于 2019-12-02 01:16:52
问题 When using RBConfig to determine my ruby version, I get the "wrong" teeny version when using ruby 1.9.3: # ruby -v ruby 1.9.3p286 (2012-10-12 revision 37165) [i686-linux] # ruby -rrbconfig -e 'puts RbConfig::CONFIG.fetch(%q(MAJOR))' 1 # ruby -rrbconfig -e 'puts RbConfig::CONFIG.fetch(%q(MINOR))' 9 # ruby -rrbconfig -e 'puts RbConfig::CONFIG.fetch(%q(TEENY))' 1 Using Ruby 1.8.7 - this works fine: $ ruby -v ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux] $ ruby -rrbconfig -e 'puts Config:

Ruby 1.9.3 Teeny Version

早过忘川 提交于 2019-12-01 22:18:58
When using RBConfig to determine my ruby version, I get the "wrong" teeny version when using ruby 1.9.3: # ruby -v ruby 1.9.3p286 (2012-10-12 revision 37165) [i686-linux] # ruby -rrbconfig -e 'puts RbConfig::CONFIG.fetch(%q(MAJOR))' 1 # ruby -rrbconfig -e 'puts RbConfig::CONFIG.fetch(%q(MINOR))' 9 # ruby -rrbconfig -e 'puts RbConfig::CONFIG.fetch(%q(TEENY))' 1 Using Ruby 1.8.7 - this works fine: $ ruby -v ruby 1.8.7 (2012-06-29 patchlevel 370) [x86_64-linux] $ ruby -rrbconfig -e 'puts Config::CONFIG.fetch(%q(MAJOR))' 1 $ ruby -rrbconfig -e 'puts Config::CONFIG.fetch(%q(MINOR))' 8 $ ruby

Rails/Rack: “ArgumentError: invalid %-encoding” for POST data

扶醉桌前 提交于 2019-11-30 18:43:34
Our ruby on rails site has a URI that one of our partners POSTs XML data to. Since we don't want to deal with XML, we literally just stuff the raw data into a database column and don't go any further with processing it. However, one of the posts we received gave us this error in airbrake: ArgumentError: invalid %-encoding ("http://ns.hr-xml.org/2004-08-02" userId="" password=""><BackgroundReportPackage type="report"> <ProviderReferenceId>.... With backtrace: vendor/ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:898:in `decode_www_form_component' vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/utils

Rails/Rack: “ArgumentError: invalid %-encoding” for POST data

不打扰是莪最后的温柔 提交于 2019-11-30 16:52:52
问题 Our ruby on rails site has a URI that one of our partners POSTs XML data to. Since we don't want to deal with XML, we literally just stuff the raw data into a database column and don't go any further with processing it. However, one of the posts we received gave us this error in airbrake: ArgumentError: invalid %-encoding ("http://ns.hr-xml.org/2004-08-02" userId="" password=""><BackgroundReportPackage type="report"> <ProviderReferenceId>.... With backtrace: vendor/ruby-1.9.3/lib/ruby/1.9.1

What are the differences between lazy, greedy and possessive quantifiers?

爷,独闯天下 提交于 2019-11-30 15:14:30
How do the following quantifiers differ - with respect of scenarios, speed, etc. ? , ?? and ?+ all match 0 or 1 times . * , *? and *+` all match 0 or more times . + , +? and ++ all match 1 or more times . ? , * and + are greedy . ?? , *? and +? are reluctant/lazy . ?+ , *+ and ++ are possessive . Can anyone help me to understand what these terms mean? Why are there three variations of each quantifier for the same job? Take the string aaaab and see how the following regexes match it: Regex Submatches group 1 group 2 group3 (a?)(a*)(ab) a aa ab (a??)(a*)(ab) aaa ab (a?+)(a*)(ab) a aa ab (a*)(a?)