Trouble installing nodejs gem - ruby-on-rails

I'm having some trouble installing the nodejs gem. I believe my situation is similar to the question posted here, so I followed the instructions and added gem 'nodejs' to the gemfile, but I'm getting the error
Could not find gem 'nodejs (>= 0) ruby' in the gems available on this machine.
Does anyone know how to resolve this issue?

There is actually no nodejs gem in the RubyGems repository.
The error is just echoing that it can't find a gem with that name.
It's actually just an external binary, that as Blender mentioned, can be installed using the recommendations from nodejs.org.

The gem is called node: gem install node

Related

Problem when installing rails on windows?

I am trying to create new demo rails program, as guide in my book as this command
rails new demo
then it gave me this error
https://imgur.com/rUSzO4B
It said that my problem is
Could not find gem sqlite3 <> 1.4 x86-mingw32 in any of the gem sources listed in your Gem file
and I must run
bundle install
to solve it
I ran bundle install , but nothing changed.
I know my question maybe too easy to solve, but I am very stuck with this, could you please give me some ideas?
From the documentation of the bootsnap gem in rails: "This gem works on macOS and Linux." See: https://github.com/Shopify/bootsnap
They seem to have found a workaround here:
How can I properly install bootsnap on windows
Add or change to gem 'bootsnap', '=1.4.1', require: false to your project Gemfile

Ruby on Rails error during installation

I'm trying to install Ruby, I followed the installation guide well, but when I tried to run the server by the command:
ruby bin/rails setup
after I created the controller called blog as described in the instructions, it gave me an error in red and a text in yellow:
Error:
Could not find gem uglifier <>= 1.3.0 in the gems available on the machine.
Yes! I know that this is a Googleable question but all I can get are solutions for people with internet access on their PC.
But unfortunately, my computer doesn't have a working Internet connection. I'm posting this question from my phone. So I'm unable to install uglifier(if that's the required thing to do) through the command prompt. Many thanks.
Please could you check if your Gemfile has the following gem
gem 'uglifier'
If the Gem is not present add it to your Gemfile, if you already have it in your Gemfile please run:
bundle install
After that you should check if the bundler is installing the uglifier gem.
Hope that helps,

Ruby - Install Sinatra gem error on ruby mine

I'm working on a new project in Ruby, which I'm learning, and I need to install Sinatra gem and I'm getting the following error:
"Following gems were not installed: sinatra-sinatra (0.10.1): While
executing gem ... (Gem::UnsatisfiableDependencyError)
Unable to resolve dependency: 'sinatra-sinatra (= 0.10.1)' requires 'rack (>= 1.0)'"
Currently I'm using, RubyMine (Windows). Any help would be appreciated.
Thanks
The problem is not RubyMine, but some other dependency conflict in your app. The gem sinatra-sinatra requires Rack 1.0, there is probably another gem in your Gemfile that requires a greater or different version of the same gem.
Actually, I believe your problem can easily be fixed by using the proper gem. sinatra-sinatra is a very old gem, if you want to use the Sinatra framework the correct gem is sinatra. Update your Gemfile accordingly.
In you machine
gem install sinatra-sinatra
Check you Gemfile
gem 'sinatra-sinatra', '~> 0.10.1'
Delete the Gemfile.lock and bundle its once again.

How can I find out what gem is dependent on termios in my Gemfile?

I have updated all of my gems, including to Rails 3.2.8, prior to a new deployment. However, my application is now broken because something is trying to install gem "termios" version 0.9.4.
Apparently, 0.9.4 does not work on any computer or server I own. There are some newer versions, 0.9.6 specifically, but they are not posted in wherever bundler looks for gems.
There are some version on Github, but they have been mysteriously renamed "ruby-termios". Well, some gem in my Gemfile is not looking for ruby-termios. It's looking for termios. Failure.
How can I find out which gem is trying to install this so I can see if it can be whacked?
Check your Gemfile.lock - it has all the gems and their dependencies listed in it. As long as you've been able to install these gems in the past, you'll be able to tell where that dependency is coming from.
The gem command will dump out the tree of dependencies for you.
$ gem dependency
Or if you want to check just a specific gem.
$ gem dependency foo

Installing gems tutorial

Is there anywhere that there are step by step instructions on how to install gems?
My google-fu is weak and those that I could find did not resolve my error.
My errors are detailed here:
Getting gcal4ruby gem to work
Basically my error sums up as:
gem installs properly and is detectable by,
but whenever I try to reference it in my application it just says:
Could not find 'gcal4ruby (= 0.0.5, runtime)' in any of the gem sources Try running 'bundle install'.
(* I tried bundle install -> no help *)
Your error states:
Could not find 'gcal4ruby (= 0.0.5, runtime)' in any of the gem sources Try running 'bundle install'.
It's looking for 0.0.5 of gcal4ruby, which you don't have installed, rather you're saying yourself that the gem list -d shows:
gcal4ruby (0.5.5)
Which is not the correct version. I would recommend attempting to discover what's trying to require this older version of gcal4ruby. I think it's in your Gemfile, but I have been known to be wrong occasionally.
If this answer doesn't solve your question, then please attach the errors you're getting and your Gemfile to your question.
As a guess, you are using rails 3? Rails 3 uses a project called bundler for dependencies, so instead of installing the gem in your system ruby, add gem 'gcal4ruby to the Gemfile in the root of your app. after that, a bundle install will install the gem locally into your app.
Bundler means that rails 3 apps have their gems completely isolated from the system gems. Even if the gem is installed in the system, it will not be accessible in the app.

Resources