while i was trying to run this code "bundle install --without production"
I am getting an error like
"The program 'bundle' is currently not installed. You can install it by typing:
sudo apt-get install ruby-bundler
"
I have installed bundle already but still getting this error.
This problem occurred while i was learning from Harlt's.."Updating Gemfile" at Heroku setup section
First Set up the PATH variable for the installed ruby executable(Suppose the installed ruby is ruby-2.0.0-p451):
PATH=$PATH:$HOME/.rvm/gems/ruby-2.0.0-p451/bin
and then run,
gem install bundler (if bundler is not installed)
and lastly run,
rvm use ruby-2.0.0-p451 --default (--default is optional).
There you go. Now you would be able to run bundle command with out any issues.
Hope it helps :)
For those, who uses rbenv receipt is:
gem install bundler
rbenv rehash
bundle
Related
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.
adan#adan-HP-1000-Notebook-PC:~/wpscan$ sudo gem install bundler && bundle install --without test
Fetching: bundler-1.15.1.gem (100%)
Successfully installed bundler-1.15.1
Parsing documentation for bundler-1.15.1
Installing ri documentation for bundler-1.15.1
Done installing documentation for bundler after 10 seconds
1 gem installed
There was an error while trying to write to /home/adan/wpscan/.bundle/config.
It is likely that you need to grant write permissions for that path.
i don't know why, this problem always follow me
First of all: never install gems with sudo. To fix this for the future try uninstalling all gems / ruby, install rvm or rbenv them create a gemset for specific project and then install gems with bundle install. This error will most likely follow You a while if You don't repair it.
sudo gem install bundler && sudo bundle install
This probably would help, just for now.
I'm trying to get a Middleman static site going but for the life of me cannot get Bundler to act right. This is my first time using Ruby on Rails.
Using rbenv I’ve cloned ruby 2.2.0 into a plugin folder but even after running rbenv global 2.2.0 and getting Middleman and Bundler to install, I can't get the "bundle install" or any other "bundle --" commands to work.
I was having issues with permissions and different versions of Ruby even after rbenv so I added "export RBENV_ROOT="$HOME/.rbenv" to my bash profile.
Once that was done the Ruby version issue that was keeping me from installing Bundler and Middleman was gone. But now that they're installed, I can't get these gems to follow any commands.
Try ruby -v to see what local ruby version is set in the app.
rbenv versions to see if you have that version installed. If you don't have the right version installed, run rbenv install ruby-x.x.x or whatever version is required, or if it is already installed do rbenv local x.x.x.
After installing a new ruby you need to run rbenv rehash to rehash your shims.
Then probably gem install bundler, then you can try bundle install.
Ruby version: 2.1.5p273
Rails version: 4.2.0
Gem Version: 2.2.2
OS: Windows 7 x64
Hello, I am very very new to rails programming. I am trying to start learning, but cannot because of these problems.
I created a rails app
I type: >rails new app
I then navigate to the created folder
I type: >rails server
It tells me
"Run 'bundle install' to install missing gems."
I do so and it than tells me:
"Make sure that 'gem install debugger-linecache -v '1.2.0' succeeds before bundling'"
after installing said gem I try bundle install again, but it than repeats the same error with a different gem.
""Make sure that 'gem install *random gem* -v '*random version*' succeeds before bundling'""
I hardly have any idea what I'm doing here. How can I get this server running?
i started to write an answer, and then saw you comment,
but for everyone out there who need an answer and didn't notice your comment:
Try this,
first run:
bundle update
and then try to bundle install
if its not working, install bundler:
gem install bundler
and now run bundle install
Solved by using the following two commands: gem update --system gem install bundler
I've seen this question asked and tried everything I've seen suggested.
I got a new macbook and am looking to set up an existing app. When i clone the app, it will not bundle install and acts like Rails is not installed, even though it works in other directories.
I tried removing version numbers from gemfile and deleting gemfile.lock. I tried bundle update. I'm on osx 10.9.4, rails 4.1.5 and ruby 2.1.1.
the error I am getting:
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.
I have rvm installed. I tried reinstalling homebrew, rails and ruby.
What could it be?
Ok, phew. This worked:
http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/
xcode-select --install
gem install nokogiri
bundle config build.nokogiri --use-system-libraries
bundle install
then, the pg gem wouldnt let bundle install. this fixed it - Installing PG gem on OS X - failure to build native extension
brew update
brew install postgresql
gem install pg
then... bundle install worked, finally, but rails s was giving me an error, which this fixed: Devise Secret Key was not set
just had to add the line w/the secret key to the config/initializers/devise.rb right before the last 'end'
hope this helps anyone who upgrades to Mavericks / gets a new computer that comes with it installed!
First try to do this sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev, then try to install