chrismccord / labrador

A loyal data retriever for your Rails development databases.
http://chrismccord.github.com/labrador/
253 stars 15 forks source link

can't make amalgalite gem #5

Closed pawel2105 closed 11 years ago

pawel2105 commented 12 years ago

Tried installing labrador and got as far as the amalgalite gem. Does it need a specific version of clang or gcc? Which version do you have? I've got gcc 4.2.1 and glang 3.1 on OSX 10.7.4

simpleton:.labrador cynicalgrinch$ gem install amalgalite
Building native extensions.  This could take a while...
ERROR:  Error installing amalgalite:
ERROR: Failed to build gem native extension.

    /Users/simpleton/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:25: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile

make
compiling amalgalite3.c
clang: error: no such file or directory: '3'
make: *** [amalgalite3.o] Error 1
chrismccord commented 12 years ago

I'm running llvm-gcc 4.2.1 on OSX 10.8 and have another OSX 10.7.3 machine (also gcc 4.2.1) that Labrador is building ok on. Both are also using ruby 1.9.3 so it would appear to be a gcc issue.

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
DanielKehoe commented 12 years ago

I've run into the same problem. Can't install Labrador because I can't install the amalgalite gem.

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
$ rvm -v
rvm 1.15.8
$ gem list

*** LOCAL GEMS ***

arrayfields (4.7.4)
bundler (1.2.0)
fastercsv (1.5.5)
git_remote_branch (0.3.3)
rainbow (1.1.4)
rake (0.9.2.2)
rubygems-bundler (1.0.7)
rvm (1.11.3.5)

$ gem install amalgalite -v '1.1.2'
Building native extensions.  This could take a while...
ERROR:  Error installing amalgalite:
    ERROR: Failed to build gem native extension.

        /Users/danielkehoe/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:25: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile

make
compiling amalgalite3.c
clang: error: no such file or directory: '3'
make: *** [amalgalite3.o] Error 1

I opened an issue: https://github.com/copiousfreetime/amalgalite/issues/23

chrismccord commented 12 years ago

I just successfully built labrador using ruby 1.9.3p194 (my previous builds were on 1.9.3p125). So that probably rules out a ruby version issue.

chrismccord commented 12 years ago

I may have spoke too soon. If I run rvm requirements on my OSX 10.7 machine, I get the following note:

Xcode 4.2:
  * is only supported by ruby 1.9.3+ using command line flag: --with-gcc=clang
  * it breaks gems with native extensions, especially DB drivers.

Xcode 4.2 and later (including Command Line Tools for Xcode):
- If you have gcc-4.2 (and friends) from an earlier Xcode version, Ruby will build fine.
- If you don't have gcc-4.2, you have two options to get it:
 * Install apple-gcc42 from Homebrew
 * Install osx-gcc-installer

  Homebrew:

  If you are using Homebrew, you can install the apple-gcc42 and required libraries from homebrew/dupes:

      brew update
      brew tap homebrew/dupes
      brew install autoconf automake apple-gcc42
      rvm pkg install openssl

  This can live side by side with an existing Xcode 4.2+ install or Command Line Tools for Xcode.

  osx-gcc-installer:

  If you don't use Homebrew, you can download and install osx-gcc-installer: https://github.com/kennethreitz/osx-gcc-installer.

  Warning: Installing osx-gcc-installer on top of a recent Xcode is known to cause problems, so you must uninstall Xcode before installing osx-gcc-installer. Afterwards you may install Xcode 4.2+ or Command Line Tools for Xcode if you desire.

  ** NOTE: Currently, Node.js is having issues building with osx-gcc-installer. The only fix is to install Xcode over osx-gcc-installer.

So this could be an issue where ruby 1.9.3 was built with clang. This may be a long shot, but try:

$ cd ~/.labrador
$ CC=clang gem install amalgalite -v '1.1.2'

If that's successful:

$ bundle install --deployment
$ cd ~/.pow && ln -s ~/.labrador labrador
$ open -e ~/.labrador/config/initializers/auth.rb

