Travis-CI "The command "bundle exec rake" exited with 1." + mystery 404 error - ruby-on-rails-4

bundle exec rake runs all tests perfectly fine locally. However, Travis CI keeps blowing up with Problem accessing /authentication without giving much more info to go on. Here's one of the failed builds: https://travis-ci.org/Nase00/Horizon/builds/48094102 For the life of me, I cannot figure out what is causing an authentication error when Travis tries to run bundle exec rake.
Here's the project repo: https://github.com/Nase00/Horizon

I'm not sure what version of Neo4j Travis uses (UPDATE: they use 1.9.4, not supported) but I'm going to guess that it's a bit older than what Neo4j.rb supports. I'm one of the core maintainers and built the Neo4j 2.2 auth support that's fouling you up, but I tested it with different versions, going back to the early 2.1 subversions and had no trouble.
The best practice is to not use Travis's Neo4j at all. Instead, configure Travis to install the same version of the database you're using for dev and production. As a bonus, the rake task that installs Neo also disables auth in 2.2, so you don't have to deal with that at all. It's not that we're against auth, it's that we think of the rake install and config tasks as convenient features for dev/test environment, not production, so no auth seems like a reasonable default.
Take a peak at our .travis.yml file to see how we do the installation. https://github.com/neo4jrb/neo4j/blob/master/.travis.yml. An abstract that'll solve your issue:
script:
- "bundle exec rake neo4j:install['community-2.2.0-M02'] neo4j:start default --trace"
language: ruby
rvm:
- 2.0.0
Swap the community-2.2.0-M02 for whatever version you want to use. I'd have to check again but from what I remember, we are compatible with versions as far back as 2.1.2. I apologize for this not being posted in our docs -- it should be.
I very strongly recommend using Ruby 2.2.0 with Neo4j.rb. We generate a lot of symbols during Cypher queries that won't be garbage collected otherwise.
EDIT for a little more info
The very first thing the auth module does is check for the presence of the authentication REST endpoint. In all of the versions of Neo4j I tested, it didn't give an error like that, it just returned an empty body, which we interpret as a sign that auth is either unsupported or disabled.
Aftermath Edit
Travis support confirmed their provided Neo4j version is 1.9.4.

Related

Versions of Python & Spark to work with VS Code Notebooks

I'm developing scripts for AWS Glue, and trying to mimic development environment as close as possible to their specs here. Since it's a bit costly to run a Notebook server/development endpoint, I set everything up on local machine instead, develop scripts on VS Code Notebook, due to its usefulness.
There're some troubles with Notebook setup due to incompatible versions between installed Python & Spark.
For Python, I have gone through some harsh time to clean up, and its version is 3.8.3 now
For Spark, I use the manual method with version of 2.4.3, since I plan to use Scala alongside at later time. I install the findspark package to load that version as expected.
And it doesn't work! The error was TypeError: an integer is required (got type bytes)
I've searched around, and people said to downgrade to Python 3.7 using pyenv, and I got 3.7.7 installed but still had the same error
As a last resort, I tried pip install pyspark. it's Spark 3.0.0, and works fine, but not as expected.
Hope there's someone have experiences of this matter
A better approach would be to install the glue dependencies on docker then ssh into that docker container using VS code to mimic exact glue local dev environment.
I've written a blog about the same if you like to refer
https://towardsdatascience.com/develop-glue-jobs-locally-using-docker-containers-bffc9d95bd1

Updating Loopback 4

I am using Loopback 4 to create a REST-ful API. I'm a mobile developer by trade so typescript et al is all pretty new to me, so please be kind ;)
I created the app using CLI v1.21.4, and saw a message to say that an update is available. I therefore updated my global installation of the CLI. But then when I try and run one of the commands such as lb4 model I see the message:
The project was originally generated by #loopback/cli#1.21.4.
The following dependencies are incompatible with #loopback/cli#1.23.1:
typescript: ~3.5.3 (cli ~3.6.3)
#loopback/authentication: ^2.2.2 (cli ^3.1.1)
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies. Could anyone offer some advice please?
Please check out https://github.com/strongloop/loopback-next/issues/3608:
During lb4 app, we add the cli version to .yo.rc.json, such as:
{
"#loopback/cli": {
"version": "1.21.4"
}
}
lb4 -v lists compatible modules that are released with the cli.
lb4 commands check if the project has incompatible versions with the current cli and prompts users to force or exit.
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies.
The process for updating dependencies is not specific to LoopBack. If you are using npm, then simply run npm update.
Please note that TypeScript often introduces backwards-incompatible changes in semver-minor releases, 3.6 brought few of them. Be prepared to manually fix few compilation errors after the upgrade.
I think that npm update is not going to jump from v2 to v3 for #loopback/authentication, you have to request that upgrade explicitly:
$ npm install #loopback/authentication#latest
There is now a supported update procedure, which is documented here:
https://loopback.io/doc/en/lb4/Update-generator.html
It seems to be simply:
# Ensure you have the latest version of the CLI tool
npm install -g #loopback/cli
# Then ask the tool to check which packages should be upgraded
lb4 update

