Under 10.4.11, ruby-1.9.2-p290 and RVM I've just installed gems from an app's gemfile, but on running the server I get the following (a search only yields two similar questions, both unanswered), so even hints are welcome:
$ rails server
/Users/deveritt/.rvm/gems/ruby-1.9.2-p290/gems/ffi-1.0.9/lib/ffi/library.rb:75:in `block in ffi_lib': Could not open library 'libmagic.1.dylib': dlopen(libmagic.1.dylib, 5): image not found. Could not open library 'libmagic.so.1': dlopen(libmagic.so.1, 5): image not found. Could not open library 'libmagic.so.1.dylib': dlopen(libmagic.so.1.dylib, 5): image not found. Could not open library 'magic1.dll': dlopen(magic1.dll, 5): image not found. Could not open library 'libmagic1.dll.dylib': dlopen(libmagic1.dll.dylib, 5): image not found (LoadError)
from /Users/deveritt/.rvm/gems/ruby-1.9.2-p290/gems/ffi-1.0.9/lib/ffi/library.rb:54:in `map'
from /Users/deveritt/.rvm/gems/ruby-1.9.2-p290/gems/ffi-[SNIP]
3.0.6/lib/rails/commands.rb:27:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'
Is this familiar to anyone?
Update: found a Homebrew install just for libmagic that avoids the horrendous ImageMagick install, adapted it for a straight install without brew (YMMV):
get the file:
curl -O 'ftp://ftp.astron.com/pub/file/file-5.04.tar.gz'
Unzip etc. (or double-click) and move the resulting folder to /tmp, then ./configure, make and sudo make install as usual (see the file INSTALL if not sure). After this, RoR launched.
Related
Using Xcode v11.3 I try to export my .IPA file and get this error.
An error occurred during export. The data couldn’t be read because of it
isn’t in the correct format
This is shown in IDEDistribution.standard.log
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- cfpropertylist (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:15:in `<main>'
2020-02-05 07:57:11 +0000 /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1
2020-02-05 07:57:11 +0000 ipatool JSON: (null)
I have tried rvm use system but in vain. Thanking in anticipation.
TL;DR
Running:
$ gem install CFPropertyList
$ gem install sqlite3
and then restarting solved it for me.
Full story:
I've just had the same problem. Googling around I found this article which talks about a different problem, but pointed me to the right direction: there is an issue with Ruby.
I then bumped into this issue which focused on the cannot load such file -- cfpropertylist part of the error message.
Running gem install CFPropertyList effectively allowed me to move forward one more step. This time a similar error complained about sqlite3. Running gem install sqlite3, again, should solve the problem.
Please note that you need SQLite installed systemwide (brew install sqlite), and that you NEED to restart your system, for whatever reason.
to fix it on M1 Mac
Go to Xcode foldar > right click open Get Info > make sure open using Rosetta has been checked
don't forget quit Xcode then open it
I downloaded and installed Ruby 2.5.7-1 (x64) on a Windows 10 system from the following site:
https://rubyinstaller.org/downloads/
I then installed Rails and Bundler as follows:
gem install rails -v 5.2.3
gem install bundler
I then ran bundle install. This all worked fine.
However, after all that, when I try to run rails db:migrate or rails server, I get the following message:
rails aborted!
LoadError: Could not open library 'libcurl': The specified module could not be found.
.
Could not open library 'libcurl.dll': The specified module could not be found.
.
Could not open library 'libcurl.so.4': The specified module could not be found.
.
Could not open library 'libcurl.so.4.dll': The specified module could not be found.
C:/path-to-app/config/application.rb:18:in `<top (required)>'
C:/path-to-app/Rakefile:4:in `require'
C:/path-to-app/Rakefile:4:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
When I Google this error, everything seems to point to the following SO post and top answer:
How to solve 'libcurl' not found with Rails on Windows
I downloaded several versions of libcurl.dll, placed them in the C:\Ruby25-x64\bin directory, restarted the DB server, restarted my IDE with terminal, and tried again, but I still keep getting the same error.
I've also confirmed that C:\Ruby25-x64\bin is part of my user Path variable, but I'm still getting this issue.
Does anyone have any ideas on how I can resolve this, since the SO post linked above either doesn't work (or I'm not doing something that's obvious)? Thanks.
I am coming up against issues running a rails server on a local environment. I am on Mac OS X 10.10. I think they relate to the osx-gcc-installer.
Running in Terminal:
$ rails server
Results in:
Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3
Cool, so then I run:
$ rvm install 1.9.3-p550
Which results in:
-bash: rvm: command not found
This solves that:
$ source ~/.bashrc
So I run this again:
$ rvm install 1.9.3-p550
Which produces this:
Warning, new version of rvm available '1.26.1', you are using older version '1.26.0'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-1.9.3-p550.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
password required for 'softwareupdate -l':
Checking requirements for osx.
Installing requirements for osx.
Updating system.....
Installing required packages: gcc48, libyaml, libksba......
Error running 'requirements_osx_brew_libs_install gcc48 libyaml libksba',
showing last 15 lines of /Users/<user>/.rvm/log/1415842393_ruby-1.9.3-p550/package_install_gcc48_libyaml_libksba.log
++ case "$1" in
++ [[ -t 1 ]]
++ return 1
++ printf %b 'There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.
Try `brew tap --repair` and make sure `brew doctor` looks reasonable.
Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
++ case "$_system_version" in
++ return 1
Requirements installation failed with status: 1.
So, as it suggests, I try:
brew tap --repair
Which says:
Pruned 0 dead formulae
Tapped 161 formulae
And run:
brew doctor
Which gives two warnings both mentioning osx-gcc-installer (which I stupidly installed as part of the Team Treehouse instructions for setting up a dev environment):
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages.
Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please run `xcode-select --install` to install the CLT.
I run:
xcode-select --install
And get this:
Usage: xcode-select -print-path
or: xcode-select -switch <xcode_folder_path>
or: xcode-select -version
Arguments:
-print-path Prints the path of the current Xcode folder
-switch <xcode_folder_path> Sets the path for the current Xcode folder
-version Prints xcode-select version information
Which doesn't seem to have done anything so I fetch the CLT from https://developer.apple.com/downloads/index.action# (which I'm pretty sure I had beforehand), install, and reboot.
Do I really need to reinstall my OS to solve this problem? That seems like overkill and I'm hoping somebody has another solution.
Update
On the suggestion of a commenter, I tried this:
$ rvm use 1.9.3 --default
Which returned:
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.
So I tried the steps here and
$ source ~/.rvm/scripts/rvm
And re-ran:
$ rvm use 1.9.3
Which resulted in
ruby-1.9.3-p550 is not installed.
To install do: 'rvm install ruby-1.9.3-p550'
So I checked which versions I had using
$ rvm list
And got
rvm rubies
ruby-1.9.3-p0-falcon [ x86_64 ]
ruby-1.9.3-p545 [ x86_64 ]
Then ran:
$ rvm use 1.9.3-p0-falcon --default
And tried:
$ rails server
Which resulted in:
Could not find bcrypt-ruby-3.0.1 in any of the sources
Run `bundle install` to install missing gems.
But bundle install outputs:
/Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/1.9.1/x86_64-darwin13.1.0/openssl.bundle, 9): Library not loaded: ##HOMEBREW_CELLAR##/openssl/1.0.1j/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Reason: image not found - /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/1.9.1/x86_64-darwin13.1.0/openssl.bundle
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/1.9.1/openssl.rb:17:in `<top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/net/http/persistent.rb:201:in `<class:Persistent>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/net/http/persistent.rb:191:in `<top (required)>'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendored_persistent.rb:3:in `<top (required)>'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/rubies/ruby-1.9.3-p0-falcon/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/fetcher.rb:1:in `<top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/cli.rb:247:in `install'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `run'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/vendor/thor/base.rb:440:in `start'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/cli.rb:10:in `start'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/bin/bundle:20:in `block in <top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/gems/bundler-1.5.3/bin/bundle:20:in `<top (required)>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/bin/bundle:23:in `load'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon#global/bin/bundle:23:in `<main>'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon/bin/ruby_executable_hooks:15:in `eval'
from /Users/<username>/.rvm/gems/ruby-1.9.3-p0-falcon/bin/ruby_executable_hooks:15:in `<main>'
Which looks a bit more serious, but at least it isn't telling me to reinstall my OS.
I am getting the following error:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/yaml.rb:4: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.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- psych (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/bin/hub:190:in `<main>'
I've tried the suggestions on Stack Overflow which are related libyaml and psych. However, many of those require rvm commands which return the following error:
rvm reinstall 2.0
/Users/richardburton/.rvm/src/ruby-2.0.0-p247 has already been removed.
Removing /Users/richardburton/.rvm/rubies/ruby-2.0.0-p247 - please wait
Error running '__rvm_rm_rf /Users/richardburton/.rvm/rubies/ruby-2.0.0-p247',
please read /Users/richardburton/.rvm/log/1401921952_ruby-2.0.0-p247/remove.rubies.log
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.0.0-p247.
Obviously there are a rvm binaries available at this stage. Any tips or suggestions on how I can get Ruby 2.0 up and running would be much appreciated.
Thanks!
The first error you are receiving is referencing your system ruby, and you're reinstalling with rvm. Try running which ruby. Most likely this can be fixed by updating your path. I wouldn't recommend reinstalling the system ruby, so I'd definitely recommend getting whatever was causing the first error to work with rvm.
If that still isn't working, I'd next try using rbenv instead of rvm. I'm personally a fan of rbenv and have had no issues with my Ruby using it. It's super easy to get up and running, and could be a good temp fix.
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile # or whichever profile you are using
$ source ~/.bash_profile # or whichever profile you are using
$ rbenv install <version number>
$ rbenv global <version number>
Links to rbenv info:
rbenv: https://github.com/sstephenson/rbenv
ruby-build: https://github.com/sstephenson/ruby-build#readme
rvm package install libyaml
rvm reinstall 1.9.3 --with-libyaml-dir=/home/rails/.rvm/usr
I had the same error and this worked for me
Source: https://serverfault.com/questions/442150/how-to-fix-ruby-installation-is-missing-psych-for-yaml-output-on-centos
I've bumped into the same issue and I have tried two solutions:
1) Using ruby-build to build ruby-2.0-p451 with prefix /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr --> DOES NOT WORK (GOT SEGMENTATION FAULT)
2) Replace with the stock version shipped with OSX 10.9 ---> WORKS!!
Please see my snippet on how to do it here: https://gist.github.com/joneslee85/73ece54ba5b3a17e8bb2
Now I can go to sleep. Good luck!
I can't get Typhoeus gem to work on my Windows 7 machine.
Basically, it doesn't find "native.so" file in "C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/ext/typhoeus/". How do I fix this?
C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/lib/typhoeus.rb:10:in
`require': 126: The specified module
could not be found. -
C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/ext/typhoeus/native.so
(LoadError) from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/lib/typhoeus.rb:10:in
`<top (required)>' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
`require' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:68:in
`block (2 levels) in require' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
`each' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:66:in
`block in require' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
`each' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:55:in
`require' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler.rb:120:in`require'
What worked for me (Win7 x64) was to download the .dll from the link called Download libcurl.dll (all versions) only, found here: http://www.paehl.com/open_source/?CURL_7.35.0.
After extracting I took the .dll file from the NoSSL/SSL directory (either seems to work, I used SSL just to be sure). I copied the file into Ruby's /bin directory and Typhoeus worked.
Note: You can't use the x64 version of the .dll because Ruby is 32-bit. Typhoeus didn't react to the x64 file.
Hopefully this will help someone.
The problem seems that typhoeus requires curl as development library to successfully compile it's native.so extension.
First you need to install RubyInstaller DevKit from downloads page.
Second you will need to get curl and development headers and libraries for MinGW, which you can find instructions on our mailing list:
http://groups.google.com/group/rubyinstaller/browse_thread/thread/c8a4bdb6663cbf7c
To the record, that same post mentions how unsuccessfully was the user attempt to get the gem to work on Windows and he ended switching to curb.
PS: while others might say that *.so is UNIX/POSIX convention for shared objects, is the extension Ruby decided to use for Windows C-Extensions, like Python uses *.pyd for their extensions.
if that gem is looking for native.so then it might not work with windows, *.so is the *NIX equivalent of *.dll for windows a "shared object " or " dynamically linked library" file. So it might really need native.dll, or be a gem built on platform dependent code. Look at their documentation, this is just a shot in the dark.
then again, it says something happened in native.so ( LoadError) so maybe its begin executed, idk