gpt4 book ai didi

ruby-on-rails - ubuntu上的rails服务器错误

转载 作者:行者123 更新时间:2023-12-04 18:46:39 24 4
gpt4 key购买 nike

我正在关注 ruby​​ on rails 入门指南 (http://guides.rubyonrails.org/getting_started.html)
我按照指南中的建议安装了 ruby​​ 和 rails,但是当我尝试执行时:

bin/rails server

我在终端中看到以下错误:
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
/var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/soroosh/rails/blog/config/application.rb:7:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /var/lib/gems/2.1.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from /home/soroosh/rails/blog/bin/rails:9:in `require'
from /home/soroosh/rails/blog/bin/rails:9:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client/rails.rb:28:in `load'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client/rails.rb:28:in `call'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client/command.rb:7:in `call'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/client.rb:28:in `run'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/bin/spring:49:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/binstub.rb:11:in `load'
from /var/lib/gems/2.1.0/gems/spring-1.6.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/soroosh/rails/blog/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

我正在使用 ubuntu 15.10 、 ruby​​ 2.1 和 rails4.2.5.1

最佳答案

如果您仔细查看错误消息,这是重要的一行:

 There was an error while trying to load the gem 'uglifier'.
Uglifier是一个 Javascript 包装器,所以它需要一个 Javascript 解释器。我建议安装 NodeJS:
sudo apt-get install nodejs

阅读有关 uglifier 的更多信息: https://github.com/lautis/uglifier

关于ruby-on-rails - ubuntu上的rails服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35242840/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com