我不会一开始就说我是个新手之类的笑话,我在Lynda.com上学了将近一个月的Rails。我用Mac,MacOSXLion10.7。
我试着把所有的纸夹在一起,但我似乎不知道我做错了什么。
我遵循了https://github.com/thoughtbot/paperclip/wiki/Installation上的说明
我将这一行添加到config/environment.rb中
config.gem 'paperclip', :source => 'http://rubygems.org'然后我试着跑
rake gems:install我收到一条错误消息:
(in /Users/fred/Ruby/food)
rake aborted!
undefined local variable or method `config' for main:Object
/Users/fred/Ruby/food/Rakefile:4:in `require'
(See full trace by running task with --trace)之后,当上面的失败时,我尝试了以下选项
script/plugin install git://github.com/thoughtbot/paperclip我得到以下错误
-bash: script/plugin: No such file or directory我的问题是如何安装这个宝石?我读过很多其他的帖子说我应该包括gem 'paperclip', "~> 2.3",这和我上面做的一样吗?
发布于 2011-08-07 09:42:12
最好用邦德勒。步骤如下
gem install bundlerGemfile:config.gem 'paperclip'cd到Gemfile所在的位置并运行:bundle install。这将安装Gemfile中提到的所有宝石Ps。我假设您没有使用rvm。此外,在上面的步骤1中,您可能需要在命令中前缀sudo,以防该命令由于权限问题而无法工作。
https://stackoverflow.com/questions/6971579
复制相似问题