Cannot load such file -- optparse (LoadError) #1851
Replies: 20 comments
-
Nope!
|
Beta Was this translation helpful? Give feedback.
-
fixed this by uninstall rbenv and reinstall with homebrew for ubuntu |
Beta Was this translation helpful? Give feedback.
-
10 days ago I've installed
I've pulled all Manually uninstalling rbenv and reinstalling 2.7.1 and 2.7.2 solved my problem. |
Beta Was this translation helpful? Give feedback.
-
ruby-build.20210407222345.480785.log Here are steps to reproduce on Ubuntu 20.10 x86_64
|
Beta Was this translation helpful? Give feedback.
-
It does not reproduce on macOS 11.3 Beta (20E5224a). I do not have other non-beta versions of macOS. |
Beta Was this translation helpful? Give feedback.
-
The same for me with Ruby 2.7.3 version. 3.0.1, 2.6.7 and 2.5.9 installed without errors. The second try to install is successful somewhy. |
Beta Was this translation helpful? Give feedback.
-
@yahonda same error here on Ubuntu 20.04.2 LTS.
Look script cannot load optparse. |
Beta Was this translation helpful? Give feedback.
-
Such a bizarre error. I cannot reproduce. Those who can: do you have RUBYOPT or RUBYLIB set in your environment variables, by any chance? |
Beta Was this translation helpful? Give feedback.
-
@mislav No such environment variables. |
Beta Was this translation helpful? Give feedback.
-
@mislav Finally I install 3.0.1 success as following step
|
Beta Was this translation helpful? Give feedback.
-
None of these environment variables configured.
|
Beta Was this translation helpful? Give feedback.
-
@hsbt Do you know if building a Ruby version is dependent or at all affected by having another Ruby version installed on the system? The reproduction steps so far suggest that the LoadError pops up depending on which Ruby version is being installed and which other Ruby version was selected as "global". |
Beta Was this translation helpful? Give feedback.
-
#1484 (comment) is a strange behavior for me. Because I never faced that with my macOS and linux boxes. I try to reproduce it. |
Beta Was this translation helpful? Give feedback.
-
I ran into the same error installing 3.0.1 with asdf on Ubuntu 20.04. Following similar steps to @smoothdvd, I was able to install 3.0.1:
|
Beta Was this translation helpful? Give feedback.
-
@mislav , You are correct on our comment. This hapenned to me from version 2.6.8 to version 2.7.3. I solved it as follows: I am using CentOS 7 on a corporate environment. For that reason my options are quite limited.
You can check if it is correct using this command:
You can check if it is correct using this command:
I believe this issue started from version 2.6.x to version 2.7.x as to update from 2.5.x to 2.6.x i did not have this issue. |
Beta Was this translation helpful? Give feedback.
-
I'm facing the same issue with My solution, based on previous comments, was to set $ rbenv versions
* system
2.5.7
2.6.6
$ export RUBY_CONFIGURE_OPTS=" --with-baseruby=$HOME/.rbenv/versions/2.6.6/bin/ruby"
$ rbenv install 2.7.0
Installing ruby-2.7.0...
Installed ruby-2.7.0 to $HOME/.rbenv/versions/2.7.0 From the log, when
And notice that
Now, reading https://github.com/ruby/ruby/blob/master/configure.ac#L50 makes me wonder if a previous version of Ruby is needed to build Ruby Whats your opinion? 🤔 |
Beta Was this translation helpful? Give feedback.
-
@hsbt Do you know anything about this? |
Beta Was this translation helpful? Give feedback.
-
Same problem on my machine. Unable to install Ruby 2.7.2 via rvm. I have 2.7.0. |
Beta Was this translation helpful? Give feedback.
-
I met same issue on Ubuntu 21.04 amd64. I used system ruby instead of ruby-build's ruby 😅
refs: ruby-buildでRubyをインストールしようとしたらoptparseが無いって言われる - ser1zw's blog |
Beta Was this translation helpful? Give feedback.
-
This issue happen on, when install new ruby version use RVM, but current, selected version is system ruby. that is, this is a issue come from system ruby, don't use it, you can just remove system ruby use package manager, or switch to use a more older version ruby which installed use RVM. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, anyone encountered this issue while installing 2.7.1?
Beta Was this translation helpful? Give feedback.
All reactions