cristianrasch / cuba-demo

Cuba micro-framework demo
6 stars 3 forks source link

Gemfile Error #1

Closed cdcme closed 12 years ago

cdcme commented 12 years ago
Projects/cuba-demo/Gemfile:22: syntax error, unexpected ':', expecting $end
gem "rake", group: :production
                  ^ (SyntaxError)
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:18:in `build'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:135:in `definition'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/cli.rb:220:in `install'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in `send'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in `run'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor.rb:263:in `dispatch'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/base.rb:386:in `start'
       /Users/carlodicelico/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/bin/bundle:13
       /usr/bin/bundle:19:in `load'
       /usr/bin/bundle:19
There was an error in your Gemfile, and Bundler cannot continue.

I resolved it by changing line 22 in Gemfile from:

gem "rake", group: :production

to:

gem "rake", :group => :production
cristianrasch commented 12 years ago

Hi Carlo,

Any chance you are on Ruby 1.8.x? Please take a look at the .rvmrc file, as it recommends using Ruby 1.9.x to run this project.

rvm ruby-1.9.3-p125@cuba-demo --create

Please let me know if that doesn't make sense to you, I'll help you out.

Cheers, Cristian!

cdcme commented 12 years ago

➤ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]

cristianrasch commented 12 years ago

Hey Carlo,

It does work for me, see:

cris@laptop:~/Documents/workspace/ruby/cuba-demo$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
cris@laptop:~/Documents/workspace/ruby/cuba-demo$ gem list --local

*** LOCAL GEMS ***

bundler (1.1.4)
rake (0.9.2.2)
rubygems-bundler (1.0.2)
rvm (1.11.3.4)
cris@laptop:~/Documents/workspace/ruby/cuba-demo$ bundle install
Fetching gem metadata from https://rubygems.org/......
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2) 
Installing i18n (0.6.0) 
Installing multi_json (1.3.5) 
Installing activesupport (3.2.3) 
Installing addressable (2.2.8) 
Installing highline (1.6.12) 
Installing net-ssh (2.5.2) 
Installing net-scp (1.0.4) 
Installing net-sftp (2.0.5) 
Installing net-ssh-gateway (1.1.0) 
Installing capistrano (2.12.0) 
Installing mime-types (1.18) 
Installing nokogiri (1.5.2) with native extensions 
Installing rack (1.4.1) 
Installing rack-test (0.6.1) 
Installing ffi (1.0.11) with native extensions 
Installing childprocess (0.3.2) 
Installing libwebsocket (0.1.3) 
Installing rubyzip (0.9.8) 
Installing selenium-webdriver (2.21.2) 
Installing xpath (0.1.4) 
Installing capybara (1.1.2) 
Installing cuba (3.0.0) 
Installing factory_girl (3.3.0) 
Installing rack-protection (1.2.0) 
Installing rack_csrf (2.4.0) 
Installing rvm-capistrano (1.2.2) 
Installing sequel (3.35.0) 
Installing sqlite3 (1.3.6) with native extensions 
Installing tilt (1.3.3) 
Using bundler (1.1.4) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Can you attach a similar output of your environment? You 100% sure you are on 1.9 while running the bundle install command? Should work just fine..are you also using RVM?

cdcme commented 12 years ago
Last login: Mon Jun 18 18:27:42 on ttys000
[~] 
➤ rvm -v
rvm 1.14.2 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
[~] 
➤ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]

It worked fine once I change line 22 as described above. It also works fine if I edit .rvmrc, changing p125 to p194 (my version). Here's the bundle install output:

➤ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0]
[~/Projects] 
➤ cd cuba-demo/
====================================================================================
= NOTICE                                                                           =
====================================================================================
= RVM has encountered a new or modified .rvmrc file in the current directory       =
= This is a shell script and therefore may contain any shell commands.             =
=                                                                                  =
= Examine the contents of this file carefully to be sure the contents are          =
= safe before trusting it! ( Choose v[iew] below to view the contents )            =
====================================================================================
Do you wish to trust this .rvmrc file? (/Users/carlodicelico/Projects/cuba-demo/.rvmrc)
y[es], n[o], v[iew], c[ancel]> y
[~/Projects/cuba-demo] 
➤ bundle install
Fetching gem metadata from https://rubygems.org/......
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2) 
Installing i18n (0.6.0) 
Installing multi_json (1.3.5) 
Installing activesupport (3.2.3) 
Installing addressable (2.2.8) 
Installing highline (1.6.12) 
Installing net-ssh (2.5.2) 
Installing net-scp (1.0.4) 
Installing net-sftp (2.0.5) 
Installing net-ssh-gateway (1.1.0) 
Installing capistrano (2.12.0) 
Installing mime-types (1.18) 
Installing nokogiri (1.5.2) with native extensions 
Installing rack (1.4.1) 
Installing rack-test (0.6.1) 
Installing ffi (1.0.11) with native extensions 
Installing childprocess (0.3.2) 
Installing libwebsocket (0.1.3) 
Installing rubyzip (0.9.8) 
Installing selenium-webdriver (2.21.2) 
Installing xpath (0.1.4) 
Installing capybara (1.1.2) 
Installing cuba (3.0.0) 
Installing factory_girl (3.3.0) 
Installing rack-protection (1.2.0) 
Installing rack_csrf (2.4.0) 
Installing rvm-capistrano (1.2.2) 
Installing sequel (3.35.0) 
Installing sqlite3 (1.3.6) with native extensions 
Installing tilt (1.3.3) 
Using bundler (1.1.3) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
[~/Projects/cuba-demo] 
➤ 
cdcme commented 12 years ago

Here are my updated files (.rvmrc and Gemfile):

[~/Projects/cuba-demo] 
➤ cat .rvmrc
rvm ruby-1.9.3-p194@cuba-demo --create
[~/Projects/cuba-demo] 
➤ cat Gemfile
source "https://rubygems.org"

gem "cuba"
gem "rack_csrf"
gem "rack-protection"
gem "tilt"
gem "sqlite3"
gem "sequel"

group :development do
  gem "capistrano"
  gem "rvm-capistrano"
end

group :test do
  gem "capybara"
  # gem "capybara-webkit"
  # gem "launchy"
  gem "factory_girl", "~> 3.0"
end

gem "rake", :group => :production

[~/Projects/cuba-demo] 
➤ 
cristianrasch commented 12 years ago

Well, that's a bummer! Other than the fact that you are using Bundler 1.1.3 and I'm using version 1.1.4 I can't point out any other difference. Still, given we are both on Ruby 1.9, we should be able to use the new-style hash syntax in the Gemfile :S Sorry I can't reproduce the issue, if you ever find out what's wrong do please let me know. Closing the issue for now. Take care!

cdcme commented 12 years ago

Okay, no problem. I was able to get it working, so that's the important thing. Thanks!

Carlo DiCelico

On Monday, June 18, 2012 at 7:14 PM, Cristian Rasch wrote:

Well, that's a bummer! Other than the fact that you are using Bundler 1.1.3 and I'm using version 1.1.4 I can't point out any other difference. Still, given we are both on Ruby 1.9, we should be able to use the new-style hash syntax in the Gemfile :S Sorry I can't reproduce the issue, if you ever find out what's wrong do please let me know. Closing the issue for now. Take care!


Reply to this email directly or view it on GitHub: https://github.com/cristianrasch/cuba-demo/issues/1#issuecomment-6411991