How to make the ruby version match the gemfile

My Ruby on Rails server is failing to execute because of an error that says my ruby version is 2.3.3 but my gemfile is 2.3.1. How do I fix it ?

Ruby metaclass confusion

I understand that all classes in ruby are instances of metaclass Class. And that “regular” objects are instances of these classes (the instances of metaclass Class). But I keep wondering, I mean classes are root of objects, classes are themselves instances of Class (called metaclass because its instances are classes). I saw in some blogs […]

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 […]

Error Installing alpr for ios

I am installing openalpr from for my ios app. I have already installed all the required gems but when i run bundle exec ./bin/build_frameworks.rb i get the following errors bundler: failed to load command: ./bin/build_frameworks.rb (./bin/build_frameworks.rb) RuntimeError: Child returned: pid 18891 exit 1 /Users/abdulsamad/Documents/Projects/iOS/licence-plate/openalpr-ios-master/lib/alpr/utils.rb:44:in `execute’ /Users/abdulsamad/Documents/Projects/iOS/licence-plate/openalpr-ios-master/lib/alpr/utils.rb:50:in `qexec’ /Users/abdulsamad/Documents/Projects/iOS/licence-plate/openalpr-ios-master/lib/alpr/package/automake.rb:37:in `<class:Automake>’ /Users/abdulsamad/Documents/Projects/iOS/licence-plate/openalpr-ios-master/lib/alpr/package/automake.rb:27:in `<module:Package>’ /Users/abdulsamad/Documents/Projects/iOS/licence-plate/openalpr-ios-master/lib/alpr/package/automake.rb:26:in `<top (required)>’ […]

How do I implement acts_as_follower in comments?

Some assistance here gurus: I want to implement acts_as_follower gem for my comment. The comment belongs to post and post has many comments. I have made the comment followable by users.. And these are the Prefix verb, URI Pattern and Controller#action from rake routes below: post_comment_follows POST /post/:post_id/comment/:comment_id/follows(.:format) follows_comments#create post_comment_follow DELETE /posts/:cjob_id/comments/:comment_id/follows/:id(.:format) follows_comments#destroy My question […]

What does 'Monkey Patching' exactly Mean in Ruby?

According to Wikipedia, a monkey patch is: a way to extend or modify the runtime code of dynamic languages […] without altering the original source code. The following statement from the same entry confused me: In Ruby, the term monkey patch was misunderstood to mean any dynamic modification to a class and is often used […]

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 […]

How to get argument names using reflection

I would like to do some fairly heavy-duty reflection in Ruby. I want to create a function that returns the names of the arguments of various calling functions higher up the call stack (just one higher would be enough but why stop there?). I could use Kernel.caller, go to the file and parse the argument […]

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