I tried to deploy my rails project to elastic beanstalk. However, the commands in the .ebextensions folder did not run. I am sure it did not run because I have a gem as such:
gem 'ckeditor', github: 'galetahub/ckeditor'
It requires git to clone the gem, and my deployment are failing at this exact point.
[Instance: i-000294aa0a767f205] Command failed on instance. Return code: 11 Output: (TRUNCATED)...t error: command `git clone 'https://github.com/galetahub/ckeditor.git'
"/opt/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/cache/bundler/git/ckeditor-1fd593e0d9f7d7cbd0713285fc8f7edcb38af06e"
I tried YAML linting and the file has no syntax error.
I checked the file location is also correct.
What is not working?
Thanks to this thread on reddit, I need to commit or at least stage the files
Related
I'm presently trying to deploy a Rails API onto Elastic Beanstalk. It will not deploy due to the gemfile not being found. See log out put below:
[INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0",
"results":[{"status":"FAILURE","msg":"Engine execution has encountered
an error.","returncode":1,"events":[{"msg":"Instance deployment:
You didn't include a 'Gemfile' in your source bundle. The deployment
didn't install any Ruby gems.","timestamp":1601055941,"severity":"INFO"},
{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1601055944,"severity":"ERROR"}]}]}
I have tried doing bundle package in terminal so the cache gem file is used under vendor/bundle and it still doesn't not work.
Anyone have any ideas?
Trying to bundle install a gem from github (The author has not updated the gem on rubygems.org for whatever reason...) in AWS Elastic Beanstalk but I receive the following error:
Command failed on instance. R
(TRUNCATED)...nd `git clone "https://github.com/Diego81/omnicontacts.git"
Here's the code in my gemfile
gem 'omnicontacts', git: "https://github.com/Diego81/omnicontacts.git"
Other things i've tried...
gem 'omnicontacts', git: "git://github.com/Diego81/omnicontacts.git"
gem 'omnicontacts', github: "Diego81/omnicontacts"
Still the same error with everything I've tried. I've also tried this with other gems and I receive the same error. I should also note, this works perfectly on my local machine, it seems to be an issue with Elastic Beanstalk.
Ok I solved this by installing git on my EC2 instance. Just ssh into your instance and run the following:
sudo yum install git
and that should fix the problem.
I prefer this answer which adds Git to .ebextensions. That way if I have e.g. a production server and a staging server, I don't have to separately SSH into both, I can just deploy to each and Git will be installed automatically.
The ebextensions approach also seems more durable. If for some reason I need to spin up a new server instance in the future, I'd rather have the configuration saved as code than have to remember what the configuration is supposed to be and then manually implement the configuration.
I was able to get what I needed by creating a file called .ebextensions/ruby.config with the following content:
packages:
yum:
git: []
My Gemfile for my rails app has a gem that I'm pulling off of Github using the following entry;
gem 'markable', github: 'chrome/markable'
I have a lot of other gems in the Gemfile but if I remove this one line it works fine so clearly this line is the issue.
This is the deploy output:
$ eb deploy
Creating application version archive "899e".
Uploading: [##################################################] 100% Done...
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: [Instance: i-8c21232c] Command failed on instance. Return code: 11 Output: (TRUNCATED)...ps://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
You need to install git to be able to use gems from git repositories. For help
installing git, please refer to GitHub's tutorial at
https://help.github.com/articles/set-up-git.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-8c21232c'. Aborting the operation.
ERROR: Failed to deploy application.
How do I get EB to correctly pull that gem or fix it so that this works?
I see other similar questions but they are old at this point and often refer to a .ebextensions/ruby.config file which doesn't exist anywhere in my system.
Thoughts?
I have upgraded to Capistrano3 and followed the steps in the capistrano3 documentation but still get the error LoadError: cannot load such file -- config/deploy
I am sure that I am using Capistrano 3; here is my config/deploy.rb: http://pastie.org/9483501
full log : http://pastie.org/9483504
The uprade docs say:
We recommend to capify the project from scratch and move definitions
from old to new configs then.
mkdir old_cap
mv Capfile old_cap
mv config/deploy.rb old_cap
mv config/deploy/ old_cap # --> only for multistage setups
cap install
I did this, got my new capfiles, and then followed the preparing your application doc to set everything up again with the new v3 syntax, and it all worked.
i have checked out a rails project into my svn repository.now i want to run that project on my local server.I entered rails server command to run it but i am getting an error that it cant find or read .yml file.what are the steps to be taken after one checks out some rails project in order to run it on local server.
cd into the directory containing the Gemfile and then do either rails s or bundle exec rails s. The error you are describing usually happens to me when I am not in the same dir as the Gemfile and Rails cannot find the database.yml file.