On Travis CI, At what point does "cleanup" occur? - travis-ci

At what point in the build process does the deployment cleanup occur? Is it part of the deploy step, or before_deploy?
In other words, if I want to create a tarball to deploy to Github/S3, can I assume cleanup has occurred by the time Travis will run a tar command I will put in a before_deploy step? Or will cleanup not happen until after my before_deploy steps have run?

It appears cleanup occurs during deploy:
store build cache 12.69s
change detected:
/home/travis/build/zsturgess/overwatch/vendor/autoload.php
/home/travis/build/zsturgess/overwatch/vendor/autoload.php
/home/travis/build/zsturgess/overwatch/vendor/composer/autoload_real.php
/home/travis/build/zsturgess/overwatch/vendor/composer/autoload_real.php
changes detected, packing new archive
.
uploading archive
before_deploy.1 0.91s
$ composer install --no-dev --no-scripts --prefer-dist
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/travis/.phpenv/versions/5.6/bin/composer self-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies from lock file
- Removing scrutinizer/ocular (1.1.1)
- Removing guzzle/guzzle (v3.9.3)
- Removing jms/serializer (0.16.0)
- Removing phpcollection/phpcollection (0.4.0)
- Removing jms/parser-lib (1.0.0)
- Removing phpoption/phpoption (1.5.0)
- Removing jms/metadata (1.5.1)
- Removing phpunit/phpunit (4.8.7)
- Removing phpunit/php-code-coverage (2.2.3)
- Removing phpunit/php-token-stream (1.4.8)
- Removing php-mock/php-mock-phpunit (0.3)
- Removing php-mock/php-mock-integration (0.4)
- Removing php-mock/php-mock (0.8)
- Removing facebook/webdriver (1.0.2)
- Removing phpunit/phpunit-mock-objects (2.3.7)
- Removing sensio/generator-bundle (v2.5.3)
- Removing phpspec/prophecy (v1.5.0)
- Removing phpunit/php-file-iterator (1.4.1)
- Removing phpunit/php-timer (1.0.7)
- Removing phpunit/php-text-template (1.2.1)
- Removing sebastian/comparator (1.2.0)
- Removing sebastian/diff (1.3.0)
- Removing sebastian/environment (1.3.2)
- Removing sebastian/exporter (1.2.1)
- Removing sebastian/recursion-context (1.0.1)
- Removing sebastian/version (1.0.6)
- Removing liip/functional-test-bundle (1.2.2)
- Removing doctrine/doctrine-fixtures-bundle (v2.2.1)
- Removing doctrine/data-fixtures (v1.1.1)
- Removing sebastian/global-state (1.0.0)
- Removing phpdocumentor/reflection-docblock (2.0.4)
Generating autoload files
before_deploy.2 0.00s
$ cp app/config/parameters.yml.dist app/config/parameters.yml
before_deploy.3 5.77s
$ tar -czf overwatch-$TRAVIS_TAG.tar.gz app/ composer* *.md LICENSE src/ vendor/ web/
dpl.0
Fetching: dpl-1.8.2.gem (100%)
Successfully installed dpl-1.8.2
1 gem installed
18.49s
dpl.1
Installing deploy dependencies
Fetching: addressable-2.3.8.gem (100%)
Successfully installed addressable-2.3.8
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.9.1.gem (100%)
Successfully installed faraday-0.9.1
Fetching: sawyer-0.6.0.gem (100%)
Successfully installed sawyer-0.6.0
Fetching: octokit-4.1.0.gem (100%)
Successfully installed octokit-4.1.0
5 gems installed
Fetching: mime-types-2.6.2.gem (100%)
Successfully installed mime-types-2.6.2
1 gem installed
dpl.2
Preparing deploy
Logged in as Zac Sturgess
Deploying to repo: zsturgess/overwatch
Current tag is: v0.0.1-alpha.5
Ignoring path vendor/doctrine/annotations/
Ignoring path vendor/doctrine/cache/
Ignoring path vendor/doctrine/collections/
Ignoring path vendor/doctrine/common/
Ignoring path vendor/doctrine/inflector/
Ignoring path vendor/doctrine/lexer/
Ignoring path vendor/psr/log/
Ignoring path vendor/symfony/symfony/
Ignoring path vendor/twig/twig/
/usr/lib/git-core/git-stash: 186: /usr/lib/git-core/git-stash: cannot create /home/travis/build/zsturgess/overwatch/.git/logs/refs/stash: Directory nonexistent
You can see that Travis CI attempts to run a git stash after the various commands I'd put in before_deploy

