How to fill in the AWS data for storage.yml - ruby-on-rails-3

I want to push a Ruby on Rails app to heroku. But it gets stuck.
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
remote: Bundler Output: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to pure-crag-52432.
remote:
To https://git.heroku.com/pure-crag-52432.git
! [remote rejected] user-microposts -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pure-crag-52432.git'
Apart from the fact that I don't know why heroku asks for the aws-eventstream-1.1.0 gem (because it is not in the Gemfile). I am not sure in how to fill in the field below for the storage.yml as given in this guide:
.
amazon:
service: S3
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
region: <%= ENV['AWS_REGION'] %>
bucket: <%= ENV['AWS_BUCKET'] %>
Should I just leave it as it is and will the heroku configuration automatically be linked to this file?
I tried this (of course I changed all the answers a bit):
amazon:
service: S3
access_key_id: AKIAXOOFZZFFKMQD3CFD
secret_access_key: Cj8BcL452tDer5ryTPBRlan5LHOq76WXgvTDHmvc
region: region=eu-east-3
bucket: rails-tutorial-joost
These are my Heroku configurations:
➜ sample_app git:(user-microposts) heroku config
› Warning: heroku update available from 7.42.2 to 7.42.6.
=== pure-crag-52432 Config Vars
AWS_ACCESS_KEY_ID: AKIAXOOFOGFKKMQD3CFE
AWS_BUCKET: rails-tutorial-joost
AWS_REGION: region=eu-east-3
AWS_SECRET_ACCESS_KEY: Ci8BcL452tcxDer5ryTPBRlan5LHOq76WXgvTDHmvc
DATABASE_URL: postgres://blohftwliwefcg:6cfd2ccz2cc27301f86a1fe3c4686bb77784e67a62312d55c7e5751dfd61331c156#ec2-34-192-173-173.compute-1.amazonaws.com:5432/davr7msm9qlqh1
LANG: en_US.UTF-8
RACK_ENV: production
RAILS_ENV: production
RAILS_LOG_TO_STDOUT: enabled
RAILS_MASTER_KEY: ./config/credentials/production.key
RAILS_SERVE_STATIC_FILES: enabled
SECRET_KEY_BASE: 32c6c8d057cc6c61071f18429e64zxczxc337d795bfa81abd04ed3e74377eff9e6cddb024967e6a0ffb9bc7de55b408ad71291ab5e518bcfe20bb5a7b44871d570cc61
SENDGRID_PASSWORD: bdsk6q67625964
SENDGRID_USERNAME: appasd6786712#heroku.com
I found a solution at the site of the heroku helpcenter:
If you are getting this output while upgrading:
remote: Bundler Output: You are trying to install in deployment mode after changing
remote: your Gemfile. Run bundle install elsewhere and add the
remote: updated Gemfile.lock to version control.
But locally running bundle install does not change your Gemfile.lock please make sure you’re using a recent version of bundler locally. We recommend 1.13.7 or above. Once you have upgraded your local bundler version please re-run bundle install and commit the results to git before deploying again.
If running bundle install and committing the results does not resolve the issue, check to see if you have any custom gem sources that use an ENV var. For example:
source "https://#{ENV['GEMFURY_URL'}#gem.fury.io/some-value-here/"
If you are using an ENV var to specify a username or password for a source in your Gemfile, make sure you are running bundle install locally with the same ENV var. Also verify and that the full URL including any username or password is present in your Gemfile.lock after bundling.
If you do not wish for your username and password to be checked into git, consider using bundler’s built in support for configuring username and password via a special ENV var.
Specifying BUNDLE_GEMFILE with relative path may not work https://github.com/bundler/bundler/pull/5815.

Related

Unable to push to Heroku, failed to compile chromedriver app

