Ruby : Cannot load such file --ruby2d (LoadError) - ruby-on-rails

I'm new to Ruby,Writing some code to make a game,so using ruby2d library.
Got an error while writing some basic code.
Help me out Folks.
require 'ruby2d'
set background: "Navy"
show
Image of the error coming up in vscode terminal

After searching for the above problem on various sites,Finally my problem got resolved.
So,All the folks who would come across the same problem.
Here's the Solution
1)https://www.ruby2d.com/learn/linux/#install-packages
{ Do as it is as written in the article for the Linux users
}
2)gem install ruby2d
Yippe, Everything works well! After this.

Related

Unable to use Rails due to unverified SSL certifications

I don't have any experience programming and I'm trying to learn Ruby as my first language.
I followed the instructions at http://installrails.com/, used RailsInstaller, and updated gems. My problem comes when I try to create a new application. My terminal tries to run bundle install and I get a message the SSL certifications could not be verified.
I tried numerous solutions for this problem but they do not work. I went to http://railsapps.github.io/openssl-certificate-verify-failed.html
which told me that one workaround was to save cacerts.pem in my Rails folder and make ruby aware of it. Still didn't work.
Am I doing something wrong or is this a common problem for those on Windows (as a different guide seemed to imply?) Any solution for this?
EDIT: According to this guide, you can obtain the new trust certificate and the guide tells you where to put it. It hasn't solved my issue yet, but it seems to work for some others.
http://guides.rubygems.org/ssl-certificate-update/
I had the same problem on windows10. You can change the default gem source url. In your Gemfile you should add a http url:
source 'http://rubygems.org/'
#source 'https://rubygems.org' - not working on windows10
it helps - but it's rather a workaround, not a solution :)

Ruby on Rails Tutorial Complete Files

I've got lost somewhere along the way with this tutorial (the one at ruby.railstutorial.org), and have an error in my code somewhere. Does anyone have the complete files for the completed application so that I can compare a working version to mine? Thanks!!
you can find the files here on github

acts_as_ferret multi model search not working in rails app

I am trying to solve a strange issue with ferret/acts_as_ferret
Of course I have googled and posted the question:
http://www.ruby-forum.com/topic/188570
Basically aaf works on single models with no issue. It also works on single models using the config/aaf.rb file I have setup. It even works when I do a multi-model search in the console, but within the rails app itself I get:
undefined method `ferret_rank=' for <object that has a match>
If anyone has had the same experience/problem and can shed any light I would appreciate it.
PS: I followed the following tutorial to get where I am now.
http://opensoul.org/2008/4/29/using-shared-indexes-with-acts_as_ferret
Do you have the plugin installed or just the gem? You might want to install the plugin.
I would also try rebuilding the index.
For my purposes, I switched to Solr and life is a lot easier. Sphinx is missing a lot of stuff that I need.

Creating a basic facebook application with Rails

I am creating a simple facebook application using Ruby on rails and I am following the liveRail tutorial available here
http://www.liverail.net/articles/2007/6/29/tutorial-on-developing-a-facebook-platform-application-with-ruby-on-rails
The problem that Im facing is that when I launch my server it throws an error saying that it cant find the 'gem_original_require' : no such file to load facebook_rails_controller_extensions.
I have added the rfacebook gem but the error is thrown when i include the require
require "facebook_rails_controller_extensions" in the environment.rb file.
Im not completely sure whether this is the right way to go with Rails 2 but I've between making changes when i find relevant information for Rails 2
I would appreciate any suggestions on this or any links to other tutorials too.
Thank you
That tutorial is SEVERELY out-of-date and you're going to have lots of issues if you keep following it. rFacebook hasn't be actively maintained in a good 2 years. You should be using Facebooker.
There is a good facebooker tutorial here: http://apps.facebook.com/facebooker_tutorial/
Examine your $LOAD_PATH variable.
It's a common issue that your load path doesn't contain library.
Use $LOAD_PATH<<'/usr/lib/superrubylib' to add a path to load.
Uh, and it seems to be a best practice to use require File.dirname(__FILE__) + "/../relative/path" to set up relative paths.
P.S. Please, specify more data about paths and locations to let us answer your question specifically.

Rails SequencedHash source file

I am testing AlumniOnRails (http://rubyforge.org/frs/?group_id=2959&release_id=17170) which is based on Rails 1.2.6 (I know it's outdated) and managed to get it up, installed the required gems, created and migrated the data and most of the basic alumni functionalities are up but one, the part that is broken seems to be missing a library and yet I can't seem to find it after a few reasonable searches.
The logger shows no such file to load -- collections/sequenced_hash with a line within the controller having the code of require 'collections/sequenced_hash which is quite obvious that the sequence_hash library is missing.
A few searches on Google shows a few references, one with the closest pointer is http://collections.rubyforge.org/classes/SequencedHash.html but unfortuntely the source link is dead. Does anyone keep this kind of old file or point me to somewhere it is? Thank you
Somebody answered this over ruby forum and it works:
gem install collections

Resources