在 Win7 上通过 vagrant 连接到 Ubuntu 12.04 64 位系统上,搭建 Rails 开发环境。其中依赖bcrypt-ruby
,安装时报错,然后就使用如下命令再次安装:
gem install bcrypt-ruby -v '3.0.1' --no-rdoc --no-ri
结果,报错如下:
Building native extensions. This could take a while...
ERROR: Error installing bcrypt-ruby:
ERROR: Failed to build gem native extension.
/home/vagrant/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
/home/vagrant/.rvm/rubies/ruby-2.0.0-p353/bin/ruby: invalid option -/ (-h will show valid options) (RuntimeError)
extconf failed, exit code 1
/gems/bcrypt-ruby-3.0.1 for inspection.e/vagrant/.rvm/gems/ruby-2.0.0-p353@awedding
/extensions/x86_64-linux/2.0.0/bcrypt-ruby-3.0.1/gem_make.outdding
上网查了,StackOverflow 上有人需要安装g++
、gcc
、libssl-dev
等,安装后这些依赖后,重试,还是报上面那个错误。然后,我把所有以libcrypt-
开头的包都装上,继续安装gem install bcrypt-ruby -v '3.0.1' --no-rdoc --no-ri
,但是还是报错。倒腾了一个多小时了,还是不行。跪求指点!