Foreman installed by heroku toolbelt on windows can't be found - windows

I simply followed the getting started with nodejs tutorial from Heroku.
https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-process-types-with-procfile
But I get an error at the part "declare process types with procfile"
My problem is that my cmd (using windows 7) didn't find the command "foreman"
Any solutions ?
I downloaded/installed the heroku toolbelt, the login works fine, but foreman dont

I had the same problem on Windows7 64-bit, using git's bash. Here's what I did:
uninstall the toolbelt, Ruby, and Git using Control Panel's "Program and Features"
reinstall the toolbelt to C:\Heroku (see known issue for more info)
add C:\Program Files (x86)\git\bin;C:\Heroku\ruby-1.9.2\bin to the system PATH variable: Control Panel, System, Advanced system settings, Environment Variables..., System variables, Variable Path, Edit... (Change ruby-1.9.2 if a future version of the toolbelt includes a newer version of Ruby.)
open a git bash window and uninstall foreman version 0.63$ gem uninstall foreman
then install version 0.61 (see here for more info)$ gem install foreman -v 0.61
Now foreman worked for me:
$ foreman start

You can do this without uninstall/reinstall:
Open Environment Variables
Add C:\Program Files (x86)\Heroku\ruby-x.x.x\bin to system path (assuming that you installed heroku toolbelt in this directory).
You're done! try it by opening a new shell window and typing foreman start .

Foreman finished support for Windows. You can use forego instead. It is a foreman implementation in GO lang.
https://github.com/ddollar/forego

Adding C:\Program Files (x86)\Heroku\ruby-1.9.3\bin to the Environment variable PATH worked for me.

After installing Heroku toolbelt, I was getting weird errors about required modules when running foreman start. Adding the ruby bin directory to path, and reopening the shell window did not work for me. It seems that foreman was never installed! When I attempted to uninstall foreman, ruby told me it was not installed. So I ran gem install foreman, and 0.77 was installed. One gotcha, I had to open the shell to install the foreman gem as Administrator. Maybe that is how the Heroku toolbelt seems to not have installed properly the first time. Running foreman start seemed to do something after it was installed (naturally).

Related

Cocoapods user-install: cannot run pod command

