Heroku: No Rake File Found - ruby

I am giving Heroku a spin for the first time, but am having quite a bit of difficulty even getting my app to open without crashing. When searching for the answer to this problem, the nice people on stack overflow suggest that I run
heroku run rake db:migrate
However, when I do this I consistently get this error back
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
When I run the trace with it I get back this
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:598:in `raw_load_rakefile'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:89:in `block in load_rakefile'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:88:in `load_rakefile'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:72:in `block in run'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:70:in `run'
/app/bin/rake:41:in `<main>'
I have been searching for the answer for hours but I cannot seem to find one that solves this problem. It is possible I just do not know where to look. Any sort of leads would be exponentially helpful. Thank you!
EDIT
Steps already taken:
git init
git add .
git commit -m "init"
heroku create
git push heroku master
and this is where I tried to run
heroku open
received an error, and to remedy this tried
heroku run rake bd:migrate

Make sure you can run it locally. cd your project and type:
bundle exec gem list rake
if you can not see it here try adding it to your Gemfile by typeing:
echo "gem 'rake'" >> Gemfile
then bundle && git push heroku master

Related

Improving loading speed performance of Rails app with Spree engine

Hi I have a Ruby on Rails 4 application with a Spree Engine.
The problem is that is it quite slow and every time I reload a page it takes a long time to load (9 seconds in the last attempt)
I saw on the spree github page that the issue is known and there is a solution where they suggest to precompile assets with bundle exec rake assets:precompile:nondigest command.
Unfortunately when I run this command the rake is aborted. I have run the command with trace
bundle exec rake assets:precompile:nondigest --trace
rake aborted!
Don't know how to build task 'assets:precompile:nondigest'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/task_manager.rb:49:in []'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:148:ininvoke_task'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:106:in block (2 levels) in top_level'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:106:ineach'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:106:in block in top_level'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:115:inrun_with_threads'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:100:in top_level'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:78:inblock in run'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:165:in standard_exception_handling'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/lib/rake/application.rb:75:inrun'
/home/luca/.rvm/gems/ruby-2.0.0-p353/gems/rake-10.1.1/bin/rake:33:in <top (required)>'
/home/luca/.rvm/gems/ruby-2.0.0-p353/bin/rake:23:inload'
/home/luca/.rvm/gems/ruby-2.0.0-p353/bin/rake:23:in `'
I suspect that the solution of precompiling assests was optimised for Ruby on Rails 3 and it's not working with Rails 4.
Can you advise on how to resolve this or if you have alternatives to speed up the loading time?
Thanks in advance.
The correct command to run is actually the below and it was run without errors
bundle exec rake assets:precompile RAILS_ENV=development
Speed of loading page seems marginally faster.
WARNING: Using the precompile rake task in development will prevent
any changes to asset files from being automatically loaded in when you
reload the page. You must re-run the precompile task for changes to
become available.**
Rails also provides the following rake task that will delete the entire public/assets directory, this can be helpful to clear out development assets before committing.
rake assets:clean

can not create a place on the Heroku server using $ heroku create

