ruby-1.9.3

Error installing ruby 1.9.3

家住魔仙堡 提交于 2019-11-29 15:41:50
问题 I'm trying to install Ruby 1.9.3 using rvm. However, when I type: rvm install 1.9.3 I get the following error: ERROR: Error running 'make ', please read /Users/nick/.rvm/log/ruby-1.9.3-rc1/make.log ERROR: There has been an error while running make. Halting the installation. I'm running Mac OS X Lion and my current version of Ruby is 1.9.2. Edit: make.log: make[1]: Entering directory `/Users/nick/.rvm/src/ruby-1.9.3/ext/readline' /usr/bin/gcc-4.2 -I. -I../../.ext/include/x86_64-darwin11.0.0 -I

“bad ecpoint” SSL error on fresh RVM Ruby 1.9.3 install on OSX Mountain Lion

核能气质少年 提交于 2019-11-29 12:48:21
Trying to use Ruby 1.9.3 & rest-client to make https requests like: RestClient.get('https://google.com') always gives me a SSL error, OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server key exchange B: bad ecpoint which I cannot figure out. bad ecpoint ? I've had no trouble making the same request with 1.9.3 & rest-client on another Mountain Lion machine. Notes about this machine: MacBook pro with fresh Mountain Lion install, where I originally had some trouble installing gcc-4.2 via the XCode command line tools, but eventually got gcc-4.2 via homebrew/dupes . I've

gem install pg can not bind to libpq

时光总嘲笑我的痴心妄想 提交于 2019-11-28 18:19:18
After upgrading to Ruby 1.9.3 (from 1.9.2 using system RVM) on Ubuntu 10.04.3, I removed all of my gems, and attempted to reinstall pg (ala bundle install pg ). It then threw an error and informed me that I should look at mkmf.log, both of which are included in this gist: https://gist.github.com/d05a81701d968895c730 libpq-dev, libpq5, and postgresql-client are all installed and working correctly. Pointing gem at pg_config, and the include and bin directories directly does not appear to change anything. I've seen several questions about similar error messages around stackoverflow, and the rest

Convert a string to regular expression ruby

吃可爱长大的小学妹 提交于 2019-11-28 16:35:36
问题 I need to convert string like "/[\w\s]+/" to regular expression. "/[\w\s]+/" => /[\w\s]+/ I tried using different Regexp methods like: Regexp.new("/[\w\s]+/") => /\/[w ]+\// , similarly Regexp.compile and Regexp.escape . But none of them returns as I expected. Further more I tried removing backslashes: Regexp.new("[\w\s]+") => /[w ]+/ But not have a luck. Then I tried to do it simple: str = "[\w\s]+" => "[w ]+" It escapes. Now how could string remains as it is and convert to a regexp object?

Error installing debugger-linecache in Ruby 1.9.3

≯℡__Kan透↙ 提交于 2019-11-28 14:01:08
问题 I need version 1.0.1 of debugger-linecache for a project, and I am facing the following error when trying to install. trunk ☺ gem install debugger-linecache -v '1.0.1' Building native extensions. This could take a while... ERROR: Error installing debugger-linecache: ERROR: Failed to build gem native extension. /Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no Makefile creation failed **********************************

Error on terminal start

让人想犯罪 __ 提交于 2019-11-28 09:59:33
-bash: /etc/profile.d/rvm.sh: No such file or directory -bash: /Users/janekambani/.bash_profile: line 1: conditional binary operator expected -bash: /Users/janekambani/.bash_profile: line 1: syntax error near `"$HOME/.rvm/scripts/rvm"' -bash: /Users/janekambani/.bash_profile: line 1: `[[ -s "$HOME/.rvm/scripts/rvm"]] && . "$HOME/.rvm/scripts/rvm" ' I tried this: sudo rm -rf /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm $HOME/.rvm $HOME/.rvmrc but i still kept getting the same error. im using OS X 10.8 Homan Take a look at the source of /etc/profile. On 10.8 of Mac OS,

“bad ecpoint” SSL error on fresh RVM Ruby 1.9.3 install on OSX Mountain Lion

早过忘川 提交于 2019-11-28 06:26:02
问题 Trying to use Ruby 1.9.3 & rest-client to make https requests like: RestClient.get('https://google.com') always gives me a SSL error, OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server key exchange B: bad ecpoint which I cannot figure out. bad ecpoint ? I've had no trouble making the same request with 1.9.3 & rest-client on another Mountain Lion machine. Notes about this machine: MacBook pro with fresh Mountain Lion install, where I originally had some trouble

How the Anchor \z and \G works in Ruby?

送分小仙女□ 提交于 2019-11-28 04:58:52
问题 I am using Ruby1.9.3. I am newbie to this platform. From the doc I just got familiared with two anchor which are \z and \G . Now I little bit played with \z to see how it works, as the definition( End or End of String ) made me confused, I can't understand what it meant say - by End . So I tried the below small snippets. But still unable to catch. CODE irb(main):011:0> str = "Hit him on the head me 2\n" + "Hit him on the head wit> => "Hit him on the head me 2\nHit him on the head with a 24\n"

Ruby on Rails “invalid byte sequence in UTF-8” due to bot

北战南征 提交于 2019-11-28 04:04:50
I have some errors triggered by a chinese bot: http://www.easou.com/search/spider.html when it scrolls my websites. Versions of my applications are all with Ruby 1.9.3 and Rails 3.2.X Here a stacktrace : An ArgumentError occurred in listings#show: invalid byte sequence in UTF-8 rack (1.4.5) lib/rack/utils.rb:104:in `normalize_params' ------------------------------- Request: ------------------------------- * URL : http://www.my-website.com * IP address: X.X.X.X * Parameters: {"action"=>"show", "controller"=>"listings", "id"=>"location-t7-villeurbanne--58"} * Rails root: /.../releases

How to cleanly initialize attributes in Ruby with new?

蓝咒 提交于 2019-11-27 23:26:57
class Foo attr_accessor :name, :age, :email, :gender, :height def initalize params @name = params[:name] @age = params[:age] @email = params[:email] . . . end This seems like a silly way of doing it. What is a better/more idiomatic way of initalizing objects in Ruby? Ruby 1.9.3 Zach Kemp def initialize(params) params.each do |key, value| instance_variable_set("@#{key}", value) end end You can just iterate over the keys and invoke the setters. I prefer this, because it will catch if you pass an invalid key. class Foo attr_accessor :name, :age, :email, :gender, :height def initialize params = {}