Problem with deploying rails app to heroku while running "heroku create" command - ruby-on-rails

Has anyone seen this problem before?
When I try to run the command "heroku create", I get long error with directories related to ruby.
C:\Rails\Waterloop3>heroku create
Creating severe-samurai-489.... done
Created http://severe-samurai-489.heroku.com/ | git#heroku.com:severe-samurai-48
9.git
C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpers.rb:78:in ``': No such file or directory - git remote (Errno::ENOENT)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpe
rs.rb:78:in `block in shell'
from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:121:in `chdir'
from C:/Ruby192/lib/ruby/1.9.1/fileutils.rb:121:in `cd'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpe
rs.rb:78:in `shell'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/comma
nds/app.rb:265:in `create_git_remote'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/comma
nds/app.rb:49:in `create'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/comma
nd.rb:48:in `run_internal'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/comma
nd.rb:20:in `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/bin/heroku:13:in
`'
from C:/Ruby192/bin/heroku:19:in `load'
from C:/Ruby192/bin/heroku:19:in `<main>'

This line:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-1.14.10/lib/heroku/helpers.rb:78:in ``': No such file or directory - git remote (Errno::ENOENT)
Says that the heroku gem is try to run git and can't find it. Do you have git installed and running from the command line? It is a requirement, since it is what Heroku uses to manage deployments.

Related

Cant get Jenkins to work with fastlane

I have a Jenkins server that pulls my build and builds it, in the shell scripts i have a fastlane command that runs by distribution. Issue is it never is able to execute sucessfully.
my shell code is simply:
bundle exec fastlane distribute_to_testflight
called as i use plugins for fastlane in my project.
Result:
$ bash -c export
$ bash -c "test -f ~/.rvm/scripts/rvm"
$ bash -c "test -f ~/.rvm/scripts/rvm"
[App] $ bash -c " source ~/.rvm/scripts/rvm && rvm use --install --create 2.4.1 && export > rvm.env"
Using /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1
[App] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/jenkins2674080270342174416.sh
+ bundle exec fastlane distribute_to_testflight
/Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find CFPropertyList-2.3.6 in any of the sources (Bundler::GemNotFound)
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/spec_set.rb:82:in `map!'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/spec_set.rb:82:in `materialize'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/definition.rb:170:in `specs'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/definition.rb:237:in `specs_for'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/definition.rb:226:in `requested_specs'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/runtime.rb:108:in `block in definition_method'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/runtime.rb:20:in `setup'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler.rb:107:in `setup'
from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/setup.rb:20:in `<top (required)>'
from /Users/Shared/Jenkins/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Shared/Jenkins/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Im not sure of the issue, i installed ruby with rvm on the jenkins user as you can see, but in my main project i work on the code with, i just have my ruby gems and files in the actual project repo that i commit to git, so perhaps i could get jenkins to use what it pulls from the repo?
Im really lost on this so any guidance on the issue would be great
I had the same issue and fixed it by calling bundle install prior to my bundle exec call:
bundle install
bundle exec fastlane distribute_to_testflight
I then use the following Fastlane command at the top of my lane so from then on it should keep things up to date:
bundle_install()
CFPropertyList-2.3.6 is a gem available in main ruby gem repo at: https://rubygems.org
So add or set in Gemfile:
source "https://rubygems.org"
then run
bundle install
and ensure your machine can go internet.

Heroku Error when running heroku commands

Hi everytime I try to run a heroku command ex. heroku run rails c --app <appname> I am getting this error:
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError)
(Exc
n::Errors::SocketError)
Backtrace: C:/Program Files (x86)/Heroku/vendor/gems/excon-0.16.1/lib/excon/ssl_socket.rb:83:in
connect'
C:/Program Files (x86)/Heroku/vendor/gems/excon-0.16.1/lib/excon/ssl_socket.rb:83:in
initialize'
C:/Program Files (x86)/Heroku/vendor/gems/excon-0.16.1/lib/excon/connection.rb:344:in
new'
C:/Program Files (x86)/Heroku/vendor/gems/excon-0.16.1/lib/excon/connection.rb:344:in
socket'
C:/Program Files (x86)/Heroku/vendor/gems/excon-0.16.1/lib/excon/connection.rb:175:in
request_kernel'
C:/Program Files (x86)/Heroku/vendor/gems/excon-0.16.1/lib/excon/connection.rb:101:in
request'
C:/Program Files (x86)/Heroku/vendor/gems/heroku-api-0.3.4/lib/heroku/api.rb:61:in
request'
C:/Program Files (x86)/Heroku/vendor/gems/heroku-api-0.3.4/lib/heroku/api/login.rb:9:in
post_login'
C:/Program Files (x86)/Heroku/lib/heroku/auth.rb:76:in api_key'
C:/Program Files (x86)/Heroku/lib/heroku/auth.rb:185:inask_for_credentials'
C:/Program Files (x86)/Heroku/lib/heroku/auth.rb:217:in ask_for_and_save_credentials'
C:/Program Files (x86)/Heroku/lib/heroku/auth.rb:80:inget_credentials'
C:/Program Files (x86)/Heroku/lib/heroku/auth.rb:70:in password'
C:/Program Files (x86)/Heroku/lib/heroku/auth.rb:17:inapi'
C:/Program Files (x86)/Heroku/lib/heroku/command/base.rb:40:in api'
C:/Program Files (x86)/Heroku/lib/heroku/command/config.rb:26:inindex'
C:/Program Files (x86)/Heroku/lib/heroku/command.rb:193:in run'
C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:25:instart'
C:/Program Files (x86)/Heroku/bin/heroku:25:in `'
Command: heroku config
Version: heroku-toolbelt/2.30.3 (i386-mingw32) ruby/1.9.2
What is the problem with this?
I got the same probleme, and the reason seems be the same: Your heroku toolbelt is outdated. Check it out: https://github.com/heroku/heroku/issues/1235
Get the current version in: https://toolbelt.heroku.com/windows
From your command its seems like you want to run Console not application. If you have multiple environments (staging / production / etc) you need this command:
heroku run -a app-name console
If you only have a single environment and never setup staging or other environments you can just run:
heroku run console
For more details please check this https://github.com/nemrow/rails_app_cheatsheet/blob/master/heroku.rdoc
Heroku only runs in one environment at a time, which is configured by the RAILS_ENV and RACK_ENV environments variables.
Note: Make sure that it is not in your .gitignore file. Commit and then push the changes to Heroku.
Heroku (along with many other responsible API providers) disabled its support for SSLv3 as of last Thursday: https://status.heroku.com/incidents/678