My system is windows7.
I have opened a Heroku account,
installed Git,
created a SSH key,
and now I need to create a place on Heroku server to deploy apps.
But when I type
$ heroku create
I get the following error message:
Creating fast-reaches-6714... done, stack is cedar
http://fast-reaches-6714.herokuapp.com/ | git#heroku.com:fast-reaches-6714.git
! 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: No such file or directory - git --version (Errno::ENOENT)
Backtrace: C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/helpers.rb:103:in ``'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/helpers.rb:103:in `has_git?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/helpers.rb:108:in `git'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/helpers.rb:156:in `create_git_remote'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/command/apps.rb:278:in `create'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/command.rb:218:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/lib/heroku/cli.rb:28:in `start'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/heroku-3.2.1/bin/heroku:17:in `<top (required)>'
C:/Ruby193/bin/heroku:23:in `load'
C:/Ruby193/bin/heroku:23:in `<main>'
Command: heroku create
Version: heroku-gem/3.2.1 (i386-mingw32) ruby/1.9.3
I looked at help.heroku.com but could not find answers..
What seems to be the problem(s)?
Any help is appreciated
It looks like git isn't on your path, because you just installed it. Restart your terminal and then it should be on your path.

Syntax error by using ruby-youtube-dl

i'm new to this site and also in programming. Actually i'm learning Ruby.
In my first experiments i would like to download a file from Youtube. I decided to use ruby-youtube-dl.
I parse ARGV0 to $url.
Then i'm using:
FileUtils.cd("#{$musicdir}/#{$folder}") do
YoutubeDL::Downloader.download_audio("#{$url}")
end
But that one produces that output:
sh: -c: Zeile 0: Syntaxfehler beim unerwarteten Wort `('
sh: -c: Zeile 0: `/home/sascha/.rvm/gems/ruby-2.0.0-p353/gems/ruby-youtube-dl-0.0.5/bin/youtube-dl.py --no-progress --extract-audio --audio-format=mp3 --output=/tmp/%(stitle)s-%(uploader)s-%(autonumber)s.mp3'
/home/sascha/.rvm/gems/ruby-2.0.0-p353/gems/ruby-youtube-dl-0.0.5/lib/ruby-youtube-dl/downloader.rb:9:in `download_audio': undefined method `[]' for nil:NilClass (NoMethodError)
from /home/sascha/RubymineProjects/ruby_script_collection/youtube_dlhelper/lib/youtube_dlhelper.rb:86:in `block in <top (required)>'
from /home/sascha/.rvm/rubies/ruby-2.0.0-p353/lib64/ruby/2.0.0/fileutils.rb:125:in `chdir'
from /home/sascha/.rvm/rubies/ruby-2.0.0-p353/lib64/ruby/2.0.0/fileutils.rb:125:in `cd'
from /home/sascha/RubymineProjects/ruby_script_collection/youtube_dlhelper/lib/youtube_dlhelper.rb:84:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
The full sourcefile is placed there: http://pastebin.com/jAwjHanw
Maybe anyone can help out?
I've looked into the log, and it seems to be a bug. You can do the following steps the solve, or partially solve the problem:
Check out gem:
$ cd ~/git
$ git clone https://github.com/bnmrrs/ruby-youtube-dl.git
Specify the path folder in your project's Gemfile that will point to the newly checked out gem:
gem 'ruby-youtube-dl', :path => '~/git/ruby-youtube-dl'
Try to fix the gem locally, for example by removing parentheses, and # chars, and replacing them with constants. Of course it will be a workaround.
In case if you are developing a gem or rails app, you shell to publish you changes to web, and you are able to do that by forking the gem on github, pushing you changed into you version branch:
$ git clone git://github.com/yourname/ruby-youtube-dl.git
$ cd ruby-youtube-dl
$ git branch fixbranch
$ git checkout fixbranch
# do your changes...
$ git push origin fixbranch
Use your changes as the main gem version. In this case you are need to change your Gemfile for example as follows:
gem 'ruby-youtube-dl', :git => 'git://github.com/yourname/ruby-youtube-dl.git', :branch => 'fixbranch'
In case if your changes are not workaround you can open a pull request on github to commit your changes into the mainstream.
If you are unable to solve the problem even with a workaround, it will be beast to report the issue to the gem developers here, supplying the error logs unto them.

Heroku client internal error. Unable to verify certificate

Heroku keys, heroku run rake etc seem to be having issues
Anyone else having this issue? / know how to get around it ?
Thanks !
Trace--
! 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: Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::SocketError)
Backtrace: /usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/ssl_socket.rb:69:in `connect'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/ssl_socket.rb:69:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:365:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:365:in `socket'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:105:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/mock.rb:42:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/base.rb:15:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/middlewares/base.rb:15:in `request_call'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/excon-0.25.0/lib/excon/connection.rb:244:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-api-0.3.13/lib/heroku/api.rb:76:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-api-0.3.13/lib/heroku/api/login.rb:9:in `post_login'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:80:in `api_key'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:189:in `ask_for_credentials'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:221:in `ask_for_and_save_credentials'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:84:in `get_credentials'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:74:in `password'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/auth.rb:17:in `api'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/command/base.rb:40:in `api'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/command/keys.rb:27:in `index'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/command.rb:206:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/lib/heroku/cli.rb:28:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/heroku-2.39.4/bin/heroku:17:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/heroku:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/heroku:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Command: heroku keys
Version: heroku-gem/2.39.4 (x86_64-darwin11.4.0) ruby/1.9.3
Running 'heroku update' in terminal fixed this for me.
I had this problem briefly on Mac OS X when I had version 2.39.4 of the heroku gem installed. I uninstalled it and allowed the Heroku toolbelt to be the provider of my heroku executable again, and although I had to go through "heroku auth:login" and "heroku keys:add " again, it now works as expected.
N.B. The heroku gem is still required on my Vagrant Heroku Ubuntu VM, of course.
Need to manually delete openssl.cnf... find the file on your machine and rename it to something else.... bug in the latest excon release....
I was unable to fix this by deleting openssl.conf.
However, I was able to fix this by installing the heroku toolbelt and then deleting ALL old installations of the heroku gem.
macbook:~ johnnygoodman$ gem uninstall heroku
Select gem to uninstall:
1. heroku-2.35.0
2. heroku-2.39.4
3. All versions
> 3
Successfully uninstalled heroku-2.35.0
Remove executables:
heroku
macbook:~ johnnygoodman$ heroku login
Enter your Heroku credentials.
Email:
Password (typing will be hidden):
Authentication successful.
I had the same problem, and renamed the openssl.cnf file on my machine, as user2515011 recommends above, and it's worked.
To be honest, I don't know why this has worked, or if it has left me vulnerable elsewhere. Can anyone explain?
Unfortunately I'm unable to duplicate this on my macbook air. I wonder if perhaps it relates to rvm. What version are you using? It looks as though it used to package openssl: https://rvm.io/packages/openssl (but probably shouldn't any longer, and at least on my machine using the packaged versions works well). Could you try following the advice from that page and running rvm autolibs enable and trying again?
I was having this same problem and none of the suggestions were working for me.
It turns out when trying to fix a different problem I had set an environment variable to set my SSL Certificate location to be in the RailsInstaller directory.
I recommend checking for any suspicious environment variables if none of the above answers are helping you.

heroku commands broken after installation of Mountain Lion

I tried to run a heroku console for a Rails 3.2 app using
heroku run bundle exec rails console
a command which has previously worked. It gave me the error message below. I also tried to run
heroku info
and got a similar error message. I did this both before and after signing in with the heroku toolbelt, same result. I also tried this on another website and got the same result. Both websites are actually working, just can't access the console
Can anyone explain what the problem might be.
! Heroku client internal error.
Error: No such file or directory - git --version (Errno::ENOENT)
Backtrace: /usr/local/heroku/lib/heroku/helpers.rb:103:in ``'
/usr/local/heroku/lib/heroku/helpers.rb:103:in `has_git?'
/usr/local/heroku/lib/heroku/helpers.rb:108:in `git'
/usr/local/heroku/lib/heroku/command/base.rb:206:in `git_remotes'
/usr/local/heroku/lib/heroku/command/base.rb:179:in `extract_app_in_dir'
/usr/local/heroku/lib/heroku/command/base.rb:31:in `app'
/usr/local/heroku/lib/heroku/command/run.rb:108:in `block in run_attached'
/usr/local/heroku/lib/heroku/helpers.rb:236:in `action'
/usr/local/heroku/lib/heroku/command/run.rb:107:in `run_attached'
/usr/local/heroku/lib/heroku/command/run.rb:21:in `index'
/usr/local/heroku/lib/heroku/command.rb:206:in `run'
/usr/local/heroku/lib/heroku/cli.rb:28:in `start'
/usr/bin/heroku:24:in `<main>'
Command: heroku run bundle exec rails console
Version: heroku-toolbelt/2.33.2 (x86_64-darwin10.8.0) ruby/1.9.3
This problem resulted from the installation of Mountain Lion on my Mac. To fix it, I had to open XCode preferences and to install the command line tools in the downloads folder.

Resources