bundle install Library not loaded error - ruby-on-rails

Environment:
Rails 3.2.11
Heroku bamboo-mri-1.9.2
Using RVM
ruby-1.9.2-p290
my .rvmrc is configured to use ruby-1.9.2-p290
When running the bundle install command, I am getting this:
/Users/joel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/Users/joel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle, 9): Library not loaded: /opt/local/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /Users/joel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle
Reason: image not found - /Users/joel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle
from /Users/joel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/definition.rb:1:in `<top (required)>'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/cli.rb:245:in `install'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/bin/bundle:19:in `load'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/bin/bundle:19:in `<main>'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/joel/.rvm/gems/ruby-1.9.2-p290#global/bin/ruby_noexec_wrapper:14:in `<main>'
Any ideas on how to resolve this?
TRY 1
rvm pkg install openssl
rvm reinstall all --force
then cd .. and cd project_folder
bundle install
All gem install again properly
the first error is gone
BUT when I move into another project using ruby 1.9.3, I get a 'new' error, so it seems like I won't be able to use at the same time 1.9.2 and 1.9.3 ... or I'll have to reinstall my gems everytime ??? I must missing something.
here the new error:
/Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle, 9): Symbol not found: _rb_Digest_SHA1_Finish (LoadError)
Referenced from: /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle
Expected in: flat namespace
in /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle - /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/x86_64-darwin11.4.2/digest/sha1.bundle
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/definition.rb:1:in `<top (required)>'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/cli.rb:301:in `update'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/bin/bundle:19:in `load'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#global/bin/bundle:19:in `<main>'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#creativebank/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/joel/.rvm/gems/ruby-1.9.3-p429#creativebank/bin/ruby_noexec_wrapper:14:in `<main>'

Since you mentioned you recently moved from MacPorts to Homebrew, I'd say it's likely that you had some gems that were compiled against a MacPorts-installed library (in /opt/local) that doesn't exist anymore. You should recompile those gems to link against the Homebrew-supplied versions of those libraries (or the Apple ones, if they exist). You can recompile a gem with native components simply be re-installing it.

Related

What privileges do I lose when I install cocoapods without sudo?