Related

Rails commands in home directory result in "i18n gem is not available" error

I was in my Ubuntu home directory, trying to create a new rails app with rails new, but I got this error:
The i18n gem is not available. Please add it to your Gemfile and run bundle install
Any rails command I run gives that error. I'm really confused, because I'm not inside an application. I'm just in my home directory. There is no gemfile. I tried installing 'i18n' into my home directory with gem install 'i18n', and it worked, but I'm still getting that error.
I've never had any problems with rails commands in my home directory before. Everything rails-related works normally when I cd into my individual apps. What's going on?
Also, I'm now getting the same error in all my existing rails apps. Did rails suddenly become reliant on that gem? Or could deleting the gem in my home directory somehow have made it unavailable in my apps?
UPDATE
I tried gem cleanup rails and reinstalling, but nothing changed. Here was the result:
$ gem cleanup rails
Cleaning up installed gems...
Attempting to uninstall rails-4.0.10
Successfully uninstalled rails-4.0.10
Attempting to uninstall rails-4.2.1
Successfully uninstalled rails-4.2.1
Attempting to uninstall rails-4.2.4
Successfully uninstalled rails-4.2.4
Attempting to uninstall rails-5.0.1
Successfully uninstalled rails-5.0.1
Attempting to uninstall rails-5.0.2
Successfully uninstalled rails-5.0.2
Attempting to uninstall rails-5.0.3
Successfully uninstalled rails-5.0.3
Attempting to uninstall rails-5.0.4
Successfully uninstalled rails-5.0.4
Clean Up Complete
$ gem install rails -v 5.0.1
Fetching: rails-5.0.1.gem (100%)
Successfully installed rails-5.0.1
Parsing documentation for rails-5.0.1
Installing ri documentation for rails-5.0.1
Done installing documentation for rails after 1 seconds
1 gem installed
$ rails -v
The i18n gem is not available. Please add it to your Gemfile and run bundle install
UPDATE 2
I had previously manually installed i18n and I thought that might be the problem so I uninstalled both rails and i18n and reinstalled rails. But I'm still getting the error:
$ gem uninstall rails --all
You have requested to uninstall the gem:
rails-5.0.1
browser-2.3.0 depends on rails (>= 0, development)
browser-1.1.0 depends on rails (>= 0, development)
browser-0.9.1 depends on rails (>= 0, development)
carrierwave-1.2.1 depends on rails (>= 4.0.0, development)
carrierwave-1.0.0 depends on rails (>= 4.0.0, development)
rails_serve_static_assets-0.0.5 depends on rails (>= 3.1, development)
rails_serve_static_assets-0.0.4 depends on rails (>= 3.1, development)
sass-rails-4.0.5 depends on rails (>= 0, development)
sunspot_rails-2.2.7 depends on rails (>= 3)
twitter-typeahead-rails-0.10.5 depends on rails (>= 3.1, development)
yaml_db_improved-1.0.1 depends on rails (>= 0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled rails-5.0.1
$ gem uninstall i18n --all
You have requested to uninstall the gem:
i18n-0.9.1
activesupport-5.1.4 depends on i18n (~> 0.7)
activesupport-5.0.5 depends on i18n (~> 0.7)
activesupport-5.0.4 depends on i18n (~> 0.7)
activesupport-5.0.3 depends on i18n (~> 0.7)
activesupport-5.0.2 depends on i18n (~> 0.7)
activesupport-5.0.1 depends on i18n (~> 0.7)
activesupport-4.2.4 depends on i18n (~> 0.7)
activesupport-4.2.1 depends on i18n (~> 0.7)
activesupport-4.0.10 depends on i18n (>= 0.6.9, ~> 0.6)
capistrano-3.8.0 depends on i18n (>= 0)
capistrano-3.7.2 depends on i18n (>= 0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled i18n-0.9.1
$ gem install rails --version 5.0.1
Fetching: i18n-0.9.1.gem (100%)
Successfully installed i18n-0.9.1
Fetching: rails-5.0.1.gem (100%)
Successfully installed rails-5.0.1
Parsing documentation for i18n-0.9.1
Installing ri documentation for i18n-0.9.1
Parsing documentation for rails-5.0.1
Installing ri documentation for rails-5.0.1
Done installing documentation for i18n, rails after 4 seconds
2 gems installed
$ rails -v
The i18n gem is not available. Please add it to your Gemfile and run bundle install
/home/user/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:2278:in `check_version_conflict': can't activate activesupport-5.1.4, alrea
...
Try gem install rails again. Or gem install rails -v 5.0 to install a specific version.
It appears you somehow don't have rails and it's dependencies fully installed. Perhaps because you reinstalled ruby or installed a different ruby version. If i'm right that's what's going on, just reinstall the latest version of rails or the version you want, and everything needed will be there again.
Are you using any version manager, rvm or rbenv? You should use this to prevent any mismatch in installing libraries and ensuring your packages are ordered.
I will suggest you to remove anything Ruby related and install Rbenv first. A quick search with that error, I found it mostly relates to RVM. I could be wrong though but try with Rbenv. Use Rbenv to setup Ruby in your Ubuntu. Here is a link for Rbenv in Ubuntu 16.04
Also, why not try to create a Gemfile and actually add gem 'i18n', '~> 0.7.0'.
Then run bundle install. If it says it is gem locked, use bundle update i18n
What does it say?
And also, what do you get with which -a ruby
You might have multiple versions of rails installed. Maybe try running gem cleanup rails
For more information on the command see gem cleanup --help
Edit: and then of course you'd have to install rails again. Either latest stable version or whichever you prefer.
UPDATE
Looking at your output of gem install it doesn't seem to install any of the dependencies, so it assumes you have i18n installed already.
Here is what you can do:
Check out which versions you have installed. Run gem list | grep i18n and grep rails respectively.
Remove all versions of these gems via gem uninstall i18n --all and gem uninstall rails --all respectively
Install rails gem install rails --version 5.0.1 and it should output Successfully installed i18n-0.9.1 during the install process.
Here's my output:
# blank slate
$ rails -v
Rails is not currently installed on this system.
# successful rails install
$ gem install rails -v 5.0.1
...
Fetching: i18n-0.9.1.gem (100%)
Successfully installed i18n-0.9.1
...
35 gems installed
# verify installed gems
$ gem list | grep rails
rails (5.0.1)
...
$ gem list | grep i18n
i18n (0.9.1)
# break i18n
$ gem uninstall i18n --all
You have requested to uninstall the gem:
i18n-0.9.1
activesupport-5.0.1 depends on i18n (~> 0.7)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled i18n-0.9.1
$ rails -v
/Users/me/.rvm/rubies/ruby-2.3.6/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:308:in `to_specs': Could not find 'i18n' (~> 0.7) among 51 total gem(s) (Gem::MissingSpecError)
# fix i18n and rails
$ gem uninstall rails --all
Successfully uninstalled rails-5.0.1
$ gem uninstall i18n --all
$ gem install rails --version 5.0.1
Fetching: i18n-0.9.1.gem (100%)
Successfully installed i18n-0.9.1
Fetching: rails-5.0.1.gem (100%)
Successfully installed rails-5.0.1
2 gems installed
# working again
$ rails -v
Rails 5.0.1
So I still don't understand exactly what was happening, but I uninstalled rails using gem uninstall rails and then reinstalled it with just gem install rails, and rails commands now work. Apparently the problem wasn't even really related to i18n. I'm at a total loss. At least it works now!
The problem is with i8ln in the the place where ruby is installed.
For example
Ruby2.3.3\lib\ruby\gems\2.3.0\gems
Try to reinstall ruby and try.
Make sure you clear all ruby files before you do a fresh install.
I was getting the same error after a messy merge on a rails 6.1.4.7 project.
I ran gem uninstall rails , switched the rails version to 7.0.4 in the Gemfile and ran bundle update. After that, all rails commands seem to be working fine.

AWS Rails install fails: activesupport requires Ruby version >= 2.2.2

I am installing rails 5 on aws. I have installed rvm and ruby. Ruby version I installed is 2.3.1. I have done bundle install.
Now I am trying to install rails 5 by using command - 'sudo gem install rails --version 5.0.0'
But I am getting error
ERROR: Error installing rails:
activesupport requires Ruby version >= 2.2.2.
rvm list
=* ruby-2.3.1 [ x86_64 ]
Complete log on running command - 'sudo gem install rails --version 5.0.0'
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.10.1.gem (100%)
Successfully installed minitest-5.10.1
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: activesupport-5.0.0.gem (100%)
ERROR: Error installing rails:
activesupport requires Ruby version >= 2.2.2.
Why it is showing ruby version required >= 2.2.2 ? What should I do here?
Since you are using rvm, you should install gems for the current user. That means without sudo.
gem install rails --version 5.0.0

travis ci rails build error when installing momentJS

I'm trying to incorporate travis ci in my project, the travis console output shows
An error occurred while installing momentjs-rails (2.11.0), and Bundler cannot
continue.
Make sure that `gem install momentjs-rails -v '2.11.0'` succeeds before
bundling.
even though in my .travis.yml I have
language: ruby
rvm:
- 2.2.1
before_install:
- gem update --system
- gem --version
- gem install momentjs-rails -v '2.11.0'
when I check the before install for moment js, it does say that
Fetching: momentjs-rails-2.11.0.gem (100%)
Successfully installed momentjs-rails-2.11.0
19 gems installed
so why is my build still getting the error with this gem?

How to get the example of MSCollectionViewCalendarLayout working

I downloaded the MSCollectionViewCalendarLayout and now I wanted to try out the example. If I open the Example.xcodeproj I only get errors e.g.
Lexical or Preprocessor Issue 'RestKit/RestKit.h' file not found
I tried the tip from the troubleshooting guide to change the project settings but it didn't worked. If I open the Example.xcworkspace I also only get errors.
Seems that the libraries are outdated. Is there a chance to get this project running?
Edit:
Now I tried to install cocoapods. I created a .profile file in my home directory (where Documents, Desktop, Downloads resides in). I put this text into the file
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
and then I run
gem install cocoapods --user-install
Because he didn't do something (was in the next line in terminal) I pressed q. Then he did something and I got the following warning
WARNING: You don't have /Users/my-user/.gem/ruby/2.0.0/bin in your
PATH, gem executables will not run.
Full output of terminal
Fetching: i18n-0.7.0.gem (100%)
WARNING: You don't have /Users/my-user/.gem/ruby/2.0.0/bin in your PATH,
gem executables will not run.
qSuccessfully installed i18n-0.7.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: minitest-5.6.1.gem (100%)
Successfully installed minitest-5.6.1
Fetching: activesupport-4.2.1.gem (100%)
Successfully installed activesupport-4.2.1
Fetching: nap-0.8.0.gem (100%)
Successfully installed nap-0.8.0
Fetching: fuzzy_match-2.0.4.gem (100%)
Successfully installed fuzzy_match-2.0.4
Fetching: cocoapods-core-0.37.1.gem (100%)
Successfully installed cocoapods-core-0.37.1
Fetching: claide-0.8.1.gem (100%)
Successfully installed claide-0.8.1
Fetching: colored-1.2.gem (100%)
Successfully installed colored-1.2
Fetching: xcodeproj-0.24.1.gem (100%)
Successfully installed xcodeproj-0.24.1
Fetching: cocoapods-downloader-0.9.0.gem (100%)
Successfully installed cocoapods-downloader-0.9.0
Fetching: cocoapods-plugins-0.4.2.gem (100%)
Successfully installed cocoapods-plugins-0.4.2
Fetching: cocoapods-try-0.4.4.gem (100%)
Successfully installed cocoapods-try-0.4.4
Fetching: netrc-0.7.8.gem (100%)
Successfully installed netrc-0.7.8
Fetching: cocoapods-trunk-0.6.0.gem (100%)
Successfully installed cocoapods-trunk-0.6.0
Fetching: molinillo-0.2.3.gem (100%)
Successfully installed molinillo-0.2.3
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: cocoapods-0.37.1.gem (100%)
Successfully installed cocoapods-0.37.1
Parsing documentation for i18n-0.7.0
Installing ri documentation for i18n-0.7.0
Parsing documentation for thread_safe-0.3.5
Installing ri documentation for thread_safe-0.3.5
Parsing documentation for tzinfo-1.2.2
Installing ri documentation for tzinfo-1.2.2
Parsing documentation for minitest-5.6.1
Installing ri documentation for minitest-5.6.1
Parsing documentation for activesupport-4.2.1
unable to convert "\x84" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping
Installing ri documentation for activesupport-4.2.1
Parsing documentation for nap-0.8.0
Installing ri documentation for nap-0.8.0
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for cocoapods-core-0.37.1
Installing ri documentation for cocoapods-core-0.37.1
Parsing documentation for claide-0.8.1
Installing ri documentation for claide-0.8.1
Parsing documentation for colored-1.2
Installing ri documentation for colored-1.2
Parsing documentation for xcodeproj-0.24.1
Installing ri documentation for xcodeproj-0.24.1
Parsing documentation for cocoapods-downloader-0.9.0
Installing ri documentation for cocoapods-downloader-0.9.0
Parsing documentation for cocoapods-plugins-0.4.2
Installing ri documentation for cocoapods-plugins-0.4.2
Parsing documentation for cocoapods-try-0.4.4
Installing ri documentation for cocoapods-try-0.4.4
Parsing documentation for netrc-0.7.8
Installing ri documentation for netrc-0.7.8
Parsing documentation for cocoapods-trunk-0.6.0
Installing ri documentation for cocoapods-trunk-0.6.0
Parsing documentation for molinillo-0.2.3
Installing ri documentation for molinillo-0.2.3
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for cocoapods-0.37.1
Installing ri documentation for cocoapods-0.37.1
19 gems installed
Then I reopened the Xcode example, but I'm still getting the error that RestKit.h can't be found. What I'm doing wrong?
Edit 2:
Now I tried to use pod install in the example directory, but the pod command was not found. So I edited the PATH in .profile to this
export PATH=$GEM_HOME/ruby/2.0.0/bin:$PATH
Then I restarted terminal and run the command again
Analyzing dependencies
Creating shallow clone of spec repo `master` from `https://github.com/CocoaPods/Specs.git`
Fetching podspec for `MSCollectionViewCalendarLayout` from `../`
Downloading dependencies
Installing AFNetworking 1.3.3 (was 1.3.3)
Installing CupertinoYankee 0.1.1 (was 0.1.1)
Installing ISO8601DateFormatterValueTransformer (0.5.0)
Using MSCollectionViewCalendarLayout (0.1.3)
Installing Masonry 0.4.0 (was 0.4.0)
Installing RKValueTransformers (1.0.1)
Installing RestKit 0.22.0 (was 0.22.0)
Installing SOCKit 1.1 (was 1.1)
Installing TransitionKit 2.0.0 (was 2.0.0)
Installing UIColor-HexString (1.0.1)
Generating Pods project
Integrating client project
Afterwards I opened Example.xcworkspace and got the error described by Jakub Vano. Then I unlocked and edited the MASUtilities.h according to this link (commented enum and added the static const).
Now I got the project running!
You need to re-install CocoaPods for Example project:
run pod install in the Example project directory
run the project from the .xcworkspace
There will still be compile errors caused by known issue with Masonry - as mentioned on linked issue, workaround is to replace problematic enum with
typedef float MASLayoutPriority;
static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired;
static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh;
static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500;
static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow;
static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel;

paperclip 2.7.0 on ruby 1.8.7

I have a very old rails app (rails 2.3.10 and ruby 1.8.7) and we want to move it on another server.
I can reinstall all gems with same version except for paperclip 2.7.
when i tried to install it i receive an error on activesupport, that it seems it require ruby 1.9.3. According with paperclip doc this shouldn't happens, some one of you can help me?
i tried with all gems except paperclip, with no gems, and installing an old version of activesupport. Below you can find my tests.
app#new-server:/home/app/current# sudo gem list
*** LOCAL GEMS ***
app#new-server:/home/app/current# sudo gem install paperclip -v=2.7.0
Fetching: i18n-0.6.4.gem (100%)
Successfully installed i18n-0.6.4
Fetching: multi_json-1.7.7.gem (100%)
Successfully installed multi_json-1.7.7
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.37
Fetching: minitest-4.7.5.gem (100%)
Successfully installed minitest-4.7.5
Fetching: atomic-1.1.10.gem (100%)
Building native extensions. This could take a while...
Successfully installed atomic-1.1.10
Fetching: thread_safe-0.1.0.gem (100%)
Successfully installed thread_safe-0.1.0
ERROR: Error installing paperclip:
activesupport requires Ruby version >= 1.9.3.
I also tried to install activesupport 2.3.10 (that according with paperclip doc match requirements but i receive the same error
"activesupport requires Ruby version >= 1.9.3."
regards
Mauro
You will have to build the gem manually and use the file from the pull request here: https://github.com/thoughtbot/paperclip/pull/1270. - Ralph

Resources