无法在Ubuntu 20.04上启动Rails服务器

时间:2020-05-31 20:11:28

标签: node.js ruby-on-rails ruby rubygems

在安装Ubuntu 20.04之后我无法启动我的Rails应用程序

traceback

我也有同样的错误:

...rbenv/versions/2.6.3/lib/ruby/2.6.0/x86_64-linux/etc.so: warning: already initialized constant Etc::...

然后我检查了我的rails版本。

通过擦除重新安装操作系统后,我从/home恢复了Ubuntu 18.04的备份 并检查了我的ruby railsnodejs版本。 Rubyrails相同,但我必须安装nodejs和一些postgres软件包。现在,在那之后,我尝试在项目文件夹中运行rails s,并且出现了来自追溯的错误。另外,命令

yarn install --check-files

无法成功完成,原因

info There appears to be trouble with your network connection. Retrying...错误。

我该怎么做才能成功启动我的应用程序?

我的gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'

gem "rails_12factor"
# gem "hashid-rails", "~> 1.0"
gem 'dotenv-rails', groups: [:development, :test]
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
# gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'pry'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'rspec-rails'
  gem 'database_cleaner'
  gem 'selenium-webdriver'
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
end

gem 'minitest-rails'

group :test do
  gem 'minitest-rails-capybara'
  gem 'capybara', '>= 2.15'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem "active_model_serializers"

Ruby:ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

路轨:Rails 6.0.2.2

Nodejs:v10.19.0

3 个答案:

答案 0 :(得分:0)

run `gem uninstall etc` 

然后是gem update etc --default

答案 1 :(得分:0)

Okey,在发布@ Bodh1004之后,我有一个想法可以对ffi gem进行相同的操作,并且可以使用!谢谢你的主意! 无论如何,我有相同的already initialized constant错误:

/home/procy/.rbenv/versions/2.6.3/lib/ruby/2.6.0/forwardable.rb:116: warning: already initialized constant Forwardable::VERSION
/home/procy/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/forwardable-1.3.1/lib/forwardable/version.rb:3: warning: previous definition of VERSION was here
/home/procy/.rbenv/versions/2.6.3/lib/ruby/2.6.0/forwardable.rb:117: warning: already initialized constant Forwardable::FORWARDABLE_VERSION
/home/procy/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/forwardable-1.3.1/lib/forwardable/version.rb:4: warning: previous definition of FORWARDABLE_VERSION was here

我会尽力解决它们。

答案 2 :(得分:0)

删除yarn.lock并记录错误 并重复