Hi,
Best practice to Override a class method of the gem in rails Application ? . I need to override the behaviour of the find method of a gem.
following is the code in the gem
module Youtube
class display
attr_accessor :base
def find(id, options = {})
detailed = convert_to_number(options.delete(:detailed))
...
Running a Rails application with Fleximage in Ruby 1.8.7 works fine, but in Ruby 1.9 returned error:
/usr/local/lib/ruby/gems/1.9.1/gems/fleximage-1.0.4/lib/fleximage/model.rb:340: [BUG] Segmentation fault
ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.0.0]
-- control frame ----------
c:0060 p:---- s:0295 b:0295 l:000294 d:0...
Is there any way to simulate the absence of a gem for certain unit tests, short of actually uninstalling and then reinstalling the gem during testing?
I am writing a command line utility, and want to make sure that my tests cover cases where a user may not have all of the gems that I support. For instance, I am using fsevents — a Leopar...
I am trying for the first time to install some Ruby gems on Mac OS X Leopard. Please see the command and the output below. My question is how do I install a gem with dependencies? I tried installing individual dependency gems first from a locally downloaded files but I soon found out that there is no end to the rabbit hole :-) I also fou...
I'm trying to use mikel gem mail on my 2.3.5 Rails App
http://github.com/mikel/mail
I have it working like this.
I've made a MailComHelper, made a method like this :
def self.welcome(user,password)
@user = user
m = Mail.new
m.from = '[email protected]'
m.to = @user.email
m.subject = 'welcome'
m.body = 'The body'
m...
I have seen many samples of Ruby code with this line (for example, http://www.sinatrarb.com/). What is purpose of this require?
# require 'rubygems'
require 'sinatra'
get '/hi' do
"Hello world!"
end
In all cases the code works without this line.
...
I have an issue when trying to set up rvm, where gems weren't installing due to them being dependent on json_pure. I tried to install json_pure, but rubygems itself seems to depend on json_pure. I have tried removing all versions of json_pure, but rubygems still complains.
$ sudo gem install json_pure
/Library/Ruby/Site/1.8/rubygems....
Im using the following guide for getting started with rails for ubuntu 9.10.
http://guides.rails.info/getting_started.html
I have installed both ruby and gem.
gokul@gokul-laptop:~$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
gokul@gokul-laptop:~$ gem -v
1.3.6
gokul@gokul-laptop:~$
For rails,
gokul@gokul-laptop:...
After reading through this question about Ruby diff packages, I'm still not sure how to generate a unified diff from two text files. I'm not having trouble reading each file into a string (IO.read()), but I'm not finding any package that can generate a unified diff. Does one exist? Is doing a system call to diff even an option I should c...
I am trying to learn rails and haven't used it in the last few weeks but today when I try to run any rails commands such as
- 'rails -v'
- 'script/server'
I get not have reinstalled ruby but the didn't don't have a clue what could be wrong
Am on a brand new Macbook Pro
Jeremy-Geross-MacBook-Pro:~ Jeremy$ rails -v
/Library/Ruby/Si...
Is there any command either in debugger or ruby-debug to get a list of all gems and/or plugins loaded in memory for a Rails process? I understand only the 'require' gems are loaded but I would like to quickly see what got loaded during runtime.
...
I keep getting an error when trying to install the geoip_city gem. I've already installed the GeoIP C library to /opt/GeoIP, but the gem doesn't seem to pick it up. I've tried:
sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP
sudo gem install geoip_city -- --with-geoip-lib=/opt/GeoIP/lib
sudo gem install geoip_city -- --wi...
I have a Rails program that has 2.2.2 embedded. When I run it I get an error because RubyGems 1.3.6 is not compatible with Rails 2.2.2. I am running rvm and would like to set up an environment to run this program with ruby 1.8.7 and rubygems 1.3.5.
Any help would be greatly appreciated.
Barb
...
I have installed the gem 'simple_uuid' but nothing seems to be working.
Using irb and running the following:
require 'rubygems'
require 'simple_uuid'
is fine, both return true. But running the following:
// Class added by simple_uuid
UUID.new
returns
NameError: uninitialized constant UUID
from (irb):3
from :0
I'm a rub...
I'm having a hard time getting Sinatra running on my local setup, Ubuntu Karmic 9.10. The error getting thrown when I have require 'sinatra' is:
NoMethodError: undefined method `[]' for nil:NilClass
from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:891:in `compile'
from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/...
hello!
i have a user and an admin role in my project. i created my authentification with devise, really nice and goot tool for handling the authentification. in my admin role i don´t have any confirmation or something like that. it is really simple and doesn´t make problems. but in my user model i have following things:
model:
devise ...
Can someone shed light on how to setup by_star gem: https://rubygems.org/gems/by_star?
I ran ruby script/plugin install git://github.com/radar/by_star.git.
However, when I went to call a by_star method in one of my models from console, I got an undefined method error.
Do I need include or require statement? Could I be missing depende...
I am having trouble building a gem. When I run rake it gives the the following error message:
You need to install rspec in your base
app
I'm not completely certain what I should be doing to fix this. I have double checked that rspec is, in fact installed. Any help would be appreciated.
...
This is going to be a really dumb question, I just know it, but I'm going to ask anyways because it's driving me crazy.
How do I get acts-as-taggable-on to work?
I installed it as a gem with gem install acts-as-taggable-on because I can't ever seem to get installing plugins to work, but that's a whole other batch of questions that are ...
I have some troubles with a Ruby gem named Bundler. My OS is Ubuntu 10.04.
My environment is as follows:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.9.1 (2010-01-10 patchlevel 378) [i486-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby1.9.1/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXEC...