Ruby 'uuid'.strip NoMethodError (undefined method `strip' for nil:NilClass) - ruby

I am getting this error: NoMethodError (undefined method `strip' for nil:NilClass)
When I call:
`uuidgen`.strip
As I known it should generate an UUID. I would make different, but Rtex uses this to generate the pdf files and I can't change the code. So I think it must be something in my project configuration.
Does anyone have any idea?

As I found here: http://ruby.11.x6.nabble.com/Generating-a-unique-id-td2401970.html
The command between `` means that this is a shell command, then I tryed to execute in prompt: uuidgen and the SO did not recognize the command. After install Microsoft SDK, add uuidgen to the path and restart the enviroment, the command starts to works. I thing uuidgen is not native in Windows anymore.

Related

ruby package loaded but not functional

I've loaded a package in ruby but when I try to execute it, I get an error.
Please help!
Code:
require 'telegram/bot'
token = "REPLACE_WITH_ACTUAL_TOKEN"
Telegram::Bot::Client.run(token) do |bot|
end
Result:
undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)
The error message is pretty self-explanatory:
undefined method `run' for Telegram::Bot::Client:Class (NoMethodError)
The error message is telling you that the method Telegram::Bot::Client::run does not exist, and both the documentation, the README, and the source code seem to agree that there is, indeed, no such method.
Issue here is not that your package is not loaded. But that class method run does not exist. You may want to check whether you have installed the latest version, not something old.
Other than that, I can hardly imagine what could be going on.

gets function is causing an Invalid argument error

I'm having to learn ruby (not rails) due to a device that only runs ruby installed code.
I'm currently using v 1.9.3 on my Windows 10 desktop to study the syntax and I can't run any examples with the gets() function.
example:
name = gets()
without getting the error
test.rb:1:in `gets': Invalid argument - (Errno::EINVAL)
I haven't tried updating the version (Manufacturer's guide, though possible just out of date, listed installing 1.9) but I wouldn't think such a core function would be missing from this version.
puts() works just fine.
Thanks in advance for any direction...

undefined method `reset_all` for nil

F
An error occurred in an `around(:example)` hook
NoMethodError: undefined method `reset_all' for nil:NilClass
occurred at /usr/lib/ruby/vendor_ruby/rspec/mocks.rb:22:in `teardown'
I'm currently trying to run a ruby test suite, but running into issues when calling rspec spec/. I'm getting the above traceback. Any ideas as to what might cause this? I've tried updating rspec to no avail.
Any debugging tips are also appreciated.
Looks like it was simply a matter of an outdated ruby version!

Error when attempting to install ruby 1.9 with pik

I am attempting to install ruby 1.9 using pik.
Here is the error
pik install ruby 1.9 -d
There was an error. Error: private method `gsub' called for
nil:NilClass
in: pik/commands/install_command.rb:24:in `execute' in:
pik_runner:33
The error seems similar to pik Error: private method `gsub' called for nil:NilClass and Error: private method `gsub' called for nil:NilClass with pik install ruby 1.9.3, but I installed jRuby with no problem.
I have seen what seems to be the same error referenced on the pik github page , but it is not solved.
I have also seen a SO answer that said that this is an issue with pik that will not be solved, if this is the case, what is the best way to add the second version of ruby?
So, one of the better answers, is to do so in an environment other than windows. Installing virtualbox and/or vagrant and using ruby from a linux environment is much more often the preferred solution to this.
Alternate to this, basically all you need to do to install another version of ruby is install it to another directory, and when you want to use that version of ruby in windows, alter your path statement so that version of ruby is the one in your path rather than the previously installed version.
When I've had to do this, begrudginly, in windows, I've used a single path in my windows environment, but, instead used NTFS junctions to put the correct folder in the correct location to match the path, and then crafted a batch file to remove and add the correct junction for the specific version of ruby that I wanted running.
Hope this helps.

NameError at / uninitialized constant Sass::SyntaxError

I am using Padrino and when I try to specify my application.sass file I get this error NameError at / uninitialized constant Sass::SyntaxError
I thought I might have something missing, so I checked out the sample_blog application at their GIT to verify my SASS is working correct. It was working correct and the blog app was running fine. Then I decided to change a line in the blog's application.sass and I got this error.
I am using TextMate to edit the file.
Weird indeed, any advices?
Yes, the issue is simple and already fixed in Padrino edge. Basically rename lib/sass.rb to lib/sass_plugin.rb. Check out the issue here: http://github.com/padrino/padrino-framework/issues/closed#issue/94

Resources