I have installed Cocoapods on OS X Mavericks using the --user-install option (to avoid having to use sudo for the installation) following the instructions at http://guides.cocoapods.org/using/getting-started.html#getting-started . I have also created a .profile file in my home directory with the following:
export GEM_HOME=$HOME/gems
export PATH=$GEM_HOME/bin:$PATH
Cocoapods successfully installs, but I am unable to run the pod command.
When running it from the command line it says No such file or directory. From what I understand, it should be installed into the /Users/me/gems/bin folder. However, this folder does not exist at all - the only Ruby related folder in my home directory is /Users/me/.gem.
I have tried running /Users/me/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/bin/pod but that results in the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- bundler/setup (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from .gem/ruby/2.0.0/gems/cocoapods-0.29.0/bin/pod:14:in `<main>'
...but from what I understand, I shouldn't be running it from that location directly.
Any assistance for a Cocoapods newbie appreciated!
So after a lot of research and trying different things I have managed to get this working. I am not quite sure what eventually fixed the problem, or whether it was a combination of things, but for anyone else encountering this same problem here's what I did:
Installed the Xcode command line tools for Mavericks. The option to install this is no longer available in Xcode 5, so you need to download them from https://developer.apple.com/downloads . Some people seem to say they are already installed as part of Xcode 5 from the Mac App Store, whereas others say you need to manually install them. Either way, I figured that installing them again won't hurt.
The error message above talked about not being able to load bundler/setup. So, I (re?)installed the bundler ruby gem gem install bundler --user-install. Interestingly, when I then attempted to run the /Users/me/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/bin/pod command again I got a different error: /Users/me/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/Gemfile not found.
What was really handy is that after the installation of bundler a message appeared saying /Users/me/.gem/ruby/2.0.0/bin in your PATH, gem executables will not run. So, I checked out the contents of that folder and it contains the pod executable! Adding it to the PATH would certainly be handy, but I just ran it directly with the full path (after changing to my Xcode project folder containing the Podfile): /Users/me/.gem/ruby/2.0.0/bin/pod install and it all works!
When I ran pod install for the first time it showed a message saying Setting up CocoaPods master repo and stayed there for quite some time - I thought it had actually hung. However, it eventually completed. If you are unsure whether it is doing anything, or has hung, do ls -la ~/.cocoapods/repos/master/.git/objects/pack/ and look at the time modified/size of the file it is downloading (thanks to this comment for the hint).
Another tip for new players - when I tried to install a pod (in my case, BlocksKit) I got a message saying [!] The platform of the target Pods (iOS 4.3) is not compatible with BlocksKit (2.1.0) which has a minimum requirement of OS X 10.7 - iOS 5.0. This was a surprising message, since my project targets iOS 7.0. Apparently you don't need to specify the platform anymore, so I entirely removed the platform line from the Podfile and it all works.
Hope that this helps other people just getting started with CocoaPods!
After installing Mavericks, I got error with already installed cocoapods. So I ran this command to install the new updated cocoapods version, and it works now.
sudo gem install cocoapods
Thanks to the pointers in these answers, I found that the instructions for installing CocoaPods provided on the CocoaPods web site are incorrect, regarding the contents of the .profile file, specifically the path.
As Skoota noted in the question, the path $GEM_HOME/bin does not exist. A comment by Videre gives the important clue: the correct path is $GEM_HOME/ruby/2.0.0/bin.
The correct .profile contents, which works for me at least, is:
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/ruby/2.0.0/bin:$PATH
It is also worth noting that you must quit and relaunch the Terminal application for changes to the .profile file to take effect.
add:
export COCOAPODS_NO_BUNDLER=1
to your .zprofile or .bash_profile
FWIW - I ran into very similar problems. None of the above helped me so maybe others could benefit from my process.
Eventually just ran sudo gem uninstall cocoapods, deleting everything that I did before.
Followed the steps for creating the .profile file
For good measure, closed Terminal and rebooted everything.
Ran gem install cocoapods which somehow didn't run into errors this time
Checked the install by running gem which cocoapods which fortunately returned the correct path
ran pod setup which didn't raise any errors again .
Not entirely sure what actually worked and what didn't but maybe someone will find this useful.
I use homebrew to install cocapods
First install homebrew (paste this code in terminal and hit enter)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Second enter this
$ brew install cocoapods

Postgres.app upgrade, now Rails app won't start

I just upgraded my Postgres.app to latest version (9.2.4.1) am now unable to start my Rails app using Foreman or Rails server.
/Users/memoht/Sites/myapp/.gem/ruby/1.9.3/gems/pg-0.15.1/lib/pg.rb:4:in `require': dlopen(/Users/memoht/Sites/myapp/.gem/ruby/1.9.3/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: #executable_path/../lib/libssl.1.0.0.dylib (LoadError)
Referenced from: /Applications/Postgres.app/Contents/MacOS/lib/libpq.dylib
Reason: image not found - /Users/memoht/Sites/myapp/.gem/ruby/1.9.3/gems/pg-0.15.1/lib/pg_ext.bundle
Looked through Postgres.app documentation
Upgrade from 9.2.2.0 to 9.2.4.1 isn't a new minor release so shouldn't involve pg_upgrade
.bashrc has correct setting for PATH PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
Uninstalled, and reinstalled PG gem.
Made the mistake of thinking I needed to install PostGIS via homebrew, but that automatically installed Postgres via Brew plus a slew of other dependencies.
If I swap out the Postgres.app version back down to 9.2.2.0 everything works again. Since Postgres.app is a drag and drop install, why has upgrading from 9.2.2.0 to 9.2.4.1 caused this?
I found a solution that works for me and requires minimal hacking/configuring. You only need to do this once and it will work for every bundle install. Add the following to your .bash_profile, .bash_rc, or equivalent:
export DYLD_FALLBACK_LIBRARY_PATH=/Applications/Postgres.app/Contents/MacOS/lib:$DYLD_LIBRARY_PATH
(Assuming you installed Postgres.app in the default location). Then restart your terminal session and try again.
Exporting to DYLD_LIBRARY_PATH directly can cause serious problems with other apps that depend on it, but using the fallback path avoids these problems.
See also:
Error requiring pg under rvm with postgres.app
https://github.com/PostgresApp/PostgresApp/issues/109#issuecomment-18387546
EDIT: It seems that setting DYLD_FALLBACK_LIBRARY_PATH causes an error when you try to run psql. To fix this, you can add the following two lines to your .bash_profile:
alias psql="(. ~/.bash_profile; unset DYLD_FALLBACK_LIBRARY_PATH; psql)";
This is assuming that you're using bash and that your .bash_profile is located in your home directory. If that's not the case (or if you're using a .bashrc or other environment setup instead of .bash_profile) change the ~/.bash_profile part of the command to the path to your environment setup script.
The aliased commands basically start a subshell which does not effect your current bash environment. So when it unsets the DYLD_FALLBACK_LIBRARY_PATH variable, it's only temporary. After you exit psql the environment variable will be set again so that rails functions properly.
It's likely your pg gem in your app was built against the old libraries. Try rebuilding it against the new Postgres.app:
$ gem uninstall pg
[...]
$ bundle install
[...]
"installing pg" (or something..)

Bundle command not found Windows x64

I just installed ruby with the Heroku Toolbelt, probem is that when I do bundle install it gives me this error:
sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpreter: No such file or directory
Acording to this question Bundle command not found. Bad Interpreter I should change the PATH, but I dont know how to do this, I have changed windows PATH enviorment variable, even changed to C:\ruby-1.9.2\bin I get a similar error:
sh.exe": /c/ruby-1.9.3/bin/bundle: "c:/Program: bad interpreter: No such file or directory
When I try to reinstall the Toolbelt I change the install direcotry to c:\ but still the wizard install git and ruby folders at Program Files (x86) directory.
Any suggestions?
You probably don't have the Bundler gem installed.
Assuming you have Ruby installed:
gem install bundler
should do the trick.
Well I found the solution, so I'm posting here.
Problem seems to be the bunlder installation in windows x64 machines, to solve this I did this.
Copy the following directories to C:/
C:\Program Files (x86)\Heroku
C:\Program Files (x86)\Git
C:\Program Files (x86)\ruby-1.9.2
Change windows environment "Path" variable, to do this right click Computer > Properties > Advance Settings > environment variables. Path is under "System Variables" section. Edit them to this:
C:\Heroku\bin;C:\ruby-1.9.2\bin;C:\git\bin;C:\git\cmd
Go to C:\ruby-1.9.2\bin and open the "bunlde" file with note pad (not the bundle.bat), change the first line from #!"c:/Program Files (x86)/ruby-1.9.2/bin/ruby.exe"## to !#!c:/ruby-1.9.2/bin/ruby.exe##
Now go to C:\Git and change the properties (right click > properties) of the Git Bash direct access, and change the target from C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i" to C:\Windows\SysWOW64\cmd.exe /c ""C:\Git\bin\sh.exe" --login -i"
Hope it helps someone
For Windows users:
I used gitbash to install bundler.
gem install bundler
and the bundler was installed successfully.
Even after that i was facing the same issue.
Found out that it was due to some permission issue in my case.
Here is what i did:
I fired up a command prompt (Note: with administrator privilege )
I did gem install bundler once again and it installed.
Now i could do something like bundle -v, It gave me the bundler version currently installed.
I tried the same bundle -v using Git Bash but it still is not working somehow.
I restarted my laptop, And surprisingly now it is works.
Hope this is helpful to anyone.
I had these issues, and for me the only problem was the spaces in the file paths. Simply adding 's around the path fixed the problem for me:
'C:\Program Files (x86)\git\bin';'C:\Program Files (x86)\Heroku\ruby-1.9.2\bin'
That's it!

Heroku Toolbelt install problems

I uninstalled the heroku gem and installed the Heroku Toolbelt and am running into issues getting it working w/ RVM.
heroku version command works everywhere except my current project folder.
In my project folder I get
'/Users/cmalpeli/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.3/lib/bundler/rubygems_integration.rb:223:in 'block in replace_bin_path': can't find executable heroku (Gem::Exception)
from ./bundler_stubs/heroku:16:in`
Running which heroku in my project directory returns:
./bundler_stubs/heroku
everywhere else it returns
/usr/bin/heroku
I'm sure it has something to do w/ RVM - but I don't quite understand how that works, so would appreciate a bit of help.
Thanks!
make sure heroku is not part of your Gemfile - it should not be there.
then remove ./bundler_stubs/heroku:
rm -f ./bundler_stubs/heroku
it is possible that ./bundler_stubs/heroku is part of your project and was committed by one of your coworkers, the stubs should not be part of the project.

Change back to bash from zsh? OSX Lion

I am trying to setup my computer for Ruby on Rails development. All new to this.
Though I have had some problems with my Rails installation and want to reset everything and start again on setting it up.
The problem I get now is installing and using bash in Terminal except of the installed zsh.
I´m trying the command ➜ ~ rvm install 1.9.2
but only get:
zsh: correct 'rvm' to 'rvim' [nyae]?
which opens the file in an texteditor.
Isn´t it supposed to be a downloadable file, which should be installed automaticly ?
It sounds like rvm is not on your path. You could specify the executable location explicitly:
~/.rvm/rvm install 1.9.2
(or maybe /usr/local/rvm/rvm depending on where you installed it)

Resources