Tag: gem

Gem needs to append column to passed model

I cannot find out how to have my gem append a column to an existing model/table. My gem needs to check the created_at attribute of a model, and based on time passed, set an active column from true to false. I’m assuming that, upon install, it will end up needing a $ rails {gem_name}:install type […]

Best way to categorize products in rails 4 app

So, I’m trying to create a product categorization ‘system’ in my rails 4 app. Here’s what I have so far: class Category < ActiveRecord::Base has_many :products, through: :categorizations has_many :categorizations end class Product < ActiveRecord::Base include ActionView::Helpers has_many :categories, through: :categorizations has_many :categorizations end class Categorization < ActiveRecord::Base belongs_to :category belongs_to :product end Also, what […]

Avatar rails generator

I am trying to find some rails gem or any API delivering some random (non figurative) picture for avatar users, as the one that SO uses. I tried gravatar but when I create some random hash and that I call the api via http://www.gravatar.com/avatar/#{hash}, I always get the same default image (independently of the hash) […]

Updating jekyll using gem

I wanted to try out jekyll on Windows. But unfortunately the machine I was trying did not gave me installation rights. So I decided to go with portable jekyll. I put that repo in my D:\Program Files\jekyll folder. Updated the PATH in System Environment Variables. However this jekyll setup has older gems for sass, jekyll. […]

ERROR: Error installing mysql: ERROR: Failed to build gem native extension

I am a beginner in ruby. when I install MySQL in gem,I got a problem which confused me a long time. I install MySQL from brew, as you know the computer system is OSX 10.10. I have try all solution that can found in stackoverflow,but can’t solve it. such as: 1. Install xcode-tool 2. GEM […]

Voting system to choose between two pictures

I am trying to create a voting picture system on rails 3. What I would like to have happen is have two pictures, and have people on the site vote for which one they like more. I know they have a thumbs_up gem, which creates a voting system quickly. Is there a way to either […]

Rake generate – not working

I am installing redmine1.4 and following these step . I am in 5 step of installation process When I am trying to do rake generate_session_store its saying to install rdoc Please let me know do I really need to create document cant I skip that OR if I need to create docs then how to […]

ResolvTimeout exception while adding a gem source

I am getting a ResolveTimeout exception while adding a gem source. What does that mean? Here’s the result of gem env: RubyGems Environment: – RUBYGEMS VERSION: 2.4.5 – RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [x86_64-darwin14] – INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.2.0 – RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby – EXECUTABLE DIRECTORY: /usr/local/bin – SPEC CACHE DIRECTORY: /Users/NSDont/.gem/specs – SYSTEM CONFIGURATION […]

Using a database within a Ruby gem

I’d like to use a database within a Ruby gem that I’m writing. The gem is meant to be used within Rails applications, and will contain an inverted index of documents passed in from the main Rails app. I’m a bit confused as to how to go about this. Should I hook into the main […]

Is Nokogiri platform specific?

I am using windows 7. I have installed nokogiri gem and checked out the gem specification. In the gemfile, it says nokogiri is platform specific. s.platform = “x86-mingw32” Does it mean that nokogiri can be installed only on windows? Or Am I just getting line in the gemspec just because I am using windows 7?? […]

Ruby is the best programming language in the world - Ruby on Rails.