i am using rvm and my default ruby is the latest Ruby , but i want to swith ruby version to 2.3.8
and after i run rvm use ruby2.3.8 and i want to run bundle install it said bundle not found, and then i tried to install bundle gem install bundler
then error i got is:
ERROR: Loading command: update (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
i already re install rvm and read some question about that error on this SO to get openssll ( my openssl already installed by brew ) such this question
is there any way to solve this?
I recently installed rails 4.1.8 from the repos in ubuntu. I installed ruby 2.0.0. I want to update to rails 4.2.0. I rvm'd to ruby 2.0.0. I try to update rails using
gem install rails -v 4.2.0
but receive this error
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
zlib1g-dev is already installed. I'm not sure what to do.
Thanks
I decided to simply uninstall everyting, a la
aptitude purge rails
Then start from scratch using this guide
When trying to update OpenSSL - I broke (seemingly) everything surrounding Ruby and Rails on my laptop. Even after uninstalling ruby and rails through gem uninstall and rvm removeI am still running into this error:
Drews-MacBook-Pro:bookstore drewwyatt$ rails server
bin/rails:3: undefined method `require_relative' for main:Object (NoMethodError)
Everything has been working fine for months until I went mucking around - the worse part is that I'm not even sure what I did to mess things up.
extra info
Drews-MacBook-Pro:bookstore drewwyatt$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
Drews-MacBook-Pro:bookstore drewwyatt$ which ruby
/Users/drewwyatt/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
Drews-MacBook-Pro:bookstore drewwyatt$ rails -v
bin/rails:3: undefined method `require_relative' for main:Object (NoMethodError)
Drews-MacBook-Pro:bookstore drewwyatt$ which rails
/Users/drewwyatt/.rvm/rubies/ruby-2.0.0-p247/bin/rails
Drews-MacBook-Pro:bookstore drewwyatt$
update - installing without sudo
Drews-MacBook-Pro:~ drewwyatt$ gem install rails
Fetching: railties-4.0.0.gem (100%)
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/drewwyatt/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks
Drews-MacBook-Pro:~ drewwyatt$
I fixed the problem by completely removing Rails, Ruby, and RVM altogether - then starting from scratch.
I don't remember all of the commands exactly, but it was something like:
sudo gem uninstall rails
sudo rvm remove 2.0
rvm implode
sudo chown -R drewwyatt: ~/.rvm/
rm -rf ~/.rvm
\curl -L https://get.rvm.io | bash -s stable --rails
rvm use 2.0
gem install rails
This came up for me after installing rails with Rails Composer. Seems like a problem with RVM selecting the ruby version, the trick was to simply navigate out and back into the folder.
$ cd ..
$ cd myapp
I was able to resolve this problem by simply running gem install rails.
This problem occurred when I cloned a pre-existing Rails 4 app. I am using ruby-2.0.0-p317, and an RVM gemset specific to this app. I ran the initial bundle install, but then could not run rails console without getting the error.
After running gem install rails, which used the cached copy in my app's gemset, the problem was resolved. Don't ask my why!
Try running bundle exec rails server instead of just rails server.
I was seeing this error because I had a conflicting version of the rails gem installed globally.
Prefixing commands with bundle exec ensures that you're using gems specified by your project's Gemfile.lock.
Similar to #ncherro, I got this using ruby filename.rb. Running
bundle exec ruby filename.rb
works.
Im having trouble getting the Rails 4 beta installed. I used RVM to install Ruby 2.0.0 and that seems to have succeeded ok. Here is the error I get when attempting to install the Rails gem;
$ gem install rails --version 4.0.0.beta1 --no-ri --no-rdoc
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Re-installing your RVM rubies with the latest versions should enable you to load all the dependencies required to install Rails:
rvm get head --autolibs=3
rvm pkg remove
rvm reinstall all --force
I'm having this issue whenever i run "gem install rails":
usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
Ruby and Rubygems were both installed from source. I've installed libyaml from source and from apt-get. I'm running ubuntu 12.04. I am NOT running RVM as far as I know (trying "rvm" returns "bla bla bla not installed apt-get". I'm pretty sure this speaks of 2 separate issues but I need solutions to both. Thanks.
RVM is best tool for easily install, manage, and work with multiple ruby environments.
https://rvm.io/rvm/install/ follow the instructions in this link to get RVM working.
Then you should install 'libtool' before you install 'libyaml'.
sudo apt-get install libtool
rvm pkg install libyaml
rvm reinstall 1.9.3
these commands are using for installing libyaml.
After installing this you can install rails using
gem install rails