All of a sudden I am unable to push my code to Heroku via git push heroku master.
This is the error that I'm getting:
remote: Archive: /tmp/chromedriver.zip
remote: End-of-central-directory signature not found. Either this file is not
remote: a zipfile, or it constitutes one disk of a multi-part archive. In the
remote: latter case the central directory and zipfile comment will be found on
remote: the last disk(s) of this archive.
remote: unzip: cannot find zipfile directory in one of /tmp/chromedriver.zip or
remote: /tmp/chromedriver.zip.zip, and cannot find /tmp/chromedriver.zip.ZIP, period.
remote: ! Push rejected, failed to compile chromedriver app.
remote:
remote: ! Push failed
The buildpacks I am using are heroku/python, https://github.com/heroku/heroku-buildpack-google-chrome, and https://github.com/heroku/heroku-buildpack-chromedriver. I am using the Selenium ChromeDriver in my app. My app is running on one worker dyno. Any ideas? Thanks!

The pod `TensorFlow-experimental` is not found

I download the tensorflow from https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/ios
And then install it step by step.
When I install pod, there is an ERROR:
Is the TensorFlow-experimental being renamed or Somethins wrong ?
I had the same issue. I ended up reinstalling and updating to the most current version of CocoaPods(1.2.1)
tensorflow/examples/ios/simple/ $ pod install
Analyzing dependencies
[!] Unable to find a specification for `TensorFlow-experimental`
tensorflow/examples/ios/simple/ $ pod repo remove master
Removing spec repo `master`
tensorflow/examples/ios/simple/ $ pod setup
Setting up CocoaPods master repo
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 1342352, done.
remote: Compressing objects: 100% (2372/2372), done.
remote: Total 1342352 (delta 1560), reused 2050 (delta 796), pack-reused 1339018
Receiving objects: 100% (1342352/1342352), 405.31 MiB | 370.00 KiB/s, done.
Resolving deltas: 100% (673537/673537), done.
Checking out files: 100% (162776/162776), done.
CocoaPods 1.3.0.beta.1 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.3.0.beta.1
Setup completed
tensorflow/examples/ios/simple/ $ pod install
Analyzing dependencies
Downloading dependencies
Installing TensorFlow-experimental (1.1.1)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `tf_simple_example.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
tensorflow/examples/ios/simple/ $ pod --version
1.2.1
You can add the repo search path to the head of your Podfile.
source 'git#git#github.com:CocoaPods/Specs.git'
And pod install again.
Close Xcode.
In terminal at root of project, where the pod file lives,
issue command "pod update"
first time, and after any update.
MacBook-Pro-2:camera $ pod install
Analyzing dependencies
[!] Unable to find a specification for `TensorFlow-experimental`
MacBook-Pro-2:camera $ pod update
Update all pods
Updating local specs repositories
$ /usr/bin/git -C /Users/XXXXXX/.cocoapods/repos/master fetch origin
--progress
remote: Counting objects: 2006922, done.
remote: Compressing objects: 100% (403/403), done.
remote: Total 2006922 (delta 3740), reused 3789 (delta 3625), pack-reused 2002871
Receiving objects: 100% (2006922/2006922), 511.53 MiB | 665.00 KiB/s, done.
Resolving deltas: 100% (1146145/1146145), completed with 960 local objects.
From https://github.com/CocoaPods/Specs
58e4aaa8dab..224ab2278f7 master -> origin/master
* [new branch] backz -> origin/backz
* [new branch] predates_sharding_branch -> origin/predates_sharding_branch
* [new branch] swift_version_support -> origin/swift_version_support
* [new tag] v0.32.1 -> v0.32.1
* [new tag] 20161019 -> 20161019
$ /usr/bin/git -C /Users/XXXXXXX/.cocoapods/repos/master rev-parse
--abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/XXXXXXX/.cocoapods/repos/master reset --hard
origin/master
HEAD is now at 224ab2278f7 [Add] Taplytics_tvOS 2.25.2
warning: inexact rename detection was skipped due to too many files.
Analyzing dependencies
Downloading dependencies
Installing TensorFlow-experimental (1.1.1)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `tf_camera_example.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

Duplicate assets after deployment of app in Heroku