If that fails, theres the apple-gcc42 via homebrew route that you could reinstall a ruby with, and hopefully get around this issue.

DanielKehoe commented 12 years ago

No success with CC=clang gem install amalgalite -v '1.1.2'.

$ rvm gemset use global
Using ruby-1.9.3-p194 with gemset global
 $ gem list

*** LOCAL GEMS ***

bundler (1.2.0)
git_remote_branch (0.3.3)
rainbow (1.1.4)
rake (0.9.2.2)
rubygems-bundler (1.0.7)
rvm (1.11.3.5)

 $ CC=clang gem install amalgalite -v '1.1.2'
Fetching: arrayfields-4.7.4.gem (100%)
Fetching: fastercsv-1.5.5.gem (100%)
Fetching: amalgalite-1.1.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing amalgalite:
    ERROR: Failed to build gem native extension.

        /Users/danielkehoe/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:25: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile

make
compiling amalgalite3.c
clang: error: no such file or directory: '3'
make: *** [amalgalite3.o] Error 1

I don't understand your suggestion about the "apple-gcc42 via homebrew route". Do you mean attempt to replace the system ruby? I don't think I want to do that. Is there a problem installing amalgalite under rvm?

It looks like the amalgalite project is not very active. I wonder if I should expect support there.

chrismccord commented 12 years ago

I was suggesting trying to install apple-gcc42 from Homebrew as rvm requirements might suggest, but it looks like it could cause Xcode issues, so I wouldn't jump right to that. Do you have the latest Xcode command line tools installed? (can be installed if you open Xcode and go to preferences -> downloads). If not, that would be worth giving a shot, since it resolved my non related native extension issues after my Lion upgrade.

DanielKehoe commented 12 years ago

What about the error message "Use RbConfig instead of obsolete and deprecated Config." What is that about? Is that a red herring? Are you pretty sure it is a clang error?

DanielKehoe commented 12 years ago

I believe I have the Xcode command line tools installed. How can I check?

If I do, what should I try?

chrismccord commented 12 years ago

I'm not sure about the RbConfig message (I think it's just a warning). I was caught up on the clang error. I'm just grasping at straws - hopefully we can get this sorted out for you. Any chance amalgalite builds on ruby 1.9.2 for you?

DanielKehoe commented 12 years ago

I appreciate your efforts. And Labrador looks very useful. But I'll wait to pursue this further when I have some extra time.

chrismccord commented 12 years ago

An interim solution would be to comment out gem 'amalgalite' from the gemfile and then:

$ bundle install --deployment
$ cd ~/.pow && ln -s ~/.labrador labrador
$ open -e ~/.labrador/config/initializers/auth.rb

Labrador should then still boot and work for non sqlite apps. Of course this isn't much help if your dev environments are mainly using the sqlite adapter.

pawel2105 commented 12 years ago

It's a start.

tomcanham commented 12 years ago

Yeah, unfortunately, this is a blocker for me, too. And most of my initial dev cuts are SQLite, so... I'll wait until a replacement for (or fix for) amalgalite can be found.

chrismccord commented 12 years ago

It looks like the ticket @pawel2105 submitted to amalgalite was closed three days ago. Could anyone try this out on their local copy and report back success with the latest update?

$ cd ~/.labrador

change Gemfile line 8 to gem 'amalgalite', git: "git://github.com/copiousfreetime/amalgalite.git"

$ bundle

and report back. Thanks

robgough commented 12 years ago

Unfortunately updating the Gemfile to gem 'amalgalite', git: "git://github.com/copiousfreetime/amalgalite.git" gives me the following error.

Fetching gem metadata from https://rubygems.org/.........
Could not find gem 'amalgalite (>= 0) ruby' in git://github.com/copiousfreetime/amalgalite.git (at master).
Source does not contain any versions of 'amalgalite (>= 0) ruby'
livando commented 11 years ago

This solves the issue:

gem 'amalgalite', '1.3.0', git: "git://github.com/copiousfreetime/amalgalite.git"

chrismccord commented 11 years ago

@livando Thanks much. Merged in https://github.com/chrismccord/labrador/pull/14