- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
编辑 1:另有人举报 similar issue与 asdf。
编辑 2:另有举报similar issue .
编辑 3:我卸载了 rvm
, 已安装 rvm
, 已安装 ruby
和 rails
,并尝试了一些事件。
编辑 4: Another person mentioned这是由我输入的行引起的 .zshrc
(或 .bash_profile/.bashrc
):RUBYOPT: "-W:no-deprecated -W:no-experimental"
.
问题:我有两个项目,一个使用 ruby-2.7.0
,另一个使用 ruby-2.6.5
.
每次我安装两个版本的 ruby 时,最终只有一个版本可以工作(2.7.0)。 bundle
以及 gem
另一个命令将不再起作用,但会给出 Traceback....(RuntimeError)
.
最近的尝试和控制台输出:
控制台输出流程大致是:
rvm
rvm
ruby-2.7.0
ruby-2.6.5
ruby-2.7.0
, 安装 rails
ruby-2.6.5
, 安装 rails
export PATH="$PATH:$HOME/.rvm/bin"
到 ~/.zshrc echo "export RUBYOPT='-W:no-deprecated -W:no-experimental'" >> ~/.zshrc
; source ~/.zshrc
ruby-2.6.5
不起作用; ruby-2.7.0
仍然有效 # UNINSTALL RVM
(base) ➜ ~ rvm -v
rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
(base) ➜ ~ which ruby
/Users/nahua/.rvm/rubies/ruby-2.6.5/bin/ruby
(base) ➜ ~ which rails
/usr/bin/rails
(base) ➜ ~ rbenv
zsh: command not found: rbenv
(base) ➜ ~
(base) ➜ ~ rvm implode
Are you SURE you wish for rvm to implode?
This will recursively remove /Users/nahua/.rvm and other rvm traces?
(anything other than 'yes' will cancel) > yes
Removing rvm-shipped binaries (rvm-prompt, rvm, rvm-sudo rvm-shell and rvm-auto-ruby)
Removing rvm wrappers in /Users/nahua/.rvm/bin
Hai! Removing /Users/nahua/.rvm
/Users/nahua/.rvm has been removed.
Note you may need to manually remove /etc/rvmrc and ~/.rvmrc if they exist still.
Please check all .bashrc .bash_profile .profile and .zshrc for RVM source lines and delete or comment out if this was a Per-User installation.
Also make sure to remove `rvm` group if this was a system installation.
Finally it might help to relogin / restart if you want to have fresh environment (like for installing RVM again).
(base) ➜ ~ gem uninstall rvm
Traceback (most recent call last):
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ ~ which ruby
/usr/bin/ruby
(base) ➜ ~ rvm -v
cat: /Users/nahua/.rvm/VERSION: No such file or directory
__rvm_initialize:source:4: no such file or directory: /Users/nahua/.rvm/scripts/base
cat: /Users/nahua/.rvm/VERSION: No such file or directory
rvm () by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
# COMMENT OFF ALL RVM LINES IN THE FOLLOWING FILES
(base) ➜ ~ subl .bashrc
(base) ➜ ~ subl .profile
(base) ➜ ~ subl .zshrc
(base) ➜ ~ subl .bash_profile
(base) ➜ ~ subl .zlogin
(base) ➜ ~ subl /etc/profile # nothing there
(base) ➜ ~ sudo vim /etc/profile # nothing there
Password:
(base) ➜ ~ exit
# RESTART TERMINAL
(base) ➜ ~ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
(base) ➜ ~ which ruby
/usr/bin/ruby
(base) ➜ ~ which gem
/usr/bin/gem
(base) ➜ ~ which bundle
/usr/bin/bundle
(base) ➜ ~ clear
(base) ➜ ~ rvm list
zsh: command not found: rvm
(base) ➜ ~ rbenv versions
zsh: command not found: rbenv
# INSTALL RVM
(base) ➜ ~ gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
Warning: Failed to set locale category LC_NUMERIC to en_DE.
Warning: Failed to set locale category LC_TIME to en_DE.
Warning: Failed to set locale category LC_COLLATE to en_DE.
Warning: Failed to set locale category LC_MONETARY to en_DE.
Warning: Failed to set locale category LC_MESSAGES to en_DE.
gpg: key 105BD0E739499BDB: "Piotr Kuczynski <piotr.kuczynski@gmail.com>" not changed
gpg: key 3804BB82D39DC0E3: "Michal Papis (RVM signing) <mpapis@gmail.com>" not changed
gpg: Total number processed: 2
gpg: unchanged: 2
(base) ➜ ~ \curl -sSL https://get.rvm.io | bash -s stable --ruby
Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc
Warning: Failed to set locale category LC_NUMERIC to en_DE.
Warning: Failed to set locale category LC_TIME to en_DE.
Warning: Failed to set locale category LC_COLLATE to en_DE.
Warning: Failed to set locale category LC_MONETARY to en_DE.
Warning: Failed to set locale category LC_MESSAGES to en_DE.
gpg: Signature made Wed Jul 10 10:31:02 2019 CEST
gpg: using RSA key 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 7D2B AF1C F37B 13E2 069D 6956 105B D0E7 3949 9BDB
GPG verified '/Users/nahua/.rvm/archives/rvm-1.29.9.tgz'
Installing RVM to /Users/nahua/.rvm/
RVM PATH line found in /Users/nahua/.mkshrc /Users/nahua/.profile /Users/nahua/.bashrc /Users/nahua/.zshrc.
RVM sourcing line found in /Users/nahua/.profile /Users/nahua/.bash_profile /Users/nahua/.zlogin.
Installation of RVM in /Users/nahua/.rvm/ is almost complete:
* To start using RVM you need to run `source /Users/nahua/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: https://opencollective.com/rvm/donate
Ruby enVironment Manager 1.29.9 (latest) (c) 2009-2017 Michal Papis, Piotr Kuczynski, Wayne E. Seguin
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/nahua/.rvm/rubies/ruby-2.6.3, this may take a while depending on your cpu(s)...
ruby-2.6.3 - #downloading ruby-2.6.3, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13.8M 100 13.8M 0 0 4529k 0 0:00:03 0:00:03 --:--:-- 4529k
ruby-2.6.3 - #extracting ruby-2.6.3 to /Users/nahua/.rvm/src/ruby-2.6.3.....
ruby-2.6.3 - #configuring.......................................................................
ruby-2.6.3 - #post-configuration.
ruby-2.6.3 - #compiling.....................................................................
ruby-2.6.3 - #installing...........
ruby-2.6.3 - #making binaries executable..
ruby-2.6.3 - #downloading rubygems-3.0.6
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 866k 100 866k 0 0 3437k 0 --:--:-- --:--:-- --:--:-- 3437k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.6.3 - #extracting rubygems-3.0.6.....
ruby-2.6.3 - #removing old rubygems........
$LANG was empty, setting up LANG=en_US.US-ASCII, if it fails again try setting LANG to something sane and try again.
ruby-2.6.3 - #installing rubygems-3.0.6...............................................
ruby-2.6.3 - #gemset created /Users/nahua/.rvm/gems/ruby-2.6.3@global
ruby-2.6.3 - #importing gemset /Users/nahua/.rvm/gemsets/global.gems......................................................-
ruby-2.6.3 - #generating global wrappers.......
ruby-2.6.3 - #gemset created /Users/nahua/.rvm/gems/ruby-2.6.3
ruby-2.6.3 - #importing gemsetfile /Users/nahua/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.6.3 - #generating default wrappers.......
ruby-2.6.3 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.6.3 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
Creating alias default for ruby-2.6.3....
* To start using RVM you need to run `source /Users/nahua/.rvm/scripts/rvm`
in all your open shell windows, in rare cases you need to reopen all shell windows.
(base) ➜ ~ source /Users/nahua/.rvm/scripts/rvm
source /Users/nahua/.rvm/scripts/rvm
(base) ➜ ~ rvm
Ruby enVironment Manager 1.29.9 (latest) (c) 2009-2017 Michal Papis, Piotr Kuczynski, Wayne E. Seguin
For additional documentation please visit https://rvm.io
(base) ➜ ~ echo $PATH
/Users/nahua/.rvm/gems/ruby-2.6.3/bin:/Users/nahua/.rvm/gems/ruby-2.6.3@global/bin:/Users/nahua/.rvm/rubies/ruby-2.6.3/bin:/opt/anaconda3/bin:/opt/anaconda3/condabin:/Users/nahua/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/nahua/.rvm/bin
(base) ➜ ~ rvm -v
rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
(base) ➜ ~ rvm list
=* ruby-2.6.3 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ ~ rvm install 2.7.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.7.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/nahua/.rvm/rubies/ruby-2.7.0, this may take a while depending on your cpu(s)...
ruby-2.7.0 - #downloading ruby-2.7.0, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14.0M 100 14.0M 0 0 4616k 0 0:00:03 0:00:03 --:--:-- 4616k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.7.0 - #extracting ruby-2.7.0 to /Users/nahua/.rvm/src/ruby-2.7.0 - please wait
ruby-2.7.0 - #configuring - please wait
ruby-2.7.0 - #post-configuration - please wait
ruby-2.7.0 - #compiling - please wait
ruby-2.7.0 - #installing - please wait
ruby-2.7.0 - #making binaries executable - please wait
Installed rubygems 3.1.2 is newer than 3.0.6 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.7.0 - #gemset created /Users/nahua/.rvm/gems/ruby-2.7.0@global
ruby-2.7.0 - #importing gemset /Users/nahua/.rvm/gemsets/global.gems - please wait
ruby-2.7.0 - #generating global wrappers - please wait
ruby-2.7.0 - #gemset created /Users/nahua/.rvm/gems/ruby-2.7.0
ruby-2.7.0 - #importing gemsetfile /Users/nahua/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.7.0 - #generating default wrappers - please wait
ruby-2.7.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.7.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
(base) ➜ ~ rvm list
* ruby-2.6.3 [ x86_64 ]
=> ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ ~ gem -v
3.1.2
(base) ➜ ~ bundle -v
Bundler version 2.1.2
(base) ➜ ~ rvm use 2.6.3
Using /Users/nahua/.rvm/gems/ruby-2.6.3
(base) ➜ ~ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]
(base) ➜ ~ gem -v
3.0.6
(base) ➜ ~ bundle -v
Bundler version 1.17.3
(base) ➜ ~ rvm use 2.7.0
Using /Users/nahua/.rvm/gems/ruby-2.7.0
(base) ➜ ~ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
(base) ➜ ~ gem -v
3.1.2
(base) ➜ ~ bundle -v
Bundler version 2.1.2
(base) ➜ ~ rvm install 2.6.5
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/nahua/.rvm/rubies/ruby-2.6.5, this may take a while depending on your cpu(s)...
ruby-2.6.5 - #downloading ruby-2.6.5, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 13.4M 100 13.4M 0 0 9377k 0 0:00:01 0:00:01 --:--:-- 9370k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.6.5 - #extracting ruby-2.6.5 to /Users/nahua/.rvm/src/ruby-2.6.5 - please wait
ruby-2.6.5 - #configuring - please wait
ruby-2.6.5 - #post-configuration - please wait
ruby-2.6.5 - #compiling - please wait
ruby-2.6.5 - #installing - please wait
ruby-2.6.5 - #making binaries executable - please wait
ruby-2.6.5 - #downloading rubygems-3.0.6
ruby-2.6.5 - #extracting rubygems-3.0.6 - please wait
ruby-2.6.5 - #removing old rubygems - please wait
$LANG was empty, setting up LANG=en_US.US-ASCII, if it fails again try setting LANG to something sane and try again.
ruby-2.6.5 - #installing rubygems-3.0.6 - please wait
ruby-2.6.5 - #gemset created /Users/nahua/.rvm/gems/ruby-2.6.5@global
ruby-2.6.5 - #importing gemset /Users/nahua/.rvm/gemsets/global.gems - please wait
ruby-2.6.5 - #generating global wrappers - please wait
ruby-2.6.5 - #gemset created /Users/nahua/.rvm/gems/ruby-2.6.5
ruby-2.6.5 - #importing gemsetfile /Users/nahua/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.6.5 - #generating default wrappers - please wait
ruby-2.6.5 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.6.5 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
(base) ➜ ~ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
(base) ➜ ~ gem -v
3.0.6
(base) ➜ ~ bundle -v
Bundler version 1.17.3
(base) ➜ ~ gem install rails
...
IGNORED DUE TO CHARACTER LIMIT ON STACKOVERFLOW
...
Successfully installed concurrent-ruby-1.1.5
HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.
If you are upgrading your Rails application from an older version of Rails:
Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.
If you are starting a NEW Rails application, you can ignore this notice.
For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
...
IGNORED DUE TO CHARACTER LIMIT ON STACKOVERFLOW
...
Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, zeitwerk, activesupport, rack, rack-test, mini_portile2, nokogiri, crass, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubi, actionview, actionpack, activemodel, activerecord, globalid, activejob, mini_mime, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, mimemagic, marcel, activestorage, actionmailbox, actiontext, thor, method_source, railties, sprockets, sprockets-rails, rails after 39 seconds
40 gems installed
(base) ➜ ~ rails -v
Rails 6.0.2.1
(base) ➜ ~ rvm use 2.6.5
Using /Users/nahua/.rvm/gems/ruby-2.6.5
(base) ➜ ~ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
(base) ➜ ~ gem install rails
...
IGNORED DUE TO CHARACTER LIMIT ON STACKOVERFLOW
...
Successfully installed concurrent-ruby-1.1.5
HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.
If you are upgrading your Rails application from an older version of Rails:
Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.
If you are starting a NEW Rails application, you can ignore this notice.
For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
...
IGNORED DUE TO CHARACTER LIMIT ON STACKOVERFLOW
...
Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, zeitwerk, activesupport, rack, rack-test, mini_portile2, nokogiri, crass, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubi, actionview, actionpack, activemodel, activerecord, globalid, activejob, mini_mime, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, mimemagic, marcel, activestorage, actionmailbox, actiontext, thor, method_source, railties, sprockets, sprockets-rails, rails after 34 seconds
40 gems installed
(base) ➜ ~ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
(base) ➜ ~ rvm list
* ruby-2.6.3 [ x86_64 ]
=> ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ ~ rvm use 2.7.0
Using /Users/nahua/.rvm/gems/ruby-2.7.0
(base) ➜ ~ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
(base) ➜ ~ rvm use 2.6.5
Using /Users/nahua/.rvm/gems/ruby-2.6.5
(base) ➜ ~ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
(base) ➜ ~ cd projects/rails/DevcampPortfolio
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ cat .ruby-version
2.7.0
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rvm list
* ruby-2.6.3 [ x86_64 ]
ruby-2.6.5 [ x86_64 ]
=> ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rails c
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
Could not find minitest-5.14.0 in any of the sources
Run `bundle install` to install missing gems.
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ clear
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ which bundle
/Users/nahua/.rvm/rubies/ruby-2.7.0/bin/bundle
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ bundle install
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
Fetching gem metadata from https://rubygems.org/............
...
### BUNDLE INSTALL...DELETING DUE TO CHARACTER LIMIT ON STACKOVERFLOW
...
Bundle complete! 15 Gemfile dependencies, 67 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ gem install bundler:2.1.4
Fetching bundler-2.1.4.gem
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Done installing documentation for bundler after 2 seconds
1 gem installed
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rvm use 2.6.5
Using /Users/nahua/.rvm/gems/ruby-2.6.5
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rvm use 2.7.0
Using /Users/nahua/.rvm/gems/ruby-2.7.0
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rails c
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
Running via Spring preloader in process 16581
Loading development environment (Rails 6.0.2.1)
2.7.0 :001 > exit
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ cd ../../20bn-homepage
(base) ➜ 20bn-homepage git:(master) rvm list
* ruby-2.6.3 [ x86_64 ]
=> ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ 20bn-homepage git:(master) bundle install
You must use Bundler 2 or greater with this lockfile.
(base) ➜ 20bn-homepage git:(master) bundle -v
Bundler version 1.17.3
(base) ➜ 20bn-homepage git:(master) gem install bundler:2.1.4
Fetching bundler-2.1.4.gem
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Done installing documentation for bundler after 2 seconds
1 gem installed
(base) ➜ 20bn-homepage git:(master) bundle install
You must use Bundler 2 or greater with this lockfile.
(base) ➜ 20bn-homepage git:(master) bundle -v
Bundler version 1.17.3
(base) ➜ 20bn-homepage git:(master) gem install bundler:2.1.4
Fetching bundler-2.1.4.gem
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Done installing documentation for bundler after 2 seconds
1 gem installed
(base) ➜ 20bn-homepage git:(master) bundle install
...
### BUNDLE INSTALL...DELETING DUE TO CHARACTER LIMIT ON STACKOVERFLOW
...
Bundle complete! 61 Gemfile dependencies, 180 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from postmark:
==================
Thanks for installing the postmark gem. If you don't have an account, please
sign up at http://postmarkapp.com/.
Review the README.md for implementation details and examples.
==================
%
(base) ➜ 20bn-homepage git:(master) exit
Last login: Wed Jan 22 10:05:43 on ttys001
(base) ➜ ~ rvm list
zsh: command not found: rvm
(base) ➜ ~ echo "source $HOME/.rvm/scripts/rvm" >> ~/.zshrc
(base) ➜ ~ source ~/.zshrc
(base) ➜ ~ rvm list
=* ruby-2.6.3 [ x86_64 ]
ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ ~ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]
(base) ➜ ~ cd projects/rails/DevcampPortfolio
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rvm list
* ruby-2.6.3 [ x86_64 ]
ruby-2.6.5 [ x86_64 ]
=> ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rails c
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
Running via Spring preloader in process 26256
Loading development environment (Rails 6.0.2.1)
:001 > Blog.last
Blog Load (2.5ms) SELECT "blogs".* FROM "blogs" ORDER BY "blogs"."id" DESC LIMIT $1 [["LIMIT", 1]]
=> #<Blog id: 12, title: "My great blog title", body: "Lorem ipsum blah blah blah", created_at: "2020-01-21 09:49:26", updated_at: "2020-01-21 09:49:26", slug: "my-great-blog-title">
:002 > exit
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ cd ../../20bn-homepage
(base) ➜ 20bn-homepage git:(master) rvm list
* ruby-2.6.3 [ x86_64 ]
=> ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ 20bn-homepage git:(master) ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
(base) ➜ 20bn-homepage git:(master) rails c
Loading development environment (Rails 6.0.2.1)
:001 > exit
(base) ➜ 20bn-homepage git:(master) cd ../rails/DevcampPortfolio
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ echo "export RUBYOPT='-W:no-deprecated -W:no-experimental'" >> ~/.zshrc
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ source ~/.zshrc
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ rails c
Warning: the running version of Bundler (2.1.2) is older than the version that created the lockfile (2.1.4). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.1.4`.
Running via Spring preloader in process 26693
Loading development environment (Rails 6.0.2.1)
2.7.0 :001 > exit
(base) ➜ DevcampPortfolio git:(portfolio-feature) ✗ cd ../../20bn-homepage
(base) ➜ 20bn-homepage git:(master) ruby -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
### COMMENT OFF export RUBYOPT='-W:no-deprecated -W:no-experimental' IN ~/.zshrc AGAIN
(base) ➜ 20bn-homepage git:(master) source ~/.zshrc
(base) ➜ 20bn-homepage git:(master) ruby -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ 20bn-homepage git:(master)
(base) ➜ 20bn-homepage git:(master) rvm list
Warning! PATH is not properly set up, /Users/nahua/.rvm/gems/ruby-2.6.5/bin is not at first place.
Usually this is caused by shell initialization files. Search for PATH=... entries.
You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
To fix it temporarily in this shell session run: rvm use ruby-2.6.5
To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
* ruby-2.6.3 [ x86_64 ]
=> ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ 20bn-homepage git:(master) rvm get stable --auto-dotfiles
...
IGNORED DUE TO STACKOVERFLOW CHARACTER LIMIT
...
RVM reloaded!
(base) ➜ 20bn-homepage git:(master) ruby -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ 20bn-homepage git:(master) echo $PATH
/Users/nahua/bin:/usr/local/bin:/Users/nahua/.rvm/gems/ruby-2.6.5/bin:/Users/nahua/.rvm/gems/ruby-2.6.5@global/bin:/Users/nahua/.rvm/rubies/ruby-2.6.5/bin:/Users/nahua/.rvm/bin:/Users/nahua/bin:/usr/local/bin:/Users/nahua/bin:/usr/local/bin:/opt/anaconda3/bin:/opt/anaconda3/condabin:/Users/nahua/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(base) ➜ 20bn-homepage git:(master) rvm reset
Warning! PATH is not properly set up, /Users/nahua/.rvm/gems/ruby-2.6.5/bin is not at first place.
Usually this is caused by shell initialization files. Search for PATH=... entries.
You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
To fix it temporarily in this shell session run: rvm use ruby-2.6.5
To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
(base) ➜ 20bn-homepage git:(master) ruby -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ 20bn-homepage git:(master) rvm list
* ruby-2.6.3 [ x86_64 ]
ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ 20bn-homepage git:(master) source ~/.zshrc
(base) ➜ 20bn-homepage git:(master) ruby -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ 20bn-homepage git:(master) rvm use ruby-2.6.5
Using /Users/nahua/.rvm/gems/ruby-2.6.5
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ 20bn-homepage git:(master) rvm use 2.7.0
Using /Users/nahua/.rvm/gems/ruby-2.7.0
(base) ➜ 20bn-homepage git:(master) ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
ruby-2.7.0
,另一个使用
ruby-2.6.5
.
rvm
或
rbenv
, 每次我安装两个版本的 ruby 时,最终只有一个版本可以工作(2.7.0)。
bundle
以及
gem
另一个命令将不再起作用,但会给出
Traceback....(RuntimeError)
.
rbenv
,已卸载
rbenv
, 已安装
rvm
.我还尝试卸载所有非系统 Ruby 版本和 Rails。似乎没有任何帮助。
(base) ➜ ~ rvm list
=* ruby-2.6.5 [ x86_64 ]
ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
(base) ➜ ~ bundle -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ ~ gem -v
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
(base) ➜ ~ rvm use 2.7.0
Using /Users/nahua/.rvm/gems/ruby-2.7.0
(base) ➜ ~ bundle -v
Bundler version 2.1.4
(base) ➜ ~ rvm use 2.6.5
Using /Users/nahua/.rvm/gems/ruby-2.6.5
Traceback (most recent call last):
ruby: invalid option -: (-h will show valid options) (RuntimeError)
最佳答案
我遇到了完全相同的问题,除了将 rbenv 与 bash 一起使用。
肇事者似乎是 .zsh 文件中的 echo "export RUBYOPT='-W:no-deprecated -W:no-experimental'"行,我不确定 Ruby 2.6.5 是否理解它。
从您的 .zsh/.bashrc/.profile 中删除 echo "export RUBYOPT='-W:no-deprecated -W:no-experimental'"并重新启动您的 shell 。
关于ruby - 安装多个版本时,只有一个版本的 Ruby 有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59851061/
以下是一个非常简单的ruby服务器。 require 'socket' local_socket = Socket.new(:INET, :STREAM) local_addr = Socket.
我正在使用 OS X(使用 bash),并且是 unix 的新手。我想知道是否可以修改一些文件以便运行 ruby 程序,我不需要“ruby file.rb”,而是可以运行“ruby.rb”。 有理
我在用 Ruby 替换字符串时遇到一些问题。 我的原文:人之所为不如兽之所为。 我想替换为:==What== human does is not like ==what== animal does.
我想在一个循环中从 Ruby 脚本做这样的事情: 写一个文件a.rb(每次迭代都会改变) 执行系统(ruby 'a.rb') a.rb 将带有结果的字符串写入文件“results” a.rb 完成并且
我的问题是尝试创建一个本地服务器,以便我可以理解由我的新团队开发的应用程序。我的问题是我使用的是 Ruby 2.3.3,而 Gemfile 需要 2.3.1。我无法编辑 Gemfile,因为我被告知很
我有一个使用 GLI 框架用 Ruby 编写的命令行实用程序。我想在我的主目录中配置我的命令行实用程序,使用 Ruby 本身作为 DSL 来处理它(类似于 Gemfile 或 Rakefile)。 我
我的 Rails 应用 Controller 中有这段代码: def delete object = model.datamapper_class.first(:sourced_id =>
我正在寻找的解析器应该: 对 Ruby 解析友好, 规则设计优雅, 产生用户友好的解析错误, 用户文档的数量应该比计算器示例多, UPD:允许在编写语法时省略可选的空格。 快速解析不是一个重要的特性。
我刚开始使用 Ruby,听说有一种“Ruby 方式”编码。除了 Ruby on Rails 之外,还有哪些项目适合学习并被认可且设计良好? 最佳答案 Prawn被明确地创建为不仅是一个该死的好 PDF
我知道之前有人问过类似的问题,但是我该如何构建一个无需在前面输入“ruby”就可以在终端中运行的 Ruby 文件呢? 这里的最终目标是创建一个命令行工具包类型的东西。现在,为了执行我希望用户能够执行的
例如哈希a是{:name=>'mike',:age=>27,:gender=>'male'}哈希 b 是 {:name=>'mike'} 我想知道是否有更好的方法来判断 b 哈希是否在 a 哈希内,而
我是一名决定学习 Ruby 和 Ruby on Rails 的 ASP.NET MVC 开发人员。我已经有所了解并在 RoR 上创建了一个网站。在 ASP.NET MVC 上开发,我一直使用三层架构:
最近我看到 Gary Bernhardt 展示了他用来在 vim 中执行 Ruby 代码的 vim 快捷方式。捷径是 :map ,t :w\|:!ruby %. 似乎这个方法总是执行系统 Rub
在为 this question about Blue Ruby 选择的答案中,查克说: All of the current Ruby implementations are compiled to
我有一个 Ruby 数组 > list = Request.find_all_by_artist("Metallica").map(&:song) => ["Nothing else Matters"
我在四舍五入时遇到问题。我有一个 float ,我想将其四舍五入到小数点后的百分之一。但是,我只能使用 .round ,它基本上将它变成一个 int,意思是 2.34.round # => 2. 有没
我使用 ruby on rails 编写了一个小型 Web 应用程序,它的主要目的是上传、存储和显示来自 xml(文件最多几 MB)文件的结果。运行大约 2 个月后,我注意到 mongrel 进程
我们如何用 Ruby 转换像这样的字符串: 𝑙𝑎𝑡𝑜𝑟𝑟𝑒 收件人: Latorre 最佳答案 s = "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" => "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" s.u
通过 ruby monk 时,他们偶尔会从左侧字段中抛出一段语法不熟悉的代码: def compute(xyz) return nil unless xyz xyz.map {|a,
不确定我做错了什么,但我似乎弄错了。 问题是,给你一串空格分隔的数字,你必须返回最大和最小的数字。 注意:所有数字都是有效的 Int32,不需要验证它们。输入字符串中始终至少有一个数字。输出字符串必须
我是一名优秀的程序员,十分优秀!