I'm trying to set up Ruby on Rails on a Ubuntu server. I don't care which version of ruby as long as I find one that works, but I'm working with v2.1.0. Whenever I try to run any sudo gem ... commands I get the following error:
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I've figured that I just have to install openssl, but when I try it using rvm pkg install openssl it works for a while but then fails and gives the following output:
Checking requirements for ubuntu.
Requirements installation successful.
Fetching openssl-1.0.1g.tar.gz to /home/ubuntu/.rvm/archives
Extracting openssl to /home/ubuntu/.rvm/src/openssl-1.0.1g...
Configuring openssl in /home/ubuntu/.rvm/src/openssl-1.0.1g..................................
Compiling openssl in /home/ubuntu/.rvm/src/openssl-1.0.1g.............................................................................................................................
Installing openssl to /home/ubuntu/.rvm/usr.............................
Error running '__rvm_make install',
showing last 15 lines of /home/ubuntu/.rvm/log/1401942843/openssl_make.install.log
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ubuntu/.rvm/src/openssl-1.0.1g/tools'
installing man1/CA.pl.1
installing man1/asn1parse.1
installing man1/ca.1
installing man1/ciphers.1
installing man1/cms.1
cms.pod around line 457: Expected text after =item, not a number
cms.pod around line 461: Expected text after =item, not a number
cms.pod around line 465: Expected text after =item, not a number
cms.pod around line 470: Expected text after =item, not a number
cms.pod around line 474: Expected text after =item, not a number
POD document had syntax errors at /usr/bin/pod2man line 71.
make: *** [install_docs] Error 255
+ return 2
Please note that it's required to reinstall all rubies:
rvm reinstall all --force
Updating openssl certificates..
I have a few openssl directories all ready on my system and I've tried reinstalling ruby several times using parameters like --use-openssl-dir pointing to each one but I still get the exact same error shown at the top of this post. I'm sure that I have to somehow get rvm pkg install openssl to work. Any insight would be appreciated.
UPDATE Well I just nuked my version of ruby and installed it again fresh and it is working fine now.
Related
I am working on an app that was written using Ruby 2.3.0 (with Rails) and my operating system is Linux Ubuntu 21.1. (Hoping to upgrade the project's version of Ruby but having trouble doing that as well)
To get the app working, my first notion was to use rbenv to install 2.3.0, but after much trouble shooting I continue to receive the following errors:
~$ rbenv install 2.3.0
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...
WARNING: ruby-2.3.0 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
BUILD FAILED (Ubuntu 21.10 using ruby-build 20211203)
Inspect or clean up the working tree at /tmp/ruby-build.20211214112011.528089.XXe70o
Results logged to /tmp/ruby-build.20211214112011.528089.log
Last 10 log lines:
linking shared-object nkf.so
make[2]: Leaving directory '/tmp/ruby-build.20211214112011.528089.XXe70o/ruby-2.3.0/ext/nkf'
linking shared-object bigdecimal.so
make[2]: Leaving directory '/tmp/ruby-build.20211214112011.528089.XXe70o/ruby-2.3.0/ext/bigdecimal'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20211214112011.528089.XXe70o/ruby-2.3.0/ext/date'
linking shared-object ripper.so
make[2]: Leaving directory '/tmp/ruby-build.20211214112011.528089.XXe70o/ruby-2.3.0/ext/ripper'
make[1]: Leaving directory '/tmp/ruby-build.20211214112011.528089.XXe70o/ruby-2.3.0'
Error log file:
error log file
I have tried to install openssl 1.0 using:
~$ brew install rbenv/tap/openssl#1.0
x86_64cpuid.s: Assembler messages: x86_64cpuid.s:2: Error: unknown
pseudo-op: `.private_extern' x86_64cpuid.s:3: Error: unknown
pseudo-op: `.mod_init_func' x86_64cpuid.s:7: Error: unknown pseudo-op:
`.private_extern' make[1]: *** [<builtin>: x86_64cpuid.o] Error 1
make[1]: Leaving directory
'/tmp/opensslA1.0-20211213-493929-qg8eui/openssl-1.0.2t/crypto' make:
*** [Makefile:287: build_crypto] Error 1
If reporting this issue please do so at (not Homebrew/brew or
Homebrew/core): https://github.com/rbenv/homebrew-tap/issues
These open issues may also help: `brew install rbenv/tap/openssl#1.0` not working anymore https://github.com/rbenv/homebrew-tap/issues/1
I followed the link in the error message, and tried the advice there:
~$ brew tap rbenv/tap
~$ brew install rbenv/tap/openssl#1.0
x86_64cpuid.s: Assembler messages:
x86_64cpuid.s:2: Error: unknown pseudo-op: `.private_extern'
x86_64cpuid.s:3: Error: unknown pseudo-op: `.mod_init_func'
x86_64cpuid.s:7: Error: unknown pseudo-op: `.private_extern'
make[1]: *** [<builtin>: x86_64cpuid.o] Error 1
make[1]: Leaving directory '/tmp/opensslA1.0-20211213-498635-w2ky1d/openssl-1.0.2t/crypto'
make: *** [Makefile:287: build_crypto] Error 1
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/rbenv/homebrew-tap/issues
These open issues may also help:
`brew install rbenv/tap/openssl#1.0` not working anymore https://github.com/rbenv/homebrew-tap/issues/1
I have also attempted to upgrade the app's version of ruby, and continue to run into errors - such as outdated dependencies. I am new to ruby and rails and am still learning!
This is my first post, so apologies if it's not great or I missed some details. I am happy to provide any further information needed.
Thank you so much for your help.
Thanks to #Casper's help, I solved the problem.
For recent releases of Ubuntu, rbenv fails to install Ruby below 2.4 because of the mismatching OpenSSL dependency.
The problem was solved for me by using the Ubuntu 16.04 version that was installed on a different computer.
I'm on the Ruby track and I'm in the installation process of Ruby on Rails.
I'm trying to install gems but it's not happening and i'm not sure why and how to fix it.
$gem install bundler
ERROR: Loading command: install (LoadError)
dlopen(/Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64- darwin13.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64- darwin13.0/openssl.bundle
Reason: image not found - /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Here is one of the solutions that i've tried:
$CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1
rbenv: /Users/nthulanemakgato/.rbenv/versions/2.1.1 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140429120202.53716.log
Last 10 log lines:
x yaml-0.1.6/win32/vc6/test_reader.dsp
x yaml-0.1.6/win32/vc6/run_loader.dsp
x yaml-0.1.6/win32/vc6/run_parser.dsp
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp
x yaml-0.1.6/win32/vc6/libyaml.dsw
x yaml-0.1.6/win32/vc6/yaml.dsp
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml- 0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~
configure: WARNING: unrecognized options: --with-openssl-dir
configure: error: expected an absolute directory name for --prefix: openssl
BUILD FAILED
Inspect or clean up the working tree at /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140429120202.53716.log
Last 10 log lines:
x yaml-0.1.6/win32/vc6/run_loader.dsp
x yaml-0.1.6/win32/vc6/run_parser.dsp
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp
x yaml-0.1.6/win32/vc6/libyaml.dsw
x yaml-0.1.6/win32/vc6/yaml.dsp
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml- 0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~
configure: WARNING: unrecognized options: --with-openssl-dir
configure: error: expected an absolute directory name for --prefix: openssl
make: *** No targets specified and no makefile found. Stop.
I have openssl-1.0.1g installed
I'm using Mac 10.9.2
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
rbenv 0.4.0-97-gfe0b243
This is not like other questions in that i'm using rbenv whereas others ask rvm related questions which I can't use.
Thanks in advance.
I found that although I already had openSSL installed I needed to brew upgrade ruby before it was recognized. Another maze of twisty little passages, all alike.
It looks like you need to install OpenSSL first.
So try to install it:
$ brew install openssl
And then you need to recompile ruby with OpenSSL:
$ CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1-p76
When I checked my
rbenv local
and
rbenv global
they we different.
So I set
rbenv local 2.6.5
and it resolved my issue
I saw a similar error out of nowhere too one day…
I just removed then reinstalled ruby, and the error was fixed.
try to use this code in cmd
chcp 1252
I had Ruby-on-Rails installed, but it was Ruby version 1.9.3. It was installed via the Railsinstaller. Since I am just starting in RoR, I wanted to start with the most updated versions to go through the Ruby on Rails Tutorial. Rails was easy enough to update, but not Ruby itself.
I uninstalled the existing RailsInstaller, deleted the c:\Railsinstaller directory and downloaded the latest version of RailsInstaller, version 3.0.0-alpha.1.
Upon install it launches a command prompt window that should list the install infor for git, ruby and rails. Instead I got this error:
The system cannot find the path specified.
Rails Environment Configuration.
C:/RailsInstaller/scripts/config_check.rb:28:in ``': No such file or directory -
rails -v (Errno::ENOENT)
from C:/RailsInstaller/scripts/config_check.rb:28:in `run'
from C:/RailsInstaller/scripts/config_check.rb:83:in `<main>'
C:\Sites>
Line 28 is part of this block:
def run(command)
$stderr.puts "Running #{command}" if Config[:debug]
%x{#{command}}.chomp
end
and line 83 is this inside of a 'puts' block:
version: #{run "rails -v"}
manually running "rails -v"
C:\Sites>rails -v
'rails' is not recognized as an internal or external command,
operable program or batch file.
attempting "ruby rails.rb"
ruby: No such file or directory -- rails.rb (LoadError)
attempting to manually install the rails gem
c:\Sites>gem install rails --version 4.0.0
Fetching: i18n-0.6.4.gem (100%)
Successfully installed i18n-0.6.4
Fetching: atomic-1.1.10.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0
.0/gems/atomic-1.1.10 for inspection.
Results logged to C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.
1.10/ext/gem_make.out
The gem_make.out only contains:
C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
I attempted to install Railsinstaller 3.0.0 on a windows xp machine to test, and got the same error after the install, running "rails -v" failed in the same way, but running "gem install rails --version 4.0.0" worked.
Did something persist from the previous install that is preventing the new install from functioning properly?
I think something is still trying to go to the Ruby1.9.3 forlder and/or subfolders and failing, but can't find anything referencing that directory.
After a bunch of additional research and out side help, found this:
You’ve installed both RubyInstaller and DevKit following the instructions but during gem installation, you receive a message like this:
C:\devkit>gem install rdiscount --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
C:/ruby/bin/ruby.exe extconf.rb
C:/ruby/bin/ruby.exe: No such file or directory -- extconf.rb
(LoadError)
Or sometimes just this:
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb
This has been reported to our group here and here.
After a long back and forth investigation, we found two possible causes for this issue: COMSPEC environment variable (scenario A) and AutoRun registry setting (scenario B), both described below:
Scenario A
Using a command prompt, invoke the following command:
SET COMSPEC
If in the output you see something different than cmd.exe as value for that variable, then please adjust it to use cmd.exe
Some tools might change your command processor command, which interferes with Ruby invoking child processes.
Change that and try to install the gem again.
Scenario B
If the problem persist, invoke the following commands in the same command prompt:
REG QUERY "HKCU\Software\Microsoft\Command Processor"
REG QUERY "HKLM\Software\Microsoft\Command Processor" /s
Execute each line individually. Once you run it, will see something like this:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
CompletionChar REG_DWORD 0x9
DefaultColor REG_DWORD 0x0
EnableExtensions REG_DWORD 0x1
PathCompletionChar REG_DWORD 0x9
The columns of information are Key, Type and Value. If you see a key named AutoRun, there is a chance this is the culprit of the error you’re receiving.
AutoRun interferes with Ruby messing with child process executing and by result, affecting gem installation. Please remove it with the following command:
REG DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun
Once you’re done, try opening a new command prompt and executing gem installation again.
Scenario B ended up being the culprit and things began working properly once that was completed.
I apologize that this doesn't actually answer your question at hand, but I think it's still useful advice to you:
Consider downloading Virtualbox and installing some Linux (Fedora, Ubuntu) on it and doing your Rails development on that Linux virtual machine. It won't mess with your Windows system at all, but it will be much easier to develop Rails with.
Almost nobody develops Rails on Windows, everyone uses Mac or Linux it seems. And I always read people having problems setting it up on Windows. It just doesn't seem worth the effort to me when you have free tools out there to develop on Linux.
Again, sorry this isn't actually the proper answer to the question. Even once you find the answer to your problem, I'd still recommend you consider this advice. You're likely to have more problems with Rails on Windows.
I have been trying to get my dev environment setup on my computer for a number of days now, but without any luck. I've had more error messages than I could care to remember and my installation problems have been anything but consistent.
My current problem is unknown as I don't know where its stemming from.
When I try to check my gem version gem -v, the terminal locks up for a couple minutes and then gives me this output:
/Users/Riley/.rvm/bin/gem: line 6: /Users/Riley/.rvm/bin/gem: Argument list too long
/Users/Riley/.rvm/bin/gem: line 6: /Users/Riley/.rvm/bin/gem: Undefined error: 0
The entire contents of that file are as follows:
#!/usr/bin/env bash
if [[ -s "/Users/Riley/.rvm/environments/ruby-2.0.0-p0" ]]
then
source "/Users/Riley/.rvm/environments/ruby-2.0.0-p0"
exec gem "$#"
else
echo "ERROR: Missing RVM environment file: '/Users/Riley/.rvm/environments/ruby-2.0.0-p0'" >&2
exit 1
fi
And I don't have a clue what its supposed to be, if not that. Checking which ruby gives me:
/Users/Riley/.rvm/bin/ruby
And the problem really seems to come alive when I try to install rails, gem install rails:
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
** This error has ceased to occur and is now replaced with the above "line 6" error for gem -v, however I'm sure it will show up again.
I have also tried all of this:
rvm get head --autolibs=3
rvm pkg remove
rvm reinstall all --force
and all the other renditions of solutions on SO and many other sites.
I would greatly appreciate someone helping me with this setup as I don't have any solution to my problem outside of google and SO.
The problem stemmed from my installation of Ruby. Apparently, as stated in this answer, "a non-LLVM version of GCC" is no longer included in the XCode command line tools.
Installing ruby with:
rvm install ruby --with-gcc=clang
Worked and I installed RVM, Ruby and Rails within about 10 minutes, despite it taking me a week of debugging and reinstalling otherwise.
Run rvm requirements and install all the dependencies as specified (openssl being one of them). It should fix your problem.
I'm trying to install Ruby on Rails on my Synology DS209 using the instructions at http://wiki.joachimschuster.de/index.php/Install_Ruby_on_Rails_and_Redmine_on_DS210%2B. I have all the prerequirements checked (except for the redmine-user, which I assume isn't the problem), and the rubygems and zlib packages installs just fine through ipkg.
However, when i run gem, I get the following errors:
DiskStation> gem
/opt/bin/gem: line 8: require: not found
/opt/bin/gem: line 9: require: not found
/opt/bin/gem: line 10: require: not found
/opt/bin/gem: line 12: required_version: not found
/opt/bin/gem: line 14: unless: not found
/opt/bin/gem: line 15: abort: not found
/opt/bin/gem: line 16: end: not found
/opt/bin/gem: line 21: syntax error: unexpected "("
DiskStation>
Any suggestions?
EDIT:
Removing and reinstalling rubygems revealed the following:
DiskStation> ipkg remove -force-removal-of-dependent-packages ruby
Removing package rubygems from root...
Removing package ruby from root...
Successfully terminated.
DiskStation> ipkg install rubygems
Installing rubygems (1.1.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/rubygems_1.1.1-1_arm.ipk
Installing ruby (1.9.1.243-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ruby_1.9.1.243-1_arm.ipk
Configuring apache
update-alternatives: Linking //opt/sbin/htpasswd to /opt/sbin/apache-htpasswd
update-alternatives: Linking //opt/sbin/httpd to /opt/sbin/apache-httpd
httpd: Syntax error on line 75 of /opt/etc/apache2/httpd.conf: Cannot load /opt/libexec/mod_ext_filter.so into server: /opt/libexec/mod_ext_filter.so: undefined symbol: apr_procattr_limit_set
httpd: Syntax error on line 75 of /opt/etc/apache2/httpd.conf: Cannot load /opt/libexec/mod_ext_filter.so into server: /opt/libexec/mod_ext_filter.so: undefined symbol: apr_procattr_limit_set
postinst script returned status 1
ERROR: apache.postinst returned 1
Configuring ruby
Configuring rubygems
Successfully terminated.
I have the same problem..
gem is a script file and if you see inside, it calls ruby like this "#!/opt/bin/ruby".
Let's see "/opt/bin/ruby"!! it is also a script file which calls "#!/opt/bin/ruby".
It's non-sense...
I think that there is a bug installing packages.. Up to now, I have no solution...
I found solution...
Install ruby again.
ipkg install ruby -force-reinstall
after this, you have binary ruby file.
If you trying redmine on DSM 4.0, installing rails require libcrypto.so.0.9.8 which is not in your NAS. Make a copy with /usr/lib/libcrypto.so.1.0.0 and you would make it.
Thanks for all the answers, it was enough for Ruby, but I had to do a bit more to get rails 2.3.5 installed (I also wanted to get Redmine on my DS209+; I'm glad to report that's working for me).
I tried this (from this web site: http://ash-ride.blogspot.ca/2010/09/redmine.html)
gem install rails -v 2.3.5
But all I got was:
ERROR: Error installing rails:
rake requires RubyGems version >= 1.3.2
So here's how I got around and installed rails:
gem install rack -v 1.0.1
wget http://rubyforge.org/frs/download.php/55066/rubygems-1.3.2.tgz
tar xvzf rubygems-1.3.2.tgz
cd rubygems-1.3.2
ruby setup.rb
gem install rails -v 2.3.5
And bingo, working copy of rails with DSM 4.0-2198 on a DS209+. Not sure if I had to install rack first, but hey, it's working! Last steps for Redmine are to install the MySQL connector and download RedMine (see blogspot reference).
Thanks for the trick on libcrypto.so.0.9.8. I had to do the same thing on copying libssl.so.1.0.0 to libssl.so.0.9.8 (required for the database script).