I have read just about every post regarding rails errors looking for the solution to my issues and while I have resolved some, I come up with more. I upgraded to Snow Leopard and installed RVM and Rails according to the Agile Development with Rails book. However once I create my app folders and do RAKE, I get this error and I just can not figure out how to fix it. I've tried re-installing everything several times to no avail. Is this an architecture problem? or do I need to find a library and load it? how do I do that?
rake aborted!
dlopen(/opt/local/lib/ruby/1.8/i686-darwin9/digest/sha1.bundle, 9): Library not loaded: /opt/local/lib/libcrypto.1.0.0.dylib
Referenced from: /opt/local/lib/ruby/1.8/i686-darwin9/digest/sha1.bundle
Reason: no suitable image found. Did find:
/opt/local/lib/libcrypto.1.0.0.dylib: mach-o, but wrong architecture - /opt/local/lib/ruby/1.8/i686-darwin9/digest/sha1.bundle
(See full trace by running task with --trace)
There was probably a change in your system. You might have moved or deleted some files or folders, which were needed by ruby.
rvm reinstall ree
Or spyle's answer is basically correct, but ewww macports. go go Homebrew!
I had this problem with ruby 1.8.7/passenger/apache stack. Reinstalling ruby (via macports) and rebuilding it against the openssl library fixed this for me.
Related
I am setting up a Rails Project. Each time I go to start the server, I am getting a big error;
rails server puma
warning: ignoring extraneous `ruby-' prefix in version `ruby-2.0.0-p247'
(set by /Users/jamesnewman/shout_factory/.ruby-version)
/Users/jamesnewman/shout_factory/vendor/bundle/gems/pg-0.15.1/lib/pg.rb:4:in `require': dlopen(/Users/jamesnewman/shout_factory/vendor/bundle/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: /Users/jamesnewman/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.2.0.0.dylib (LoadError)
Referenced from: /Users/jamesnewman/shout_factory/vendor/bundle/gems/pg-0.15.1/lib/pg_ext.bundle
Reason: image not found - /Users/jamesnewman/shout_factory/vendor/bundle/gems/pg-0.15.1/lib/pg_ext.bundle
To try and fix this, I have done;
Removed rvm for rbenv
Uninstalled and Re-Installed PG (with both Home Brew, and on the Gem Level)
Updated to ruby-2.0.0-p247 (as per the request of another dependency)
And many more attempts to fix that I have probably forgotten about. I have googled and tried almost every fix for something like this from different terminal commands, to full on switching from rvm to rbenv.
And just so I knew that it was this project that I was having a hard time with, and not something else, I started the server on a couple of my other projects and everything worked fine.
If anyone has any help on how to fix this, I would really appreciate it. If anyone needs to see maybe the gems I'm using or something else, I'd be more than happy to post it.
Note: This issue was able to be resolved. If anyone else has this issue, it can be fixed. It might be different, but for me, I was able to fix it by uninstalling all of the gems and reinstalling and setting up the entire project/system again from scratch. It was something wrong that I did, but it was able to be fixed.
Hope this helps anyone who may have a similar problem.
I just ran into this issue after downgrading PG from 14 to 13 due to port change. The solution that worked for me was to uninstall pg gem, then reinstall again.
I was running PostgreSQL 9.1, installed from Postgres (/Library/PostgreSQL/9.1) - ie not homebrew etc and on Mac OSX Leopard.
I upgraded to Snow Leopard and then immediately to Mountain Lion and had a mass of problems with gems failing to build etc, but got them fixed
Rails server crashed on startup with pg issues & I tried everything I could find but could not fix the prob - fixes included links etc, which may still persist (hence this background info might inform the solution)
I uninstalled postgresql 9.1 and installed Postgres App
Now on rake db:create I get the following:
rake aborted!
dlopen(/Users/mitch/.rvm/gems/ruby-1.9.2-p320#tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle, 9): Library not loaded: #loader_path/../lib/libpq.5.dylib
Referenced from: /Users/mitch/.rvm/gems/ruby-1.9.2-p320#tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle
Reason: no suitable image found. Did find:
/usr/local/lib/libpq.5.dylib: mach-o, but wrong architecture - /Users/mitch/.rvm/gems/ruby-1.9.2-p320#tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle
I'm running rvm (as u can see) and after the OS upgrade created a new gemset and installed Ruby
I've changed my path to reflect the advice of Postgresql App, after the OS upgrade I installed Xcode 5 and the command line tools as advised and I think my database.yaml file is ok
I suspect the problem might be connected with sym-links made earlier in the process, but I'm stuck to find the solution
Sounds like something has gone wrong in your Ruby installation. Try reinstalling Ruby Enterprise Edition via RVM:
rvm reinstall ree
I was experiencing the same issue with a different version of libpq. What I ended up doing is creating a link to the correct file:
sudo ln -s /Applications/Postgres93.app/Contents/MacOS/lib/libpq.5.6.dylib /usr/local/lib/
My previous answer was deleted as it wasn't originally an answer, just a confirmation of a similar issue. Hope this helps!
In the end I think this was tied up with the fact that Mountain Lion ships with Postgresql rather than MySQL as per previous OSX versions.
I couldn't make sense of the Postgres App, so I uninstalled it and also uninstalled the version of Postgresql that shipped with ML and then did a Homebrew install of the latest version of Postgresql (which places it in a different place than if you install it direct from the Postgresql site).
This seemed to straighten everything up
Operating System I am using is Mac OSX Mountain Lion.
First I will give some back story on how this cluster F started. I am going through a Ruby on Rails Web development book. I want to use PostgreSQL as my server. Before today I was using sqlite3. I downloaded PostgreSQL 9.1 from there website. I used the DMG installer. Once I was done with the install process it asked me to re-boot because of some sort of memory problem, I did that and it installed without error.
The problem started when I tried to use the "Rails Server" command in the terminal. This is what I got (I tried to strip out the unimportant stuff which would clutter everything up)
/Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/pg-0.12.2/lib/pg.rb:4:in `require': dlopen(/Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/pg-0.12.2/lib/pg_ext.bundle, 9): Library not loaded: /usr/lib/libcrypto.dylib (LoadError)
Referenced from: /usr/lib/libpq.5.dylib
Reason: Incompatible library version: libpq.5.dylib requires version 1.0.0 or later, but libcrypto.0.9.8.dylib provides version 0.9.8 - /Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/pg-0.12.2/lib/pg_ext.bundle
...
from /Users/Chris/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/commands.rb:50:in
I have read through the out put and I have done a lot of Google searching, and what I have found is that it's a problem with which version of libcrypto the server is fetching. Or something about the libssl. I have gone through the solutions on google and nothing seems to be working. Hopefully someone has had the same problem I have, and can help me.
Thanks in advance! -Chris
I really recommend you to use Homebrew to install postrgresql. It helps you to install all proper dependencies for version which correctly works with rails.
$ brew install postgresql
Do not forget to follow after install instructions from homebrew
Are you sure you installed PostgreSQL server/rubygem successfully? From the stack trace I think there's a problem about it.
If your PostgreSQL server/rubygem are working well, then switch another webserver, mongrel/thin are both OK, both have better performance than the default rails server(webrick) and easy to use.
I am trying to build Noosfero (http://noosfero.org/), a project done in Ruby, but I am pretty new in Ruby and Linux (my current environment).
I am following the instructions in their tutorial (http://gitorious.org/noosfero/noosfero/blobs/master/INSTALL and http://gitorious.org/noosfero/noosfero/blobs/master/HACKING).
I was supposed to run an apt-get install with many packages, everything worked except for libgettext-ruby-data, to which I get a message that "E: Package libgettext-ruby-data has no installation candidate".
I then download the source and try to run "rake db:schema:load", which I get the following error:
"rake aborted!
uninitialized constant Dependencies
/home/user/noosfero/Rakefile:10"
My rake file is the following:
require(File.join(File.dirname(FILE), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails' #this is the line that the dependency can't be found
I searched around and found this question here: Uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) , but changing the config files didn't help and I could wasn't able to downgrade my RubyGems because I do not know how to do that (gem -update returns a message that I have to do that using apt-get, but I can't find out in which package the gem program is).
The first time I run Rake, I get a message saying:
"I: Installing Debian-installed Rails from /usr/share/rails into vendor/rails.
I: Please note that the recommended Rails version is 2.1.0, and that other versions might not work"
But I don't know how to downgrade my Rails version.
I've got many paths to follow, so I've got many questions, I hope you can help me:
1- Does anyone knows how to fix it directly?
2- How can I downgrade Gems?
3- How can I downgrade Rails?
4- Where can I download gems and how can I install it? (The documentation provides a link, but this link is VERY strange: http://www.yotabanana.com/hiki/ruby-gettext.html?ruby-gettext ).
Any help is very appreciated.
Thanks,
Oscar
Edit: can this error be a problem in the project I downloaded and not in my environment? After some research I am starting to think it is, can it be?
It would help if you share your rake version, by the way.
In the meantime, take a look at this:
https://github.com/jimweirich/rake/issues/33
(Only valid for rake 0.9.0, though).
This was a version conflict I had with the project I was trying to build, not it is solved :)
First of all, I'm a Noosfero developer and I need to admit that the process of preparing the environment to run Noosfero right now is pretty nasty (unless you only want to run it in the production mode since we've got a debian package). But this problem is close to an end since we're a building a vagrant box (for more info see http://vagrantup.com/) to noosfero. Things are going to be much better. But regardless all this nastiness and not having the box yet, Noosfero was supposed to run if you followed all the steps in the INSTALL instructions. Let me try to help you.
Are you using Rails 2.1.0? The best way to do so is to uninstall rails from your system (if you installed through apt-get) and install through rubygems:
gem install rails -v=2.1.0
To avoid problems ensure that there isn't any other version of rails installed through rubygems (gem list).
If you still having problems to run the schema load, run it with --trace and post it here.
If you have other problems you can try contacting us through noosfero-dev#listas.softwarelivre.org or the irc #noosfero at FreeNode.
I was about to start my first Rails 3 app and thought I would upgrade to the latest version of ruby before I did and the ruby fails to make correctly.
I'm using Snow leopard on the 32bit kernal at the moment and every time I try and run 1.9.2 whether it's through readline or ssl I still get the following error:
ld: warning: in ../../libruby.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
collect2: ld returned 1 exit status
make[1]: *** [../../.ext/i386-darwin10.5.0/tcltklib.bundle] Error 1
I tried using the 64 kernal using this among other as a guide http://www.markhneedham.com/blog/2010/07/08/installing-ruby-1-9-2-with-rvm-on-snow-leopard/ but then I get a similar message saying libxml1.dylib is failing because it's not set up to 64bit.
Has anyone got any ideas? it's driving me nuts...
Ok for anyone having the same issue as me I would suggest going to 64bit kernal - if your not sure how go here
I would then follow this excellent blog post
The only other thing I need to do above this post was as well as updating libxml I also had to update libxlst (which you can download from the same source). Once I ran the install checked it was pointing to the the correct kernal then everything updated fine.
Hope that helps anyone having the same issue!
You need to make sure your Ruby is 64-bit, and the native gem drivers match it. ruby -v on 64-bit Snow Leopard should display:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0]
Your gems will complain about the architecture, returning the i386 fingerprint when there is a mismatch. To fix that you can try:
gem pristine --all
which should walk through all gems and reload them from the clean cached versions. In that process any native drives should be rebuilt.