This forum is no longer active. Please post your questions to our new community site

Bundler

Subscribe to Bundler 10 post(s), 5 voice(s)

 
Avatar neil 5 post(s)

I’m having problems using bundler with rails 3.
I’m using “bundle install”

And getting errors like this one for all my gems:

dlopen(/Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle, 9): no suitable image found. Did find:
/Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle: mach-o, but wrong architecture – /Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle

Any ideas?

 
Avatar danoo Administrator 81 post(s)

can you please give us more details ? What is your OS X version / architecture ?

 
Avatar neil 5 post(s)

$uname -a
10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

Also I had to remove RVM from my system. Doesn’t seem to work at all with RVM installed. I’ll get someone to post more information.

 
Avatar ryan.o 1 post

Im having the same problem. Anything that needs a C extension and actually has to compile is giving me issues. I have the same setup as Neil? Can anyone help?

 
Avatar danoo Administrator 81 post(s)

Hi,

I am not sure what can be the problem, it works on my side. Please take a look below:

- Tested on 2 machines:
Darwin computer.local 8.5.3 Darwin Kernel Version 8.5.3: Fri Feb 17 15:59:40 PST 2006; root:xnu-792.9.11.obj~1/RELEASE_I386 i386 i386
Darwin Mac-mini-2.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

- $./rubyconsole
- Updated RubyStack 2.1.0 rails to 3.0.0 and created a new sample project
$ gem install rails —no-ri —no-rdoc
$ rails new sample
- Added some gems to Gemfile
- … and everything was installed ok with bundle install (bcrypt-ruby, ffi, rubydebug, unicorn etc.)
Installing bcrypt-ruby (2.1.2) with native extensions
Installing linecache (0.43) with native extensions
Installing nokogiri (1.4.3.1) with native extensions
Installing ruby-debug-base (0.10.3) with native extensions
Installing unicorn (1.1.3) with native extensions
Installing ffi (0.6.3) with native extensions

Any ideas ?
Danoo

 
Avatar neil 5 post(s)

Installing the gems works just fine.
I load the server up and try add a user and get this error.

dlopen(/Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle, 9): no suitable image found. Did find:
/Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle: mach-o, but wrong architecture – /Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle
Rails.root: /Applications/rubystack-2.1-0/projects/temp-proj

Application Trace | Framework Trace | Full Trace
This error occurred while loading the following files:
bcrypt
bcrypt_ext

 
Avatar danoo Administrator 81 post(s)

Hi,

Can you please check the output of the following command:

$ find /rubystack-dir/ruby -name “*.bundle” | xargs file| grep bcrypt

I think we know what can be the problem. The bundler compiled the gems for x64 architecture.

If it is the case, then please try to uninstall all the gems built previously for x64 and then execute the ‘bundle install’ command in the following way:

$ CONFIGURE_ARGS=“—with-cflags=‘-m32’ —with-ldflags=‘-m32’” bundle install

I hope it will help.
Danoo

 
Avatar neil 5 post(s)

Yes it is compiling to x64.

I’ve tried a gem install passing your flags as well as “env ARCHFLAGS=”-arch i386" and it still compiles to 64.

bash-3.2$ CONFIGURE_ARGS=“—with-cflags=‘-m32’ —with-ldflags=‘-m32’” gem install bcrypt-ruby
Building native extensions. This could take a while…
Successfully installed bcrypt-ruby-2.1.2
1 gem installed
Installing ri documentation for bcrypt-ruby-2.1.2…
Building YARD (yri) index for bcrypt-ruby-2.1.2…
Installing RDoc documentation for bcrypt-ruby-2.1.2…
bash-3.2$ find /Applications/rubystack-2.1-0/ruby -name “*.bundle” |xargs file| grep bcrypt
/Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/bcrypt_ext.bundle: Mach-O 64-bit bundle x86_64
/Applications/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/bcrypt-ruby-2.1.2/lib/bcrypt_ext.bundle: Mach-O 64-bit bundle x86_64

 
Avatar ralfthewise 1 post

I realize this topic is old and these forums are deprecated, but thought I would post here since I spent a while figuring this out.

Turns out the Bitnami ruby stack for OSX is kind of screwed up (using 2.2-2, maybe it’s fixed in newer versions). If you look at /Applications/rubystack-2.2-2/scripts/setenv.sh in an editor like vim you may notice that the

CONFIGURE_ARGS=“—with-cflags=‘-m32’ —with-ldflags=‘-m32’”

line is a bit odd. Specifically I think they used some sort of unicode/utf8 type character for the double-dash before the “with” arguments. Turns out ruby doesn’t like this (maybe this is fixed with ruby 1.9 as well, since it has better unicode/utf8 support, but the ruby shipped with this rubystack is 1.8.7) and interprets those arguments as:

\342\200\224with-cflags

this in turn causes those arguments to not be parsed correctly, which breaks mkmf and the construction of the Makefile, which in turn causes the native gems to generate x64 binaries. Deleting that weird double-dash character and replacing it with 2 ascii ‘-’ characters fixes things. I guess people using these stacks probably aren’t building gems outside of what is already included otherwise they’d be using macports/brew/RVM/bundler etc. and so it probably doesn’t come up all that often.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Thanks for reporting it, we noticed the issue and we are working on a new RubyStack version.