I am using selenium webdriver with Ruby. I have two versions of Ruby installed *(Ruby 1.9.3 and 2.0). I have been getting this error:
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'.
I am thinking if I somehow call Ruby version 1.9.3 in my scripts this error can be avoided. Can someone tell me how to do that? Will this solve the issue?
Related
I just upgraded by ruby to 2.7.0.
And I tried to install the ibm_db gem in windows platform. Installation works fine. When I try to use the gem(like require 'ibm_db') I get the following error
LoadError (126: The specified module could not be found. - C:/Ruby27/lib/ruby/gems/2.7.0/gems/ibm_db-5.1.0-x86-mingw32/lib/mswin32/rb2x/i386/ibm_db.so)
I have faced this type of error in ruby 2.6 also but when I have set RUBY_DLL_PATH to the ddl which the gem uses it is solved.
But in ruby 2.7 even after setting this variable I get the following error.
Can anyone please help in solving this? ( I have one more doubt:- c gems are supported in ruby 2.7)
It appears that the ibm_db gem currently does not support Ruby 2.7 yet. The newest Ruby version they support is Ruby 2.6.x.
There is a pull request at https://github.com/ibmdb/ruby-ibmdb/pull/105 which might add support for Ruby 2.7 though.
The issue is because the binary was pointed to ruby 2.6 binary. So replace it with the latest ruby 2.7 binary and then everything works fine.
Thanks,
Akhil
My RubyGems isn't working, throwing an error which goes as follows, triggering (nearly) on any Gem task:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:1081:in `<top (required)>': uninitialized constant Gem::GEM_PRELUDE_SUCKAGE (NameError)
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
I'm new to Ruby / RubyGems / installing Ruby and all I know is that an uninitialized constant is essentially a undefined variable. It could also be possible that it's something with Ruby itself, although the ->Gem:GEM<-_PRELUDE_SUCKAGE points me to RubyGems.
In a nutshell, I installed a bunch of Ruby things (think RVM, rbenv, etc.) to develop Ruby on Rails, as I thought it would be a good way to learn Ruby.
Well, after going through a long and tedious process to upgrade Ruby to 2.6.3, then downgrade to 2.5.5 and then 2.4.0, then back up to 2.5.5 and solving downgrade issues, RubyGems throws the error. I settled on 2.5.5 because 2.6.3 caused errors and 2.4.0 was too early of a version.
It's causing all sorts of errors, like HAML not compiling and Rails not making a controller. I really don't know what's happening.
If I run gem install [gem name], it throws the error. Running rails generate controller [name] index (for those not familiar to Rails this creates, well, a controller) it throws the error. Doing anything really with the gem command causes the error, except for gem server.
If I upgrade back up to the latest Ruby version, I fear that my gem command will go all wonky again and I'll have to go through another day of troubleshooting versions. How do I fix this, or at least get rid of the message so I can create things again?
I had this happen to me just today. It seems, somehow, my ruby version had been corrupted. When I ran rvm list version 2.5.1 was listed as 'broken'. I had to uninstall 2.5.1 fully (using sudo even in my case) to get to a clean slate.
Then, when attempting to reinstall, rvm was giving me all kinds of grief after a new gpg key which I initialy couldn't get to install properly (hint).
After a clean wipe of ruby 2.5.1, updating rvm to latest version and reinstalling, I got this error: Error running 'env GEM_HOME=/ruby-2.5.1#global GEM_PATH= /Users/user/.rvm/rubies/ruby-2.5.1/bin/ruby -d /Users/user/.rvm/src/rubygems-3.0.8/setup.rb --no-document',.
It appears that an update to MacOSX deprecated a version of OpenSSL which causes some issues. I ended up following this thread and ran rvm gemset create global --default and then bundle install to get passed the Gem errors.
Honestly, rails is supposed to be easier than this. I wish docker was easier to reason about sometimes. These are the kinds of issues docker supposedly promises to fix eh?
I have been following "How-to: Use Cucumber with .NET and C# under IronRuby" to set up Cucumber for .net on Windows. I had no problem installing Ruby, IronRuby and installing Cucumber, but when I came to this step, my troubles started:
Check to see if Cucumber under IronRuby works: icucumber –help
Here icucumber.bat is a file we write to tell IronRuby where to find gems. I just copied the script from the link above and changed the directories to match my installation directories.
I first got a bunch of require errors, which I fixed by installing Cucumber (0.6.4) according to "IRONRUBY: 0 TO CUCUMBER IN 15 MINUTES":
IronRuby isn’t quite ready for the latest version of Cucumber.
I also installed term-ansicolor by doing gem install term-ansicolor. At this point, although I got rid of the require errors, I got a new one:
c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/term-ansicolor-1.6.0/lib/term/ansicolor/rgb_triple.rb:8: syntax error, unexpected label
def self.convert_value(color, max: 255)
^
The file is pointing to rgb_triple.rb, which came with the term-ansicolor gem. So I do not understand what could have caused this error.
It seems that IronRuby isn't ready for the last version of term-ansicolor either. Around Ruby 2.0 it became possible to use keyword parameters (the max: 255 part in your error message) but since version 1.9 this can be simulated using hashes.
The last release of IronRuby I can find is 1.1.3 and it claims to be working towards compatibility with Ruby 1.9 but it seems kind of abandoned. So you can downgrade your gems even further or change your Ruby implementation to MRI or JRuby.
I am trying to run bundler. My ruby version is 2.3.0 but I keep getting this error.
Your Ruby version is 2.1.2, but your Gemfile specified 2.3.0
Any help is appreciated.
Edit-
Ubuntu version is 14.04.
ruby -v returns 2.3.0.
I am writing in notepad and compiling in terminal.
There are more options to this problem as you did not specifi it to a larger extent. But the options are:
you could have more versions of ruby installed which leads to collisions
if you are using IDE, it could be linked to a wrong version of ruby
if you are not using IDE but terminal, the default ruby might be set to a wrong version
If its not one of these, than you should give us more information on your setup.
Version of Ubuntu
outputs of rvm list or ruby -v from terminal
What are you using to develop? IDE, vim, Sublime, ... etc.
How do you compile it
May be something more, but I cant think of anything now...
When I used rails server command, found following errors in terminal. It shows that "could not find a JavaScript runtime". I am newbie in ROR and don't know to configure different files. I Google and found solutions of this problem 1 2 3. Still I am not getting the things. Please suggest some solutions.
Ruby and Rail versions on my system
Ruby version:- ruby 1.8.7 , Rails version:- Rails 3.2.6
I suppose you lack executable on your system/
Haven't you try to run gem install execjs or bundle install(from your project directory) in console?
UPDATE
Also visit execjs homepage and try instaling any of JS runtimes supported.
UPDATE 2
I was able to reproduce your error (with ruby 1.9.2). Just add gem 'therubyracer' to your Gemfile and run bundle install. For some weird reason ROR is not working out of the box on Ubuntu. See this and search for runtime word for more info.
PS
Please put your Gemfile here. This might help.
The error message also tells your to
See https://github.com/sstephenson/execjs for a list of available runtimes.
You have to install one of the JavaScript runtimes listed there:
therubyracer
therubyrhino
Node.js
Microsoft Windows Script Host
For Rails 3.2.6 I suggest to use Ruby 1.9.3. for better performance.