我试图运行我从heroku克隆的应用程序。
当我运行bundle install时,它会给我一个错误
type="submit"
我想我可能已经使用了sudo,但是我不应该这样做。
我使用rvm来设置和安装ruby版本。
我知道哪里出错或者尝试什么?
这是捆绑安装输出
Permission denied @ dir_s_mkdir - /Users/grant/.rvm/gems/ruby-2.2.1/gems/pg-0.18.1
----编辑
如果我再添加一个答案建议
bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.6.1
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.1
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.1
Using rack 1.6.0
Using rack-test 0.6.3
Using actionpack 4.2.1
Using globalid 0.3.5
Using activejob 4.2.1
Using mime-types 2.5
Using mail 2.6.3
Using actionmailer 4.2.1
Using activemodel 4.2.1
Using arel 6.0.0
Using activerecord 4.2.1
Using annotate 2.6.8
Using bcrypt 3.1.10
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using columnize 0.9.0
Using byebug 4.0.5
Using hitimes 1.2.2
Using timers 4.0.1
Using celluloid 0.16.0
Using coderay 1.1.0
Using database_cleaner 1.3.0
Using orm_adapter 0.5.0
Using thor 0.19.1
Using railties 4.2.1
Using responders 2.1.0
Using warden 1.2.3
Using devise 3.4.1
Using devise-bootstrap-views 0.0.4
Using diff-lcs 1.2.5
Using execjs 2.5.2
Using factory_girl 4.5.0
Using jquery-rails 4.0.3
Using method_source 0.8.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/grant/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150501-78076-1xp3o2c.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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/grant/.rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
extconf failed, exit code 1
Gem files will remain installed in /var/folders/gv/nz0x58_161x73_vks6_t_0qm0000gn/T/bundler20150501-78076-7cddl5/pg-0.18.1/gems/pg-0.18.1 for inspection.
Results logged to /var/folders/gv/nz0x58_161x73_vks6_t_0qm0000gn/T/bundler20150501-78076-7cddl5/pg-0.18.1/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.1/gem_make.out
An error occurred while installing pg (0.18.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.
~/Source/applicantlabs> gem install pg -v '0.18.1'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ dir_s_mkdir - /Users/grant/.rvm/gems/ruby-2.2.1/gems/pg-0.18.1
并运行bundle install我得到以下输出:
group :production do
gem 'pg'
gem 'rails_12factor'
end
答案 0 :(得分:1)
在Gemfile制作部分中,添加pg和rails_12factor Gems
group :production do
gem 'pg'
gem 'rails_12factor'
end
然后运行bundle install命令,提交更改并推送到heroku。