rake aborted when running heroku run rake db:migrate

I did some local migrations on my own database, and when i tried to migrate on heroku, it was givin me a termination:
Multiple migrations have the name CreateUsers
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:978:in `validate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:876:in `initialize'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:764:in `new'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:764:in `up'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:742:in `migrate'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Ive tried heroku pg:reset DATABASE and migrating again, still gives me this error
Running the database locally seems to be fine. Any suggestions?
This Multiple migrations have the name CreateUsers looks like you have two migrations with the same class name CreateUsers
Please run all of your migrations locally if that are successfully then try to re push in heroku again
hope it will solve your/this problem
I solved this problem this way:
1.check db/migrate folder. You will see at least two files with the same name.
2.delete older files. Use git rm db/migrate/"name of file"
3.push to git
$git add -A
$git commit -m ""
$git checkout master
4.push up to the remote repository and deploy to Heroku:
$ bundle exec rake test
$ git push
$ git push heroku
$ heroku run rake db:migrate

Multiple Accounts on Heroku

I've a rails project which I want to deploy on Heroku. I am using the link https://github.com/ddollar/heroku-accounts for managing multiple accounts on heroku. But whenever i am running the command heroku accounts:set personal It is showing an error like that
warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: undefined method `each' for nil:NilClass (NoMethodError)
Backtrace: /Users/sumitkalra1984/.heroku/plugins/heroku- accounts/lib/accounts/heroku/command/accounts.rb:111:in `set'
/Users/sumitkalra1984/.heroku/client/lib/heroku/command.rb:213:in `run'
/Users/sumitkalra1984/.heroku/client/lib/heroku/cli.rb:28:in `start'
/usr/bin/heroku:24:in `<main>'
Command: heroku accounts:set personal
Plugins: heroku-accounts
Version: heroku-toolbelt/3.0.0 (x86_64-darwin10.8.0) ruby/1.9.3
I bet the you found a solution to your problem, but just in case (and for other like me) you just have to init a git repo. If you try this command in a directory without git repo you will get this error.
Cheers !

rspec rails 3.2.3, and ruby 1.9.3 getting cannot load such file errors

When I run:
bundle exec rspec spec/requests/static_pages_spec.rb:
I get:
c:\Sites\sample_app>bundle exec rspec spec/requests/static_pages_spec.rb
C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/conf
iguration.rb:746:in `load': cannot load such file -- c:/Sites/spec/requests/stat
ic_pages_spec.rb (LoadError)
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'
I'm getting a similar error to the one contained in this post, however the solution proposed doesn't work for me.
spec with guard, rails 3.1.1, and ruby 1.9.3 getting cannot load such file errors
I've run bundle install and rails generate rspec:install but the error remains. All the files are in their correct spots, and nothing has changed since last night, so I'm not sure what has happened.
Any light shed on the situation would be greatly appreciated!
It seems like rspec does not care that you stand in c:\sites\sample_app, as it tries to load
c:/Sites/spec/requests/static_pages_spec.rb
Try to run rspec with an absolute path:
bundle exec rspec c:/Sites/sample_app/spec/requests/static_pages_spec.rb
Make sure that you are executing the bundle exec rspec spec/.... command from the app root directory. If you run the command from a sub-directory, you will get this error.

Resources