$ sudo bundle install
Run Code Online (Sandbox Code Playgroud)
结果
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.4)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.11)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo …Run Code Online (Sandbox Code Playgroud) 我正在使用Hartl的Rails教程构建twitter克隆应用程序.我克隆了我的git repo(https://github.com/stewartmccoy/rails_tutorial)并将代码放到我以前在我的工作计算机上的个人计算机上.因此,我的开发人员环境可能与我的Gemfile中指定的略有不同.
我的环境:Mac OS 10.6.8 Rails 3.2.13 ruby 1.9.3p392(2013-02-22修订版39386)[x86_64-darwin10.8.0]
*本地宝石*
我在OSX mavericks上安装postgres时遇到问题.我试图在Stackoverflow上遵循众多指南而没有运气.我安装了postgres.app和postgres.我找到了我的pg_config文件并尝试了这个命令:
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Run Code Online (Sandbox Code Playgroud)
但我仍然得到这个错误
Building native extensions with: '--with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config .'
This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config .
Using config values from /Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed *** …Run Code Online (Sandbox Code Playgroud) 我刚买了一台新笔记本电脑,并使用Migration Assistant完全转移了所有内容.看起来一切正常并处于适当的位置,所以我不知道这是不是问题.我仍然是调试这样的环境错误的新手.
我一直在Windows上开发一个rails项目,这台笔记本电脑是Mac OS X 10.8.我之前已经克隆了一个GitHub项目,它运行良好.这是github回购供参考.当我运行bundle时,这个项目会出错
错误
Using rake (10.1.0)
Using i18n (0.6.1)
Using multi_json (1.8.2)
Using activesupport (3.2.13)
Using builder (3.0.4)
Using activemodel (3.2.13)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.13)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (3.2.13)
Using arel (3.0.2)
Using tzinfo (0.3.38)
Using activerecord (3.2.13)
Using activeresource …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的 rails 应用程序安装到 Heroku,但是在尝试安装 pg gem 时遇到了问题。我被告知将 Gemfile 中的“gem 'sqlite3'”行替换为以下内容:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_stdout_logging'
end
Run Code Online (Sandbox Code Playgroud)
然后执行捆绑安装。我收到此错误消息:
...
Using coffee-rails (3.2.2)
Using jquery-rails (3.0.4)
Installing pg (0.17.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes …Run Code Online (Sandbox Code Playgroud) 我教自己铁路.我是程序员但不是网络程序员.我在这里浏览Michael Hartl的书
它提到从一开始就开始部署应用程序是一个好主意.我同意.所以我在Heroku上获得了一个帐户并经历了设置等.然后创建了我的第一个应用程序,git和工程.然后按照Heroku网站上的所有说明进行操作.最后,我使用此命令将我的应用程序推送到Heroku:
git push heroku master
Run Code Online (Sandbox Code Playgroud)
这本书说在这个阶段可能会出现问题,因为我的机器上的应用程序使用的是sqlite3而Heroku需要postgresql.这本书建议改变我的应用程序的gem文件中的一行
gem 'sqlite3'
Run Code Online (Sandbox Code Playgroud)
至
gem 'sqlite3-ruby', :group => :development
Run Code Online (Sandbox Code Playgroud)
我尝试了然后运行bundle install然后尝试推送应用程序.没有运气我在我的控制台上收到此消息:
An error occured while installing sqlite3 (1.3.6), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)
!!无法通过Bundler安装gem.!!Heroku推送拒绝,无法编译Ruby/rails应用程序
所以我尝试了Heroku网站在这里建议的内容
改变我的宝石文件
由此:
gem 'sqlite3'
Run Code Online (Sandbox Code Playgroud)
对此:
gem 'pg'
Run Code Online (Sandbox Code Playgroud)
所以我尝试了这种方法然后运行'捆绑安装'.但这也不起作用.我在控制台上收到此消息:
Installing pg (0.13.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/AM/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building …Run Code Online (Sandbox Code Playgroud)