how to use apt-buildpack from cloudfoundry repo

The apt-buildpack is experimental and not yet intended for production use. I guess that's why also no documentation.
Creating container
Successfully created container
Downloading app package...
Downloaded app package (862.7K)
Warning: this buildpack can only be run as a supply buildpack, it can not be run alone
Failed to compile droplet: Failed to compile droplet: exit status 1
Destroying container
Exit status 223
Stopping instance abdfc8d0-699e-4834-9f2d-2b8aec218423
Successfully destroyed container
Can you give me example how to push cf-env sample app and install for example rtorrent and/or openvpn. Is it possible to install gnome for testing purposes?
As far as usage goes it's pretty simple, you just need to include an apt.yml in the root directory of your app. That should contain among other things, the list of packages to install.
Ex:
---
packages:
- ascii
- libxml
- https://example.com/exciting.deb
The buildpack supports installing package names, deb files, custom APT repositories, and even PPAs.
Please see the README for further instructions.
This message:
Warning: this buildpack can only be run as a supply buildpack, it can not be run alone
Is telling you that the Apt buildpack only functions to supply binaries. It doesn't actually know how to run your app or any application. For more on the supply script, check out the docs here.
The trick to making it work is that you need to use multi buildpack support. Instructions for doing that can be found here. This should work with most apps, but there's a simple example here.
Once your app stages & starts, you can confirm that your packages were installed by running cf ssh apt-test -t -c "/tmp/lifecycle/launcher /home/vcap/app bash ''". Anything that was installed should be on the path, but if you want to see where things are installed it'll be under the /home/vcap/deps/<buildpack-number>/.
That should be about it. Hope that helps!

What are Capistrano binstubs?

I'm new to Rails and wish to deploy my app to Ubuntu 14 using Capistrano. Can someone explain to me what are binstubs and whether they are required for deploying my rails app?
A binstub is an executable script that wraps a Ruby command to ensure that a specific version of that command is used.
The reason binstubs are sometimes necessary is because a given named Ruby command can refer to many different things, and so you can't be 100% sure of what the name refers to. In deployment, predictability is very important: you want to be 100% sure of what code you are running, especially in production.
For example, consider the command named rails. You might have multiple versions of Rails installed. Indeed, every time you upgrade to the latest patch release for security fixes, that is another new version you're installing. On top of that, you might have multiple versions of Ruby installed, too.
So when you run the command rails, which version of Ruby is used? Which version of Rails?
A binstub makes this decision explicit. The idea is that you create a special script and place it in the bin directory of your project, say bin/rails. This script uses Bundler to guarantee the right version of Rails is used. When you run bin/rails, you get that guarantee. (When you generate a new Rails project, Rails in fact creates this and other binstubs for you.)
Anyway, technically you do not need these binstubs so long as you use bundle exec rails. The bundle exec wrapper essentially does the same thing that a binstub would do.
If you use the capistrano/rails gem in combination with the capistrano/bundler gem (make sure both are in your Capfile), then Capistrano will always use bundle exec and you won't have to worry about creating your own binstubs.

Why does redmine not use the development and test environments?

Why does redmine not use the development and test environments?
In the official installation guide they only show one environment when setting up the databases, advise to run bundler skipping dev and test, and run the rails server in production mode.
I think this instruction describes the installation process only for server (which runs in Production mode). I think it is done this way not to confuse new users (who do not have a lot of knowledge in Rails)
You can easily use this instruction to setup Redmine locally (I did it successfully several times ;). In order to install Redmine locally you should change only few points in the instruction.