出现问题:Yarn需要安装Node.js4.0或更高版本
通过ssh到远程服务器,我有:
passwords@meet:/srv/passwords$ yarn -v
1.22.5
passwords@meet:/srv/passwords$ node -v
v16.9.1
passwords@meet:/srv/passwords$
节点由NVM安装。另外,我让node使用16.9.1,它没有改变任何东西。通过ssh(Login-shell)可以很好地工作。
GEMFILE:
group :development, :deploy do
gem 'capistrano', '~> 3.14', require: false
gem 'capistrano-faster-assets'
gem 'capistrano-passenger'
gem 'capistrano-rails', '~> 1.6', require: false
gem 'capistrano-rake', require: false
gem 'capistrano-rvm'
gem 'capistrano-resque', require: false
end
错误
rake STDERR:纱线需要安装Node.js4.0或更高版本
我所做的一切
task :debugs do
on roles(:app), in: :parallel do |server|
on "passwords@#{server.hostname}" do
#execute :node, '-v'
execute :echo, '$PATH'
execute :pwd
end
end
end
before :deploy, :debugs
谢了!克里斯
MacBook: ~/projects-priv/passwords.rails$ cap staging deploy
rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
ruby-2.7.2
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
00:00 debugs
01 echo $PATH
01 /usr/local/bin:/usr/bin:/bin:/usr/games
✔ 01 passwords@sedlmair.ch 0.245s
02 pwd
02 /home/passwords
✔ 02 passwords@sedlmair.ch 0.239s
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 passwords@sedlmair.ch 0.228s
Uploading /tmp/git-ssh-d21e8dbb787dbfd49298.sh 100.0%
02 chmod 700 /tmp/git-ssh-d21e8dbb787dbfd49298.sh
✔ 02 passwords@sedlmair.ch 0.242s
00:01 git:check
01 git ls-remote repo-get@sedlmair.ch:/repos/sedl/passwords.git HEAD
01 8cf4b5d57543eccf3737cd670519a9deac5592b8 HEAD
✔ 01 passwords@sedlmair.ch 0.546s
00:02 deploy:check:directories
01 mkdir -p /srv/passwords-staging/shared /srv/passwords-staging/releases
✔ 01 passwords@sedlmair.ch 0.199s
00:02 deploy:check:linked_dirs
01 mkdir -p /srv/passwords-staging/shared/log /srv/passwords-staging/shared/backup /srv/passwords-staging/shared/tmp/pids /srv/passwords-staging/shared/tmp/cache /srv/passwords-staging/shared/tm…
✔ 01 passwords@sedlmair.ch 0.232s
00:02 deploy:check:make_linked_dirs
01 mkdir -p /srv/passwords-staging/shared/config /srv/passwords-staging/shared/config/credentials
✔ 01 passwords@sedlmair.ch 0.230s
00:04 git:clone
The repository mirror is at /srv/passwords-staging/repo
00:04 git:update
01 git remote set-url origin repo-get@sedlmair.ch:/repos/sedl/passwords.git
✔ 01 passwords@sedlmair.ch 0.237s
02 git remote update --prune
02 Fetching origin
02 From sedlmair.ch:/repos/sedl/passwords
02 7713138..8cf4b5d master -> master
✔ 02 passwords@sedlmair.ch 0.589s
00:05 git:create_release
01 mkdir -p /srv/passwords-staging/releases/20210917211320
✔ 01 passwords@sedlmair.ch 0.251s
02 git archive master | /usr/bin/env tar -x -f - -C /srv/passwords-staging/releases/20210917211320
✔ 02 passwords@sedlmair.ch 0.263s
00:06 deploy:set_current_revision
01 echo "8cf4b5d57543eccf3737cd670519a9deac5592b8" > REVISION
✔ 01 passwords@sedlmair.ch 0.229s
00:06 deploy:symlink:linked_files
01 mkdir -p /srv/passwords-staging/releases/20210917211320/config /srv/passwords-staging/releases/20210917211320/config/credentials
✔ 01 passwords@sedlmair.ch 0.232s
02 rm /srv/passwords-staging/releases/20210917211320/config/database.yml
✔ 02 passwords@sedlmair.ch 0.231s
03 ln -s /srv/passwords-staging/shared/config/database.yml /srv/passwords-staging/releases/20210917211320/config/database.yml
✔ 03 passwords@sedlmair.ch 0.229s
04 ln -s /srv/passwords-staging/shared/config/secrets.yml /srv/passwords-staging/releases/20210917211320/config/secrets.yml
✔ 04 passwords@sedlmair.ch 0.233s
05 ln -s /srv/passwords-staging/shared/config/master.key /srv/passwords-staging/releases/20210917211320/config/master.key
✔ 05 passwords@sedlmair.ch 0.234s
06 ln -s /srv/passwords-staging/shared/config/credentials/staging.key /srv/passwords-staging/releases/20210917211320/config/credentials/staging.key
✔ 06 passwords@sedlmair.ch 0.233s
00:10 deploy:symlink:linked_dirs
01 mkdir -p /srv/passwords-staging/releases/20210917211320 /srv/passwords-staging/releases/20210917211320/tmp /srv/passwords-staging/releases/20210917211320/public
✔ 01 passwords@sedlmair.ch 0.236s
02 rm -rf /srv/passwords-staging/releases/20210917211320/log
✔ 02 passwords@sedlmair.ch 0.232s
03 ln -s /srv/passwords-staging/shared/log /srv/passwords-staging/releases/20210917211320/log
✔ 03 passwords@sedlmair.ch 0.233s
04 ln -s /srv/passwords-staging/shared/backup /srv/passwords-staging/releases/20210917211320/backup
✔ 04 passwords@sedlmair.ch 0.235s
05 rm -rf /srv/passwords-staging/releases/20210917211320/tmp/pids
✔ 05 passwords@sedlmair.ch 0.230s
06 ln -s /srv/passwords-staging/shared/tmp/pids /srv/passwords-staging/releases/20210917211320/tmp/pids
✔ 06 passwords@sedlmair.ch 0.234s
07 ln -s /srv/passwords-staging/shared/tmp/cache /srv/passwords-staging/releases/20210917211320/tmp/cache
✔ 07 passwords@sedlmair.ch 0.227s
08 ln -s /srv/passwords-staging/shared/tmp/sockets /srv/passwords-staging/releases/20210917211320/tmp/sockets
✔ 08 passwords@sedlmair.ch 0.230s
09 ln -s /srv/passwords-staging/shared/public/uploads /srv/passwords-staging/releases/20210917211320/public/uploads
✔ 09 passwords@sedlmair.ch 0.232s
10 ln -s /srv/passwords-staging/shared/public/packs /srv/passwords-staging/releases/20210917211320/public/packs
✔ 10 passwords@sedlmair.ch 0.232s
11 ln -s /srv/passwords-staging/shared/public/assets /srv/passwords-staging/releases/20210917211320/public/assets
✔ 11 passwords@sedlmair.ch 0.234s
00:16 bundler:config
01 ~/.rvm/bin/rvm 2.7.2 do bundle config --local deployment true
✔ 01 passwords@sedlmair.ch 1.017s
02 ~/.rvm/bin/rvm 2.7.2 do bundle config --local path /srv/passwords-staging/shared/bundle
✔ 02 passwords@sedlmair.ch 1.074s
03 ~/.rvm/bin/rvm 2.7.2 do bundle config --local without development\ test
✔ 03 passwords@sedlmair.ch 1.017s
00:21 bundler:install
The Gemfile's dependencies are satisfied, skipping installation
00:21 deploy:assets:precompile
01 ls /srv/passwords-staging/releases/20210917211125/assets_manifest_backup
01 ls: cannot access '/srv/passwords-staging/releases/20210917211125/assets_manifest_backup': No such file or directory
02 ~/.rvm/bin/rvm 2.7.2 do bundle exec rake assets:precompile
02 Yarn requires Node.js 4.0 or higher to be installed.
#<Thread:0x00007ff22d193e40 /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
13: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
12: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
11: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
10: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:17:in `block (4 levels) in <top (required)>'
9: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:92:in `within'
8: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:18:in `block (5 levels) in <top (required)>'
7: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:100:in `with'
6: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:29:in `block (6 levels) in <top (required)>'
5: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:80:in `execute'
4: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
3: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `tap'
2: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
1: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:170:in `execute_command'
/Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/command.rb:97:in `exit_status=': ls exit status: 2 (SSHKit::Command::Failed)
ls stdout: Nothing written
ls stderr: ls: cannot access '/srv/passwords-staging/releases/20210917211125/assets_manifest_backup': No such file or directory
8: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
7: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
6: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
5: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:17:in `block (4 levels) in <top (required)>'
4: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:92:in `within'
3: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:18:in `block (5 levels) in <top (required)>'
2: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:100:in `with'
1: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:29:in `block (6 levels) in <top (required)>'
/Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:29:in `rescue in block (6 levels) in <top (required)>': PrecompileRequired (PrecompileRequired)
14: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
13: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
12: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
11: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:17:in `block (4 levels) in <top (required)>'
10: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:92:in `within'
9: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:18:in `block (5 levels) in <top (required)>'
8: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:100:in `with'
7: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:19:in `block (6 levels) in <top (required)>'
6: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/capistrano-faster-assets-1.1.0/lib/capistrano/tasks/faster_assets.rake:68:in `rescue in block (6 levels) in <top (required)>'
5: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:80:in `execute'
4: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
3: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `tap'
2: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
1: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:170:in `execute_command'
/Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/command.rb:97:in `exit_status=': rake exit status: 1 (SSHKit::Command::Failed)
rake stdout: Nothing written
rake stderr: Yarn requires Node.js 4.0 or higher to be installed.
1: from /Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/dev/.rvm/gems/ruby-2.7.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as passwords@sedlmair.ch: rake exit status: 1 (SSHKit::Runner::ExecuteError)
rake stdout: Nothing written
rake stderr: Yarn requires Node.js 4.0 or higher to be installed.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as passwords@sedlmair.ch: rake exit status: 1
rake stdout: Nothing written
rake stderr: Yarn requires Node.js 4.0 or higher to be installed.
Caused by:
SSHKit::Command::Failed: rake exit status: 1
rake stdout: Nothing written
rake stderr: Yarn requires Node.js 4.0 or higher to be installed.
Caused by:
PrecompileRequired: PrecompileRequired
Caused by:
SSHKit::Command::Failed: ls exit status: 2
ls stdout: Nothing written
ls stderr: ls: cannot access '/srv/passwords-staging/releases/20210917211125/assets_manifest_backup': No such file or directory
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as passwords@sedlmair.ch: rake exit status: 1
rake stdout: Nothing written
rake stderr: Yarn requires Node.js 4.0 or higher to be installed.
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [5db32273] Running ~/.rvm/bin/rvm 2.7.2 do bundle check as passwords@sedlmair.ch
DEBUG [5db32273] Command: cd /srv/passwords-staging/releases/20210917211320 && ~/.rvm/bin/rvm 2.7.2 do bundle check
DEBUG [5db32273] The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
DEBUG [5db32273] The Gemfile's dependencies are satisfied
DEBUG [5db32273] Finished in 1.177 seconds with exit status 0 (successful).
INFO The Gemfile's dependencies are satisfied, skipping installation
DEBUG [01c835ec] Running if test ! -d /srv/passwords-staging/releases/20210917211320; then echo "Directory does not exist '/srv/passwords-staging/releases/20210917211320'" 1>&2; false; fi as passwords@sedlmair.ch
DEBUG [01c835ec] Command: if test ! -d /srv/passwords-staging/releases/20210917211320; then echo "Directory does not exist '/srv/passwords-staging/releases/20210917211320'" 1>&2; false; fi
DEBUG [01c835ec] Finished in 0.225 seconds with exit status 0 (successful).
DEBUG [17c736a8] Running /usr/bin/env ls -xr /srv/passwords-staging/releases as passwords@sedlmair.ch
DEBUG [17c736a8] Command: cd /srv/passwords-staging/releases/20210917211320 && ( export RAILS_ENV="staging" ; /usr/bin/env ls -xr /srv/passwords-staging/releases )
DEBUG [17c736a8] 20210917211320 20210917211125 20210917124038 20210917123113 20210917123012
20210917122443 20210917115628 20210917115208 20210917114621
DEBUG [17c736a8] Finished in 0.239 seconds with exit status 0 (successful).
INFO [e1420513] Running /usr/bin/env ls /srv/passwords-staging/releases/20210917211125/assets_manifest_backup as passwords@sedlmair.ch
DEBUG [e1420513] Command: cd /srv/passwords-staging/releases/20210917211320 && ( export RAILS_ENV="staging" ; /usr/bin/env ls /srv/passwords-staging/releases/20210917211125/assets_manifest_backup )
DEBUG [e1420513] ls: cannot access '/srv/passwords-staging/releases/20210917211125/assets_manifest_backup': No such file or directory
INFO [02b44f15] Running ~/.rvm/bin/rvm 2.7.2 do bundle exec rake assets:precompile as passwords@sedlmair.ch
DEBUG [02b44f15] Command: cd /srv/passwords-staging/releases/20210917211320 && ( export RAILS_ENV="staging" ; ~/.rvm/bin/rvm 2.7.2 do bundle exec rake assets:precompile )
DEBUG [02b44f15] Yarn requires Node.js 4.0 or higher to be installed.
MacBook: ~/projects-priv/passwords.rails$
找到灵魂
在这张票里,德拉梅科的回答
在.bashrc
中,我将导出路径的nvm部分移到顶部,如果它不是交互式shell则返回的部分上方
现在纱线起作用了。
# load nvm always
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
问题内容: 当我尝试使用以下命令触发构建时,出现以下错误: 卷曲http:// jenkins_server:port / jenkins / job / job_name / build?token = token_name 输出: 需要验证 <-您的身份验证为:您所在的匿名 组: 权限,你需要有(但没有):hudson.model.Hudson.Read …这是暗示:hudson.securi
我在服务器上得到的日志是“user[]from host localhost not have administration access#]”,但我已经更改了管理密码并用它登录。所以我不明白为什么我的用户是空的。而且,尽管我认为这与此无关,但它说证书已经过期。
问题内容: 我已经将应用程序部署到GAE。当我尝试使用http://aabbbaaacccc.appspot.com/_ah/remote_api网址时。我收到404错误页面。我已经在web.xml文件中添加了。我给了正确的应用程序ID。它部署。部署成功后,将出现一个对话框,显示未找到的文件以及记事本。 我需要将我的应用程序部署到服务器中,并与其他应用程序一起启动远程api,并共享来自其他应用程序
问题内容: 我正在做一个API,它在Heroku上。但是我只在heroku方面遇到了socket.io的一些问题,当我在本地对其进行测试时一切正常。该API完全独立于前端,因此它们位于不同的域(和不同的主机)中。问题是在生产中,我无法成功连接插座… 我有一些问题,所有这些都是关于heroku上的socket.io配置的。我知道有些帖子包含有关此信息的信息,但是我发现这些帖子使用的是旧版本的sock
我能够在本地实例上成功执行JMX文件,但在远程系统(从属)上执行失败。我使用的是最新版本的捷视通。这是我第二次面对这个问题。 你能告诉我这里有什么遗漏吗。我最初认为这是因为我已将脚本从“执行”中关闭,但这里并非如此。 我的脚本(JMX)有一个事务控制器(在线程组下),带有一些超文本传输协议请求。 从命令行执行的代码如下所示。当我从 Run 执行时,它的结果相同 sh Jmeter.sh -n -t
“C:\程序文件\SimpleNode\nssm.exe”安装SimpleNode“C:\程序文件\SimpleNode\node.exe”C:\程序文件\SimpleNode\simple.js“ 服务已安装。当我启动它时,我得到一条错误消息,服务处于暂停状态,我在事件查看器中看到以下错误: GetProcessTimes()失败:句柄无效。