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
Related
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 have Ruby 5.2.3, Homebrew, Xcode, and zlib 1.2.11 installed but I am still running into 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
I've tried running
gem install rails -v 5.2.3
gem install rails
and
sudo gem install rails
and all give the same error.
I installed Ruby via rbenv. Currently, my pc has ruby 2.1.2p95 version installed. I have just started development in rails. So, don't know much about it.
But, I get some kind of error when I installed it.
$gem install rails -v 4.2.0
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Did you run rbenv rehash after installing that version of ruby? Perhaps your PATH is pointing to the wrong gem command?
I've run into something similar.
Try
xcode-select --install
Than perhaps give this a go if it still doesn't work:
rbenv uninstall 2.1.2p95
rbenv install 2.1.2p95
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
I'm on Ubuntu 11
Tring to install rails 3.1
It seems like I install rails but then I can't use it.
I want to use rvm to install and use rails and I do not want to go the sudo apt-get route.
Thanks!
durrantm#castleLinux2011:~$ rvm list rubies
rvm rubies
ruby-1.9.2-p290 [ x86_64 ]
durrantm#castleLinux2011:~$ rvm use --create 1.9.2#rails3
Using /home/durrantm/.rvm/gems/ruby-1.9.2-p290 with gemset rails3
durrantm#castleLinux2011:~$ rvm list rubies
rvm rubies
=> ruby-1.9.2-p290 [ x86_64 ]
durrantm#castleLinux2011:~$ gem install rails
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
durrantm#castleLinux2011:~$ sudo gem install rails
Successfully installed rails-3.1.0
1 gem installed
Installing ri documentation for rails-3.1.0...
file 'lib' not found
Installing RDoc documentation for rails-3.1.0...
file 'lib' not found
durrantm#castleLinux2011:~$ rails
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
durrantm#castleLinux2011:~$
btw
durrantm#castleLinux2011:~$ gem install rails
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
durrantm#castleLinux2011:~$
doesn't work either and I have danced around the zlib issue for about an hour.
Also:
rvm gemset install rails
installing rails ...
ERROR: Error running 'GEM_HOME='/home/durrantm/.rvm/gems/ruby-1.9.2-p290#rails3' GEM_PATH='/home/durrantm/.rvm/gems/ruby-1.9.2-p290#rails3' gem install rails ', please read /home/durrantm/.rvm/log/ruby-1.9.2-p290/gem.install.log
rails failed to install ( output logged to: /home/durrantm/.rvm/log/ruby-1.9.2-p290/gem.install.log )
durrantm#castleLinux2011:~$ tail -20 /home/durrantm/.rvm/log/ruby-1.9.2-p290/gem.install.log
[2011-09-13 09:17:57] GEM_HOME='/home/durrantm/.rvm/gems/ruby-1.9.2-p290#rails3' GEM_PATH='/home/durrantm/.rvm/gems/ruby-1.9.2-p290#rails3' gem install rails
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
durrantm#castleLinux2011:~$
no no, no rvmsudo.
rvm pkg install zlib && rvm install 1.9.2 (so it builds against that zlib that rvm installed) && rvm --create use 1.9.2#rails31 (to create a rails31 gemset and use it all on one go)
NOTE: use rvm install 1.9.2 if you used that to install originally. the -p290 shows up because it is a result of the fact that the ruby project has 290 as the official release and rvm picks up on that. This way with 1.9.2 and not 1.9.2-p290 when 1.9.2 series is jumped, rvm will pick up on that and install that instead. Otherwise if you originally did 'rvm install 1.9.2-p290' then do that instead.
As for the rails command. If you executed the above commands then you have been moved into the right rvm controlled ruby and gemset. If not then execute that command now (rvm --create use 1.9.2#rails31)
NOW you can execute gem install rails -v='3.1.0' (I added the version just in case rails changes before you see this)
This will install the rails gem and its deps into Ruby 1.9.2-p290's rails31 gemset. Now you can execute rails new test_app to test it. (I usually mkdir -p $HOME/tmp && cd $HOME/tmp && rails new test_app)
This should eliminate your problems.
You need to reinstall ruby. Follow the instructions in http://beginrescueend.com/packages/zlib/.
You might get the same problem with readline or openSSL, check the rvm website as they provide some workarounds for those libraries too.