I'm very new with rails development and deployment using Heroku.
So recently I found that some JavaScript files that seems to be duplicated. For example I made a javascript function in one file (sample.js), then I erased this file, and I put the function inside of application.js.
Under my test development, it works perfect. But then when I commit the changes to heroku, I end up having the same function twice!
The javascript files are under the folder /app/assets/javascripts/
So how can I tell heroku to remove the duplicate files?
Am I missing some step before sending new version of my app to heroku?
Any help will be greatly appreciated
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
Rails 3.1.0
You're only deleting files from the repo when you use the git rm command. Even if you delete the actual file, it's still in the repo, and won't be changed by the git add -f * command (which only adds changed files).
You should be able to remove the file from heroku by running these commands:
$ git rm app/assets/javascripts/sample.js
$ git commit -m 'your commit message'
$ git push heroku master

The --deployment flag requires a Gemfile.lock

I have spent couple of hours but unable to solve this problem.
When I try to deploy my local rails app to production server using capistrano I get the below error:
The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying.
Any idea on how to solve this?
My rails application folder is under version control using Git. I have pushed the local git repo to github and the Gemfile.lock is there on github. So it is under version control. However capistrano continues to give the same error.
Deploy.rb file: https://gist.github.com/brahmadpk/4748991
Remove BUNDLE_FROZEN: "true" from .bundle/config file and run bundle again.
Make sure there is nothing in the releases folder that is not a release. See this comment on a bundler issue for more details.
This blogpost titled Capistrano Deployment Trouble explains the same issue.
EDIT TO INCLUDE CONCLUSION FROM DISCUSSION IN COMMENTS
The deploy_to param was not set to an absolute path; hence capistrano wasn't able to find the folder to deploy, causing this error message.
I solve this with:
set :bundle_gemfile, "your_app_name/Gemfile"
in the deploy.rb
Run bundle and add your Gemfile.lock to your version control.
I had the same problem, even though I had no files or folders in the releases folder. Turned out it was a silly little thing: the gemfile.lock file in my repo was in lowercase for some reason, while capistrano needs Gemfile.lock with a capital G.
This is how I solved it:
Delete gemfile.lock
Delete gemfile.lock from you repo (git rm ...)
run bundle install
add the new Gemfile.lock file to your repo: git add Gemfile.lock
remove the folders from the server (don't know if this is really needed, did it anyway)
deploy
After adding bundle config unset deployment this line in the terminal, bundle install started working again for me.
I am getting exactly the same problem.
There is nothing in my releases folder (at all - my deploy cold keeps rolling back).
My gemfile.lock is checked in to Subversion.
I get:
** [out :: localhost] The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying.
Is there any way to stop the rollback so that I can see what the releases folder looks like at the time it tries to run
cd /var/qlarity/releases/20130222003607 && bundle install --gemfile /var/qlarity/releases/20130222003607/Gemfile --path /var/qlarity/shared/bundle --deployment --quiet --without development test
Later....
I found that I could prevent the rollback by commenting out the code as shown from
gems\capistrano-2.14.1\lib\capistrano\recipes\deploy.rb
task :update_code, :except => { :no_release => true } do
# on_rollback { run "rm -rf #{release_path}; true" }
strategy.deploy!
finalize_update
end
This enabled me to examine my releases folder and sure enough, there was no Gemfile.lock in it. Turns out I have ended up with an unnecessary folder in my Rails project file structure so that instead of
myapp/trunk/app
myapp/trunk/config
...
myapp/trunk/Gemfile
I had
myapp/trunk/myapp/app
myapp/trunk/myapp/config
...
myapp/trunk/myapp/Gemfile
This meant I ended up with a folder containing my Gemfile
releases/nnnn/myapp
and bundle was looking for Gemfile in
releases/nnnn
When I changed my Capistrano config from
deploy.rb
set :repository, "file:///D:/_SVN//myapp/trunk"
to
deploy.rb
set :repository, "file:///D:/_SVN//myapp/trunk/myapp"
now all is good. Really should look at fixing the folder structure next!

Middlemanapp: unknown extension

I run from console:
middleman build
and i get
== Unknown Extension: smusher
== Unknown Extension: favicon_maker
my Gemfile
source :rubygems
gem "middleman", "~>3.0.0"
gem "middleman-smusher"
gem "middleman-favicon-maker"
i run bundle install and bundle update.
What could the problem be here?
Inside the root of your project should be a config.rb file. Within that file you should add two extensions to the build configuratio:
configure :build do
activate :smusher
activate :favicon_maker
end
Middleman configuration Guide