How can I fix "not found: object net" and "not found: value Http"?

402 views
Skip to first unread message

Emre Sevinc

unread,
Oct 31, 2014, 6:48:31 AM10/31/14
to raptur...@googlegroups.com
Hello,

I'm trying to run a very simple that I've found on the Rapture web page but I'm receiving  "not found: object net" and "not found: value Http" errors. How can I fix this?

Please see my build.sbt and Scala source code below:

build.sbt
================================================================
name := "belga"

version := "1.0"

scalaVersion := "2.11.2"

libraryDependencies ++= Seq("com.propensive" %% "rapture-core" % "1.0.0")

libraryDependencies ++= Seq("com.propensive" %% "rapture-json-jackson" % "1.0.6")

libraryDependencies ++= Seq("com.propensive" %% "rapture-io" % "0.10.0")

Source code:
================================================================
import rapture._
import core._, io._, net._, uri._, codec._

object ArticleDownloader extends App {
  Console.println("Article Downloader: " + (args mkString ", "))

  // Read a file into a string
  import encodings.`UTF-8`
  val src = uri"http://www.cnn.com/".slurp[Char]
}


sbt session with errors:
==========================================================================
> compile
[warn] Scala version was updated by one of library dependencies:
[warn] * org.scala-lang:scala-library:(2.11.2, 2.11.1, 2.11.0) -> 2.11.4
[warn] To force scalaVersion, add the following:
[warn] ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[info] Compiling 1 Scala source to /home/emre/code/scala/belga/target/scala-2.11/classes...
[error] /home/emre/code/scala/belga/src/main/scala/ArticleDownloader.scala:2: not found: object net
[error] import core._, io._, net._, uri._, codec._
[error]                             ^
[error] /home/emre/code/scala/belga/src/main/scala/ArticleDownloader.scala:9: not found: value Http
[error]   val src = uri"http://www.cnn.com/".slurp[Char]
[error]                 ^
[error] two errors found
[error] (compile:compile) Compilation failed
[error] Total time: 3 s, completed Oct 31, 2014 11:41:08 AM

Emre Sevinc

unread,
Oct 31, 2014, 6:56:12 AM10/31/14
to raptur...@googlegroups.com
Well, apparently the following dependency was missing in build.sbt:

libraryDependencies ++= Seq("com.propensive" %% "rapture-net" % "0.10.0")

Seems like problem solved!

Jon Pretty

unread,
Oct 31, 2014, 10:20:37 AM10/31/14
to raptur...@googlegroups.com
Yes, you'll need the rapture-net (for network operations) and potentially the rapture-fs (for filesystem operations) packages. They're always released with the same version numbers as rapture-io.

Which documentation were you using? I guess I've neglected to explain this - I'd like to go back and fix that!

Cheers,
Jon

--
You received this message because you are subscribed to the Google Groups "Rapture users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rapture-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jon Pretty | @propensive

Emre Sevinc

unread,
Oct 31, 2014, 10:33:06 AM10/31/14
to raptur...@googlegroups.com

On Friday, October 31, 2014 3:20:37 PM UTC+1, Jon Pretty wrote:
Which documentation were you using? I guess I've neglected to explain this - I'd like to go back and fix that!


I've found myself jumping between various GitHub pages and http://rapture.io/. I believe having a "Documentation" link at the top of http://rapture.io/ and then providing the authoritative documentation (with clear examples and a link to Scaladoc) can give a huge boost to newcomers to this nice library. 

--
Emre

Malcolm Greaves

unread,
Dec 1, 2014, 7:33:16 PM12/1/14
to raptur...@googlegroups.com
+1

I think another helpful thing would be to include the build.sbt file that allows one to use the example that appears first on rapture.io
Reply all
Reply to author
Forward
0 new messages