gem install rails does not install rails
In an effort of rage quit, I:
- removed ruby
- removed gem
and recompiled both from source, and now gem install rails
is fully working again.
Rails command not available after installing with gemfile
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.
Does Rails need to be installed as a system gem?
It totally makes sense to NOT install rails as system gem.
Without messing up rbenv or other ruby version manager you use, below are brief steps to create (initialize) a new Rails app from a directory with a Gemfile:
mkdir rails_app
cd rails_app
vi Gemfile # Edit it to include a rails version you need
bundle --path vendor # Wait for bundler to finish
bundle exec rails new ./
The last step would ask: Overwrite /path/to/rails_app/Gemfile? (enter "h" for help) [Ynaqdh]
. Input y
to get the default Rails Gemfile content.
Note: the above steps specify the local vendor
directory (inside the rails app folder) to avoid installing gems to system global scope.
bundle install not working in my project ruby on rails
Solutions for 'Cant find gem bundler (>= 0.a) with executable bundle'
This is official doc on this error, you should have found this on top if you googled correctly. Gist is that there is bundler version mismatch, check gemfile.lock
for bundler version and than install that version of bundler
.
gem install bundler -v VERSION_FROM_GEMFILE
for example
gem install bundler -v 1.17
Problem installing old version of Rails 5.2.2 - Failed to build gem native extension
The problem occurred when ruby was installed using sudo apt install ruby
.
Solution: Install ruby via RVM.
Using rvm bundle install doesn't install rails
I'll bet your RVM isn't set up correctly and /usr/bin/
appears in your PATH
before RVM's bin directory. Run echo $PATH
to confirm.
If so, back up your dotfiles for safety and run rvm get head --auto
and it should put your PATH right. Logout and log back in or source your dotfiles (source ~/.bash_profile
or whatever) and try again.
Related Topics
How to Get The Pty.Spawn Child Exit Code
Why Is Foreman Gem Ignoring the Port Environment Variable
Vim Syntax Highlighting for Ruby 1.9
Using Each_With_Index with Map
Where Is the Best Place to Add Methods to the Integer Class in Rails
Run Selenium with Chrome Driver on Heroku: 'Cannot Find Chrome Binary'
Sinatra - How to Get the Server's Domain Name
Ruby Attr_Reader Allows One to Modify String Variable If Using <<
Can Multiple Sidekiq Instances Process The Same Queue
Ruby Group Hashes by Value of Key
Open a File Case-Insensitively in Ruby Under Linux
Which Ruby Rest API Client for Neo4J
Properly Using Log4R in Ruby Application
Date Range Facets with Sunspot in Ruby on Rails