Ruby on rails RubyonRails服务器没有';开始
我目前正在从事一个项目,该项目要求我接管一个现有的RubyonRails网站并完成它。我对这个很陌生,有一些问题 我甚至不能从终端启动服务器,我怀疑这是一个与版本相关的问题,因为我刚刚将我的计算机配置为使用Ruby on Rails,并且网站开发是在一两年前开始的。如果我自己创建并处理一个项目,一切都会很好。我在OSX Mavericks旗下的MacBook上 以下是一些细节: 要启动服务器,请使用终端进入项目目录并键入:Ruby on rails RubyonRails服务器没有';开始,ruby-on-rails,Ruby On Rails,我目前正在从事一个项目,该项目要求我接管一个现有的RubyonRails网站并完成它。我对这个很陌生,有一些问题 我甚至不能从终端启动服务器,我怀疑这是一个与版本相关的问题,因为我刚刚将我的计算机配置为使用Ruby on Rails,并且网站开发是在一两年前开始的。如果我自己创建并处理一个项目,一切都会很好。我在OSX Mavericks旗下的MacBook上 以下是一些细节: 要启动服务器,请使用终端进入项目目录并键入: rails server 此命令提供以下错误消息: /Users/Da
rails server
此命令提供以下错误消息:
/Users/Davydov/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
from /Users/Davydov/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Davydov/CodingSpace/RubyWorkspace/celliptic/config/boot.rb:6:in `<top (required)>'
from /Users/Davydov/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Davydov/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from script/rails:5:in `<main>'
如果我理解得很好,这会重新安装所有gems,最后我会收到这样一条错误消息:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/Davydov/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Davydov/.rvm/rubies/ruby-2.1.0/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
extconf failed, exit code 1
Gem files will remain installed in /Users/Davydov/CodingSpace/RubyWorkspace/celliptic/vendor/bundle/ruby/2.1.0/gems/mysql2-0.3.11 for inspection.
Results logged to /Users/Davydov/CodingSpace/RubyWorkspace/celliptic/vendor/bundle/ruby/2.1.0/extensions/x86_ 64-darwin-12/2.1.0-static/mysql2-0.3.11/gem_make.out
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
此错误消息建议我应该运行,并确保在绑定之前成功:
gem install mysql2 -v '0.3.11
这就是我得到的:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/Davydov/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Davydov/.rvm/rubies/ruby-2.1.0/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
extconf failed, exit code 1
Gem files will remain installed in /Users/Davydov/.rvm/gems/ruby-2.1.0/gems/mysql2-0.3.11 for inspection.
Results logged to /Users/Davydov/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/mysql2-0.3.11/gem_make.out
此时此刻,我被困住了,不知道该怎么办。感谢您的帮助
干杯我相信有很多与mysql2 gem安装问题相关的问题您安装了mysql吗?简而言之,您需要先使用类似于自制的东西(
brew安装mysql
)来安装mysql二进制文件和库。谢谢大家,这就解决了问题!好几天了,真不敢相信我这么笨,非常感谢
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/Users/Davydov/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Davydov/.rvm/rubies/ruby-2.1.0/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
extconf failed, exit code 1
Gem files will remain installed in /Users/Davydov/.rvm/gems/ruby-2.1.0/gems/mysql2-0.3.11 for inspection.
Results logged to /Users/Davydov/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/mysql2-0.3.11/gem_make.out