I want to install CocoaPods, but I don't have an administrator account, meaning I can't use sudo. Can I install CocoaPods without sudo, and if I can what privileges do I loose?
Update
I tried gem install cocoapods --user-install and I got this output:
/usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.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.
/usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/psych-2.0.13/psych.bundle, 9): Library not loaded: /usr/local/lib/libruby.2.2.0.dylib (LoadError)
Referenced from: /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/psych-2.0.13/psych.bundle
Reason: image not found - /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0/psych-2.0.13/psych.bundle
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/psych-2.0.13/lib/psych.rb:1:in `<top (required)>'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/yaml.rb:5:in `<top (required)>'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems.rb:624:in `load_yaml'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/config_file.rb:328:in `load_file'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/config_file.rb:197:in `initialize'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/gem_runner.rb:74:in `new'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/gem_runner.rb:39:in `run'
from /usr/local/bin/gem:21:in `<main>'
The other solution of installing RVM I looked into, but I had trouble installing it. (Maybe because I'm not an admin?)
Look at cocoapods documentation:
https://guides.cocoapods.org/using/getting-started.html#sudo-less-installation

Ruby installation missing psych, suggests reinstall of libyaml and ruby, and still have image not found? RailsTutorial

When using this command in the middle of my RailsTutorial ( on my laptop setup) :
rvm use 2.0.0#railstutorial_rails_4_0 --create --default
I receive the following errors:
laptop:rubygems-1.8.25 USER_NAME$ rvm use 2.0.0#railstutorial_rails_4_0 --create --default
Using /Users/USER_NAME/.rvm/gems/ruby-2.0.0-p451 with gemset railstutorial_rails_4_0
/Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/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.
/Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-darwin13.1.0/psych.bundle, 9): Library not loaded: /usr/local/lib/libyaml-0.2.dylib (LoadError)
Referenced from: /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-darwin13.1.0/psych.bundle
Reason: image not found - /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/x86_64-darwin13.1.0/psych.bundle
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/psych.rb:1:in `<top (required)>'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/yaml.rb:5:in `<top (required)>'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems.rb:600:in `load_yaml'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/config_file.rb:314:in `load_file'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/config_file.rb:191:in `initialize'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `new'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `do_configuration'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in `run'
from /Users/USER_NAME/.rvm/rubies/ruby-2.0.0-p451/bin/gem:21:in `<main>'
I've reinstalled libyaml, and reinstalled ruby, and it all returns back to these errors. No matter what I do, I always end up back at this list of errors.

Why does RMagick fail with Symbol not found LoadError when starting rails?

When I try to start "rails s" I get the following error:
/Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `require': dlopen(/Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Symbol not found: _AdaptiveBlurImage (LoadError)
Referenced from: /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/rmagick-2.13.2/lib/RMagick2.bundle
Expected in: flat namespace
in /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/rmagick-2.13.2/lib/RMagick2.bundle - /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/rmagick-2.13.2/lib/RMagick2.bundle
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/asciiman/Documents/Consulting/OneTaste/omhub/config/application.rb:7:in `<top (required)>'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/asciiman/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I'm running OS X Mountain Lion 10.8.5.
I've tried uninstalling and reinstalling imagemagick and rmagick and still get the same error.
I guess you did not installed dependencies. Try installing dependencies.
sudo apt-get install libmagick9-dev
sudo apt-get install libmagickwand-dev
I don't that this packages will work in mac, but it works in linux machine.

Why won't Rails' console start or make new apps?

A few days ago I updated my gems because things weren't running so fine, so I went back to 1.4.2. Since then I'm getting all kind of weird errors.
I'm using Ruby 2.0.0p247, Rails 4.0 and Ubuntu.
If I try to start a new app using rails new eraseme, everything goes fine until it's time to do bundle install. The output is:
run bundle install
/usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:270:in `require': cannot load such file -- bundler (LoadError)
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:270:in `bundle_command'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:277:in `run_bundle'
from (eval):1:in `run_bundle'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
from /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/application.rb:43:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/cli.rb:15:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/cli.rb:15:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/bin/rails:9:in `require'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/bin/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
If I try to open the console, I get:
>> bundle exec rails console
Loading development environment (Rails 4.0.0)
/usr/local/lib/ruby/2.0.0/irb/locale.rb:150:in `block in search_file': undefined method `try_activate' for Gem:Module (NoMethodError)
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:158:in `block in each_localized_path'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:167:in `each_sublocale'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:157:in `each_localized_path'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:145:in `search_file'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:124:in `find'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:108:in `load'
from /usr/local/lib/ruby/2.0.0/irb/locale.rb:32:in `initialize'
from /usr/local/lib/ruby/2.0.0/irb/init.rb:114:in `new'
from /usr/local/lib/ruby/2.0.0/irb/init.rb:114:in `init_config'
from /usr/local/lib/ruby/2.0.0/irb/init.rb:16:in `setup'
from /usr/local/lib/ruby/2.0.0/irb.rb:380:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `start'
from /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:64:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Have you already installed bundler? If not, try:
gem install bundler
If so, try:
gem install bundler --pre
If you running Ruby version manager, what version are you running? You might be set to the wrong version of Ruby.
I think it would be easier for you if you used RVM or some other version manager.
if you have multiple versions of rubygems installed, uninstall all but the one you want to use.
I think rails 4 requires rubygems 2.x.
Also check the bundler version.

Deploy Rails program to Heroku under Fedora 15

[root#chris-notebook helloworld]# heroku create helloworld --stack cedar
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- readline (LoadError)
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command/run.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:17:in `block in load'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:16:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:16:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/bin/heroku:13:in `<top (required)>'
from /usr/local/bin/heroku:19:in `load'
from /usr/local/bin/heroku:19:in `<main>'
When I try to create that, every time I got same error.
What should I do? I saw similar problems but under Ubuntu. They solve it by going some place ...src/ruby../ext/readline and then execute
ruby extconf.rb
make
make install
but I don't see that folder in file system. Why is it all so difficult?
Update
Solved by installing next packages
readline-devel.i686
readline-static.i686
And then making similar operations in the folder ext/readline that placed in downloaded sources of ruby.

Resources