ruby-1.9.2

DBI::InterfaceError: Could not load driver (uninitialized constant MysqlError)

拟墨画扇 提交于 2019-12-21 04:59:24
问题 I have included gems, dbd-mysql (0.4.4) dbi (0.4.5) mysql (2.8.1) on rails console when I run the following code, require 'rubygems' require "dbi" require 'dbd-mysql' dbh = DBI.connect("DBI:Mysql:TestDB:localhost","username", "pwd") 1.9.2-p180 :001 > require 'rubygems' => false 1.9.2-p180 :002 > require "dbi" => false 1.9.2p180 :003 > require 'dbd-mysql' LoadError: no such file to load -- dbd-mysql from /.rvm/gems/ruby-1.9.2-p180@rails3/gems/dbi-0.4.5/lib/dbi.rb:318:in `rescue in load_driver'

Can't install therubyracer, error

痞子三分冷 提交于 2019-12-20 04:14:10
问题 I am trying to instal therubyracer/ therubyracer-heroku to my app, cause it doesn't work in heroku server cause I don't have javascript runtime enviroment. When I am trying to install these gems it writes: Installing therubyracer-heroku (0.8.1.pre3) with native extensions C:/RailsInsta ller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::I nstaller::ExtensionBuildError) C:/RailsInstaller

Rails 3.1, memory leak for missing local partial variables (Ruby 1.9.2-p290)

南楼画角 提交于 2019-12-20 03:34:37
问题 If I render a partial like so: = render :partial => "event_news_item", :object => event, :variable => true And then reference variable in the partial a memory leak is triggered. It seems rails goes into a recursion. I have to then quickly restart my server before memory usage spirals out of control. Anyone knows why the memory leak is triggered here? Can anyone confirm this on their machine? If I do = render :partial => "event_news_item", :object => event An error is raised correctly when

Rails 3.1, memory leak for missing local partial variables (Ruby 1.9.2-p290)

你说的曾经没有我的故事 提交于 2019-12-20 03:34:14
问题 If I render a partial like so: = render :partial => "event_news_item", :object => event, :variable => true And then reference variable in the partial a memory leak is triggered. It seems rails goes into a recursion. I have to then quickly restart my server before memory usage spirals out of control. Anyone knows why the memory leak is triggered here? Can anyone confirm this on their machine? If I do = render :partial => "event_news_item", :object => event An error is raised correctly when

Addition error with ruby-1.9.2 [duplicate]

我只是一个虾纸丫 提交于 2019-12-19 02:46:09
问题 This question already has answers here : ruby: converting from float to integer in ruby produces strange results (3 answers) Closed last year . 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 回答1: You need bigdecimal for this to make work. (BigDecimal('0.1') + BigDecimal("0.2")).to_f See below link: http://redmine.ruby-lang

running into issues with RVM during Ruby install (1.9.2)

你。 提交于 2019-12-18 17:24:10
问题 I'm trying to install ruby via RVM and am getting the following error and the logs are not really clear as to what's going on, has anyone run into this? I seem to recall that Ruby should not be installed as root but I'm a bit suspicious of the permissions error that I'm getting. **Installing Ruby from source to: /Users/mark/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)... ruby-1.9.2-p290 - #fetching ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a

How to create ActiveRecord tableless Model in Rails 3

北慕城南 提交于 2019-12-18 12:15:22
问题 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

Using SOAP and other Standard Libraries in Ruby 1.9.2

半腔热情 提交于 2019-12-18 12:02:53
问题 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

RVM - can not install gem thrift on Ubuntu 11.10

…衆ロ難τιáo~ 提交于 2019-12-13 04:04:20
问题 I use Ubuntu 11.10 and ruby 1.9.2 I can not install thrift gem on my machine $ gem install thrift --no-ri --no-rdoc Building native extensions. This could take a while... ERROR: Error installing thrift: ERROR: Failed to build gem native extension. /home/sayuj/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for strlcpy() in string.h... no creating Makefile make gcc -I. -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/home/sayuj/.rvm/rubies/ruby-1.9.2-p290

Resque: one worker per queue

最后都变了- 提交于 2019-12-12 07:58:01
问题 I currently have a Rails 3.0 project, with Ruby 1.9.2 and Resque. My application has multiple worker classes and multiple queues, that are dynamically created (during runtime). Also, there are multiple workers started that are free to work on any queues, because at start time there isn't any existing queues, and they cannot be predicted: $ COUNT=3 QUEUE=* rake resque:workers Queues a created based on the project 's id: @queue = "project_#{project.id}".to_sym For a given queue, their jobs have