Command not found mina - ruby-on-rails

I am trying to start deploying a rails app with mina gem only I can not seem to get it initialized.
As you can see here, I am not doing anything out of the ordinary, I have added mina to my gem list, it installs fine, but the executable is not found.
➜ trackitall git:(master) ✗ bin/bundle install
40 other gems
Using mina 0.3.4
Bundle complete! 41 Gemfile dependencies, 143 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
➜ trackitall git:(master) ✗ mina init
zsh: command not found: mina
➜ trackitall git:(master) ✗
I am using rbenv with ruby 2.1.5 for this project on macOS 10.10.3. Also there is no mina shim in the ~/.rbenv/shims folder. As far as I understand, rbenv here should be all the executables for your specific ruby env.

I was using rbenv and had the same problem where mina was not being found. All I had to do was:
rbenv rehash
and then
mina init

Ok, noobie mistake.
The problem was that mina is not in the environment. So you can either run
bundle execute mina for executing mina in your current gem environment
or run rbenv rehash and then mina should be available in your path

Related

Rails command not available after installing with gemfile

I installed rails via a Gemfile and bundle install:
Gemfile
source "https://rubygems.org"
gem "rails", "5.0.6"
the gem appears to have successfully installed according to success message. However it is still not available from the command line even after a restart.
$ rails
The program 'rails' is currently not installed. You can install it by typing:
sudo apt install ruby-railties
You will have to enable the component called 'universe'
I am using rbenv (required) and have a number of utilities in /.rbenv/shims/ (gem, rake, bundle, etc.) but not rails... so I don't know where it got installed.
gem env returns:
GEM PATHS:
- /home/user/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0
- /home/user/.gem/ruby/2.5.0
but I don't see those packages there. I'm guessing it needs to be on the path, but I don't know where it is. The solution needs to work while installing with a bash script.
just add bundle exec
bundle exec rails
When you use rbenv and you install Ruby on Rails then you might need to run rbenv rehash to make the rails command available.
From the docs:
Installs shims for all Ruby executables known to rbenv (i.e., ~/.rbenv/versions/*/bin/*). Run this command after you install a new version of Ruby, or install a gem that provides commands.
after I read your problem, I guess that you used rbenv and you didn't run rbenv rehash, so you can do it as following below:
gem install railties
rbenv rehash
So, I was running rbenv rehash and setting the environment variable. However, the new env variables were not available until after a restart. Using the full path to /.rbenv/shims/rake solved the problem.

Ruby on Rails Bundler issues LoadError

I believe I am having some PATH issues for my gems.
I am using rvm (version 1.29.3) with ruby (version 2.4.1) and rails (version 5.1.4)
I tried to run rails new myapp to which I get the following LoadErrors:
remove config/initializers/new_framework_defaults_5_1.rb
run bundle install
/Users/fabienbessez/.rvm/rubies/ruby-2.4.1/bin/ruby: No such file or directory
-- /Users/fabienbessez/.rvm/rubies/ruby-
2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle (LoadError)
run bundle exec spring binstub --all
/Users/fabienbessez/.rvm/rubies/ruby-2.4.1/bin/ruby: No such file or directory
-- /Users/fabienbessez/.rvm/rubies/ruby
2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle (LoadError)
I get the same error when I try to then run bundle install
I checked the contents of ~/.rvm/rubies/ruby-2.4.1/lib/ruby/gems/2.4.0/gems to which I found that bundler-1.15.4 but not bundler-1.16.0. I assume that that is the issue. But I can't figure out how to update those gems. gem install bundler says it has installed bundler 1.16.0 but this is not being updated.
Any ideas??
Thanks!
Have you tried to uninstall all old versions of bundler with gem uninstall bundler?

installing rails in rbenv with an old ruby

I'm working on a project in ruby 2.1.10. it should be using rails 4.0.13.
I'm using rbenv.
I've installed everything, I believe. I ran bundle install for the project. eventually I got it to run.
However, now I get:
turlingdrome$ rails
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
turlingdrome$ gem install rails -v 4.0.13
Successfully installed rails-4.0.13
Parsing documentation for rails-4.0.13
Done installing documentation for rails after 1 seconds
1 gem installed
turlingdrome$ which rails
/Users/brianp/.rbenv/shims/rails
turlingdrome$ rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
turlingdrome$ ruby -v
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-darwin16.0]
in case it matters, I'm on a mac running 10.12.6
ETA from comment:
turlingdrome$ bundle exec rails -v
Rails 4.0.13
so, bundle exec lets me run rails. rbenv exec rails seems to work too.
So, the problem seems to be in the shim!
Rehash the shims:
rbenv rehash
Now you should be able to run only rails without bundle exec or rbenv exec.

The heroku command exists in these Ruby versions?

After I updated my Ruby version with rbenv I wasn't able to use the Heroku command-line tool.
I got this error:
> heroku
rbenv: heroku: command not found
The `heroku' command exists in these Ruby versions:
2.0.0-p195
Reinstalling the tool belt from toolbelt.heroku.com didn't help.
I switched to my previous Ruby version 2.0.0p195 and uninstalled the gem 'heroku'
rbenv global 2.0.0p195
gem uninstall heroku
Then I switched to the latest Ruby version 2.0.0p353 and reinstalled Toolbelt toolbelt.heroku.com
rbenv global 2.0.0p353
If you're using rbenv, here are the steps I follow to fix this.
The error
rbenv: heroku: command not found
The `heroku' command exists in these Ruby versions:
2.2.2
What to do
rbenv local 2.2.2
gem uninstall heroku
rbenv rehash
Good to go!
Heroku does not recommend using heroku gem from the recent times. If you have already installed the gem, uninstall the gem first with:
$ gem uninstall heroku
then install the toolbelt from Heroku as specified on Heroku site:
For ubuntu/debian:
$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
For other linux:
$ wget -qO- https://toolbelt.heroku.com/install.sh | sh
For Windows/MacOS see instructions on links.
I was having a similar issue. I had the heroku gem install on various ruby versions and despite the fact I had installed the heroku toolbelt from that package downloaded from their site, I was still getting:
rbenv: heroku: command not found
I found that after I had uninstalled the gem from all my ruby versions I had to run:
rbenv rehash
After that I found that everything work perfectly. I found this out from this stackoverflow answer:
ruby - heroku: command not found
I also had this problem, if you do the following command in the terminal:
which convert
And you get back this: Users/user_name/.rbenv/shims/convert, you should remove this file in your shims.
rm Users/user_name/.rbenv/shims/convert
If you do which convert again it should give back a different url: /usr/local/bin/convert
On MacOS, the thing here is that rbenv was getting confused along with brew and the heroku binary.
Heroku recommends a brew install for Macs. Now, you need to make sure that you don't have the gem installed with any other Ruby version managed with rbenv.
If you do, just reinstall them, and you'll be good to go.

bundle install fails with 'ERROR: Gem bundler not installed'

I have bundler-1.1.3 installed. I have an app that I am trying to get to run. but when I do
$cd my_app
$bundle install
the command fails with this error:
ERROR: Gem bundler not installed
I can run bundle install from anywhere else on the sytem, but not within the app folder.
What could be the problem ?
The .rvmrc file in the directory of the app is saying it needs 1.9.2 to run. RVM has a concept of gem sets that are associated with different versions of ruby on your comptuer. You probably don't have the bundler gem installed under your 1.9.2 version of ruby but another version, perhaps 1.8.7 or 1.9.3.
$ cd my_app
$ rvm use 1.9.2
$ gem install bundle
$ bundle install

Resources