0

openshift で github から gem をインストールすることは可能ですか? 私のGemfileには以下が含まれています:

gem 'rails3-jquery-autocomplete', git: 'git@github.com:/francisd/rails3-jquery-autocomplete.git'

それをopenshiftにプッシュした後、次のエラーを受け取りました:

remote: Bundling RubyGems based on Gemfile/Gemfile.lock to repo/vendor/bundle with 'bundle install --deployment'
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching gem metadata from https://rubygems.org/..
remote: Fetching git@github.com:/francisd/rails3-jquery-autocomplete.git
remote: Host key verification failed.
remote: fatal: Could not read from remote repository.
remote: 
remote: Please make sure you have the correct access rights
remote: and the repository exists.
remote: Git error: command `git clone 'git@github.com:/francisd/rails3-jquery-autocomplete.git' "/var/lib/openshift/524352534a050e34/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/cache/bundler/git/rails3-jquery-autocomplete-478b4e668116f8a9987a8288cfe611825d6577a8" --bare --no-hardlinks` in directory /var/lib/openshift/524352534a050e34/app-root/runtime/repo has failed.
remote: An error occurred executing 'gear postreceive' (exit code: 11)
remote: Error message: Failed to execute: 'control build' for /var/lib/openshift/524352534a050e34/ruby
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.

ssh ログインして「RAILS_ENV=production bundle install」を実行した後:

[thankz-snusmu.rhcloud.com repo]\> RAILS_ENV=production bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Fetching git@github.com:/francisd/rails3-jquery-autocomplete.git
The authenticity of host 'github.com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/var/lib/openshift/524352534a050e34/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Git error: command `git clone 'git@github.com:/francisd/rails3-jquery-autocomplete.git' "/var/lib/openshift/524352534a050e34/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/cache/bundler/git/rails3-jquery-autocomplete-478b4e668116f8a9987a8288cfe611825d6577a8" --bare --no-hardlinks` in directory /var/lib/openshift/524352534a050e34/app-root/runtime/repo has failed.

次に、https://www.openshift.com/forums/openshift/failed-to-add-the-host-to-the-list-of-known-hosts-on-openshift-itselfで説明されている手順に従って、既知のホストを修正しましたアクセスの問題

[thankz-snusmu.rhcloud.com repo]\> mkdir -p $OPENSHIFT_DATA_DIR/.ssh/ 
[thankz-snusmu.rhcloud.com repo]\> echo -e "#\041/bin/sh\n/usr/bin/ssh -o \"UserKnownHostsFile=$OPENSHIFT_DATA_DIR/.ssh/known_hosts\" \"\$@\"" > $OPENSHIFT_DATA_DIR/my_ssh_wrapper 
[thankz-snusmu.rhcloud.com repo]\> chmod +x  $OPENSHIFT_DATA_DIR/my_ssh_wrapper
[thankz-snusmu.rhcloud.com repo]\> export GIT_SSH=$OPENSHIFT_DATA_DIR/my_ssh_wrapper

しかし、私はまだ同様のエラーを受け取ります...

[thankz-snusmu.rhcloud.com repo]\> git clone 'git@github.com:/francisd/rails3-jquery-autocomplete.git' "/var/lib/openshift/524352534a050e34/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/cache/bundler/git/rails3-jquery-autocomplete-478b4e668116f8a9987a8288cfe611825d6577a8" --bare --no-hardlinks
Cloning into bare repository '/var/lib/openshift/524352534a050e34/app-root/runtime/repo/vendor/bundle/ruby/1.9.1/cache/bundler/git/rails3-jquery-autocomplete-478b4e668116f8a9987a8288cfe611825d6577a8'...
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
4

1 に答える 1

0

私が見つけた 1 つのオプションは、Gem を Rails アプリにフリーズすることです。

  1. mkdir -p vendor/gems && cd vendor/gems/
  2. git クローン git@github.com:/francisd/rails3-jquery-autocomplete.git
  3. 以下を含むように Gemfile を設定します。

    gem 'rails3-jquery-autocomplete', path:'vendor/gems/rails3-jquery-autocomplete'

  4. cd ../../ && バンドル インストール

于 2013-09-18T16:33:06.353 に答える