我想從2015年開始運行RoR項目。由於我重新安裝了我的系統,我正在使用docker機器來嘗試啓動我的項目。但是我有錯誤,可能需要一段時間才能使其正常工作。這是我現在有錯誤:Ruby on rails - 啓動我的舊項目時出錯
在安裝我有這樣的消息:
...
Installing devise 3.4.1
Bundle complete! 17 Gemfile dependencies, 66 gems now installed.
Bundled gems are installed into /usr/local/bundle.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
---> 71231202532c
當我嘗試運行rails s
,我走這
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/usr/local/bundle/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in `autodetect'
/usr/local/bundle/gems/execjs-2.5.2/lib/execjs.rb:5:in `<module:ExecJS>'
/usr/local/bundle/gems/execjs-2.5.2/lib/execjs.rb:4:in `<top (required)>'
/usr/local/bundle/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/bundle/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/bundle/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/bundle/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/usr/local/bundle/gems/uglifier-2.7.1/lib/uglifier.rb:3:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:91:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:86:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:86:in `block in require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:75:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:75:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler.rb:107:in `require'
/config/application.rb:7:in `<top (required)>'
/usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
/usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
/usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
/usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
/usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/usr/local/bundle/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
/bin/rails:9:in `require'
/bin/rails:9:in `<top (required)>'
/usr/local/bundle/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
/usr/local/bundle/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
/usr/local/bundle/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
/usr/local/bundle/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
/usr/local/bundle/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
/usr/local/bundle/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
/usr/local/bundle/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
/bin/spring:15:in `require'
/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:86:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:86:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:75:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:75:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler.rb:107:in `require'
from /config/application.rb:7:in `<top (required)>'
from /usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
from /usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/bundle/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/bundle/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from /bin/rails:9:in `require'
from /bin/rails:9:in `<top (required)>'
from /usr/local/bundle/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /usr/local/bundle/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /usr/local/bundle/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /usr/local/bundle/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /usr/local/bundle/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /usr/local/bundle/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /usr/local/bundle/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /bin/spring:15:in `require'
from /bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
- 是否有可能運行一個這樣的舊項目?
- 如果是的話我該如何解決這個問題?
注意 我的版本軌和創業板的是:本身
[email protected]:/# rails -v
Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
An Array ({"GEM_PATH"=>["/usr/local/bundle"]}) was passed in from bin/rails:3:in `load'
Rails 4.2.1
[email protected]:/# gem -v
2.6.10
對不起,我沒有結果 – dmx
嘗試這樣做我假設你已經設置你的'PATH '相應地拿起node.js二進制文件,對吧?如果你打開一個控制檯並鍵入'ExecJS.runtime'它會拋出一個錯誤嗎?這可能是Rails無法檢測到運行時。檢查你的安裝,環境變量,權限;)。您還可以在Rails中配置運行時,提供runner路徑和命令。查看ExecJS文檔,我想你會找到一個解決方案。 – gkats