Cha*_*ham 15 ruby rubygems ruby-on-rails bundler visual-studio-code
我正在尝试在 Windows 版 vscode 上运行捆绑程序安装,但每次这样做时,我都会收到相同的消息:
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Using bundler 2.1.4
Fetching byebug 11.1.3
Installing byebug 11.1.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
/home/chadcunn/.rbenv/versions/2.7.1/bin/ruby -I /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200718-7409-qq2a6i.rb extconf.rb
creating Makefile
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" clean
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.so
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" install
/usr/bin/install -c -m 0755 byebug.so ./.gem.20200718-7409-z7mdim/byebug
Permission denied @ rb_file_s_rename - (./.gem.20200718-7409-z7mdim/byebug,
/home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/byebug-11.1.3/byebug)
Gem files will remain installed in /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3 for inspection.
Results logged to /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/byebug-11.1.3/gem_make.out
An error occurred while installing byebug (11.1.3), and Bundler cannot continue.
Make sure that `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
byebug
Run Code Online (Sandbox Code Playgroud)
然后当我尝试查看 gem install byebug 是否成功时,我得到以下响应:
Building native extensions. This could take a while...
ERROR: Error installing byebug:
ERROR: Failed to build gem native extension.
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
/home/chadcunn/.rbenv/versions/2.7.1/bin/ruby -I /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20200718-7520-jpov6j.rb extconf.rb
creating Makefile
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" clean
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.so
current directory: /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" install
/usr/bin/install -c -m 0755 byebug.so ./.gem.20200718-7520-b4jxqm/byebug
Permission denied @ rb_file_s_rename - (./.gem.20200718-7520-b4jxqm/byebug, /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/byebug-11.1.3/byebug)
Gem files will remain installed in /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3 for inspection.
Results logged to /home/chadcunn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/byebug-11.1.3/gem_make.out
Run Code Online (Sandbox Code Playgroud)
我对编码或计算机不是很有经验,实际上我现在只是想学习如何在这些程序中工作,但我不知道如何解决这个问题或做什么。
谁能帮我?
小智 12
您的系统缺少编译 byebug 等的本机软件包。您需要安装它并重试。例如
apt-get update && apt-get install -y build-essential
Run Code Online (Sandbox Code Playgroud)
确保gem install byebug -v '11.1.3' --source 'https://rubygems.org/'捆绑前成功。
因此,gem install byebug -v '11.1.3'如果问题仍然存在,请尝试gem install byebug不指定版本。这样做,gem 将搜索最新的。
但是,如果问题仍然存在,则您的 ruby 版本 2.7.1可能尚不支持此 byebug 版本。在这种情况下,尝试一个稳定的ruby版本,目前是2.6.5、2.6.6,也就是说,目前所有2.6.x都是稳定的。
当你跑得好之后gem install byebug,再跑bundle install一次。
对我使用 Ruby 和 Rails 有很大帮助的是查看官方 Ruby 网页。在那里,您将看到许多链接,指导如何根据您的操作系统使用适当的 ruby 版本和 Rails 版本。
这些东西在教程中并没有太多展示。
| 归档时间: |
|
| 查看次数: |
71714 次 |
| 最近记录: |